94 #if defined(HAVE_FENV_H) && defined(HAVE_FEENABLEEXCEPT)
100 #include "Framework/Conventions/GBuild.h"
114 #ifdef __GENIE_GEOM_DRIVERS_ENABLED__
121 using namespace genie;
123 #ifdef __GENIE_GEOM_DRIVERS_ENABLED__
124 using namespace genie::geometry;
145 int main(
int argc,
char ** argv)
151 LOG(
"gmkspl",
pFATAL) <<
" No TuneId in RunOption";
157 #if defined(HAVE_FENV_H) && defined(HAVE_FEENABLEEXCEPT)
158 feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
171 if(!neutrinos || neutrinos->size() == 0 ) {
172 LOG(
"gmkspl",
pFATAL) <<
"Empty neutrino PDG code list";
176 if(!targets || targets->size() == 0 ) {
177 LOG(
"gmkspl",
pFATAL) <<
"Empty target PDG code list";
182 LOG(
"gmkspl",
pINFO) <<
"Neutrinos: " << *neutrinos;
183 LOG(
"gmkspl",
pINFO) <<
"Targets: " << *targets;
189 PDGCodeList::const_iterator nuiter;
190 PDGCodeList::const_iterator tgtiter;
191 for(nuiter = neutrinos->begin(); nuiter != neutrinos->end(); ++nuiter) {
192 for(tgtiter = targets->begin(); tgtiter != targets->end(); ++tgtiter) {
193 int nupdgc = *nuiter;
194 int tgtpdgc = *tgtiter;
216 LOG(
"gmkspl",
pINFO) <<
"Parsing command line arguments";
227 if( parser.OptionExists(
'o') ||
228 parser.OptionExists(
"output-cross-sections") )
230 LOG(
"gmkspl",
pINFO) <<
"Reading output filename";
231 if( parser.OptionExists(
'o') ) {
238 LOG(
"gmkspl",
pINFO) <<
"Unspecified filename - Using default";
243 if( parser.OptionExists(
'n') ) {
244 LOG(
"gmkspl",
pINFO) <<
"Reading number of knots/spline";
248 <<
"Unspecified number of knots - Using default";
253 if( parser.OptionExists(
'e') ) {
254 LOG(
"gmkspl",
pINFO) <<
"Reading maximum spline energy";
258 <<
"Unspecified maximum spline energy - Using default";
263 if( parser.OptionExists(
"no-copy") ) {
264 LOG(
"gmkspl",
pINFO) <<
"Not copying input splines to output";
269 if( parser.OptionExists(
'p') ) {
270 LOG(
"gmkspl",
pINFO) <<
"Reading neutrino PDG codes";
274 <<
"Unspecified neutrino PDG code list - Exiting";
281 if( parser.OptionExists(
't') ) {
282 LOG(
"gmkspl",
pINFO) <<
"Reading target nuclei PDG codes";
285 LOG(
"gmkspl",
pINFO) <<
"No code list specified from the command line";
289 bool tgt_geom =
true;
290 if( parser.OptionExists(
'f') ) {
291 LOG(
"gmkspl",
pINFO) <<
"Reading ROOT geometry filename";
294 LOG(
"gmkspl",
pINFO) <<
"No geometry file was specified";
298 bool both = tgt_geom && tgt_cmd;
299 bool none = !tgt_geom && !tgt_cmd;
302 <<
"No geom file or cmd line target list was specified - Exiting";
308 <<
"You specified both a geom file and a cmd line target list "
309 <<
"- Exiting confused";
315 if( parser.OptionExists(
"seed") ) {
316 LOG(
"gmkspl",
pINFO) <<
"Reading random number seed";
319 LOG(
"gmkspl",
pINFO) <<
"Unspecified random number seed - Using default";
324 if( parser.OptionExists(
"input-cross-sections") ) {
325 LOG(
"gmkspl",
pINFO) <<
"Reading cross-section file";
328 LOG(
"gmkspl",
pINFO) <<
"Unspecified input cross-section file";
352 <<
"\n\n" <<
"Syntax:" <<
"\n"
353 <<
" gmkspl -p nupdg"
354 <<
"\n <-t tgtpdg, -f geomfile> "
355 <<
"\n <-o | --output-cross-sections> xsec_xml_file_name"
357 <<
"\n [-e max_energy]"
359 <<
"\n [--seed seed_number]"
360 <<
"\n [--input-cross-sections xml_file]"
373 vector<string>::const_iterator iter;
374 for(iter = nuvec.begin(); iter != nuvec.end(); ++iter) {
391 vector<string>::const_iterator iter;
392 for(iter = tgtvec.begin(); iter != tgtvec.end(); ++iter) {
398 if (from_geom_file) {
399 #ifdef __GENIE_GEOM_DRIVERS_ENABLED__
401 LOG(
"gmkspl",
pINFO) <<
"Creating/configuring a ROOT geom. driver";
410 <<
"To read-in a ROOT geometry you need to enable the geometry drivers!";
void RandGen(long int seed)
PDGCodeList * GetTargetCodes(void)
void XSecTable(string inpfile, bool require_table)
PDGCodeList * GetNeutrinoCodes(void)
void ReadFromCommandLine(int argc, char **argv)
static XSecSplineList * Instance()
virtual const PDGCodeList & ListOfTargetNuclei(void)
implement the GeomAnalyzerI interface
int main(int argc, char **argv)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void SetEventGeneratorList(string listname)
static std::string RunOptSyntaxString(bool include_generator_specific)
string gOptTgtPdgCodeList
A ROOT/GEANT4 geometry driver.
GENIE Event Generation Driver. A minimalist user interface object for generating neutrino interaction...
void BuildTune()
build tune and inform XSecSplineList
void SaveAsXml(const string &filename, bool save_init=true) const
static RunOpt * Instance(void)
vector< string > Split(string input, string delim)
void Configure(int nu_pdgc, int Z, int A)
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
A vector of EventGeneratorI objects.
void CreateSplines(int nknots=-1, double emax=-1, bool inLogE=true)
void MesgThresholds(string inpfile)
Command line argument parser.
void GetCommandLineArgs(int argc, char **argv)
List of cross section vs energy splines.
void EnableBareXSecPreCalc(bool flag)
void push_back(int pdg_code)
Initial State information.