315 LOG(
"gevgen_ndcy",
pINFO) <<
"Parsing command line arguments";
318 RunOpt::Instance()->ReadFromCommandLine(argc,
argv);
332 if(
parser.OptionExists(
'r') ) {
333 LOG(
"gevgen_ndcy",
pDEBUG) <<
"Reading MC run number";
336 LOG(
"gevgen_ndcy",
pDEBUG) <<
"Unspecified run number - Using default";
342 if(
parser.OptionExists(
'n') ) {
344 <<
"Reading number of events to generate";
348 <<
"You need to specify the number of events";
355 if(
parser.OptionExists(
'm') ) {
357 <<
"Reading decay mode";
358 mode =
parser.ArgAsInt(
'm');
361 <<
"You need to specify the decay mode";
368 if(
parser.OptionExists(
'N') ) {
369 LOG(
"gevgen_ndcy",
pINFO) <<
"Reading decayed nucleon PDG";
372 LOG(
"gevgen_ndcy",
pINFO) <<
"Unspecified decayed nucleon PDG - Using default";
379 <<
"You need to specify a valid decay mode / decayed nucleon PDG combination";
389 string lunits, dunits;
390 if(
parser.OptionExists(
'g') ) {
391 LOG(
"gevgen_ndcy",
pDEBUG) <<
"Getting input geometry";
392 geom =
parser.ArgAsString(
'g');
395 bool accessible_geom_file =
396 ! (gSystem->AccessPathName(geom.c_str()));
397 if (accessible_geom_file) {
403 <<
"No geometry option specified - Exiting";
412 if(
parser.OptionExists(
'L') ) {
414 <<
"Checking for input geometry length units";
415 lunits =
parser.ArgAsString(
'L');
417 LOG(
"gevgen_ndcy",
pDEBUG) <<
"Using default geometry length units";
421 if(
parser.OptionExists(
'D') ) {
423 <<
"Checking for input geometry density units";
424 dunits =
parser.ArgAsString(
'D');
426 LOG(
"gevgen_ndcy",
pDEBUG) <<
"Using default geometry density units";
434 if(
parser.OptionExists(
't') ) {
435 LOG(
"gevgen_ndcy",
pDEBUG) <<
"Checking for input volume name";
438 LOG(
"gevgen_ndcy",
pDEBUG) <<
"Using the <master volume>";
451 if(tgtmix.size()==1) {
452 int pdg = atoi(tgtmix[0].c_str());
454 gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
457 for( ; tgtmix_iter != tgtmix.end(); ++tgtmix_iter) {
458 string tgt_with_wgt = *tgtmix_iter;
459 string::size_type open_bracket = tgt_with_wgt.find(
"[");
460 string::size_type close_bracket = tgt_with_wgt.find(
"]");
461 if (open_bracket ==string::npos ||
462 close_bracket==string::npos)
465 <<
"You made an error in specifying the target mix";
469 string::size_type ibeg = 0;
470 string::size_type iend = open_bracket;
471 string::size_type jbeg = open_bracket+1;
472 string::size_type jend = close_bracket;
473 int pdg = atoi(tgt_with_wgt.substr(ibeg,iend-ibeg).c_str());
474 double wgt = atof(tgt_with_wgt.substr(jbeg,jend-jbeg).c_str());
476 <<
"Adding to target mix: pdg = " << pdg <<
", wgt = " << wgt;
477 gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
484 if(
parser.OptionExists(
'o') ) {
485 LOG(
"gevgen_ndcy",
pDEBUG) <<
"Reading the event filename prefix";
489 <<
"Will set the default event filename prefix";
495 if(
parser.OptionExists(
"seed") ) {
496 LOG(
"gevgen_ndcy",
pINFO) <<
"Reading random number seed";
499 LOG(
"gevgen_ndcy",
pINFO) <<
"Unspecified random number seed - Using default";
509 ostringstream gminfo;
511 gminfo <<
"Using ROOT geometry - file: " <<
gOptRootGeom 514 <<
", length units: " << lunits
515 <<
", density units: " << dunits;
517 gminfo <<
"Using target mix - ";
520 int pdg_code = iter->first;
521 double wgt = iter->second;
522 TParticlePDG *
p = pdglib->
Find(pdg_code);
524 string name = p->GetName();
525 gminfo <<
"(" << name <<
") -> " << 100*wgt <<
"% / ";
538 <<
"\n @@ Geometry $ " << gminfo.str()
539 <<
"\n @@ Statistics $ " <<
gOptNev <<
" events";
546 <<
"\n ** ROOT geometries not supported yet in the nucleon decay mode" 547 <<
"\n ** (they will be in the very near future)" 548 <<
"\n ** Please specify a `target mix' instead.";
string kDefOptEvFilePrefix
string gOptRootGeomTopVol
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
map< int, double > gOptTgtMix
double UnitFromString(string u)
vector< string > Split(string input, string delim)
Singleton class to load & serve a TDatabasePDG.
enum genie::ENucleonDecayMode NucleonDecayMode_t
bool IsValidMode(NNBarOscMode_t ndm)
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
const char * AsString(Resonance_t res)
resonance id -> string
TParticlePDG * Find(int pdgc, bool must_exist=true)
Command line argument parser.
NucleonDecayMode_t gOptDecayMode