558 LOG(
"gevgen",
pINFO) <<
"Parsing command line arguments";
561 RunOpt::Instance()->EnableBareXSecPreCalc(
true);
562 RunOpt::Instance()->ReadFromCommandLine(argc,
argv);
576 if(
parser.OptionExists(
'n') ) {
577 LOG(
"gevgen",
pINFO) <<
"Reading number of events to generate";
581 <<
"Unspecified number of events to generate - Using default";
586 if(
parser.OptionExists(
'r') ) {
587 LOG(
"gevgen",
pINFO) <<
"Reading MC run number";
590 LOG(
"gevgen",
pINFO) <<
"Unspecified run number - Using default";
595 if(
parser.OptionExists(
'o') ) {
596 LOG(
"gevgen",
pINFO) <<
"Reading output file name";
608 bool using_flux =
false;
609 if(
parser.OptionExists(
'f') ) {
610 LOG(
"gevgen",
pINFO) <<
"Reading flux function";
615 if(
parser.OptionExists(
's')) {
617 <<
"-s option no longer available. Please read the revised code documentation";
627 if(
parser.OptionExists(
'e') ) {
628 LOG(
"gevgen",
pINFO) <<
"Reading neutrino energy";
629 string nue =
parser.ArgAsString(
'e');
632 if(nue.find(
",") != string::npos) {
635 assert(nurange.size() == 2);
636 double emin = atof(nurange[0].c_str());
637 double emax = atof(nurange[1].c_str());
638 assert(emax>emin && emin>=0);
643 <<
"No flux was specified but an energy range was input!";
645 <<
"Events will be generated at fixed E = " <<
gOptNuEnergy <<
" GeV";
653 LOG(
"gevgen",
pFATAL) <<
"Unspecified neutrino energy - Exiting";
659 if(
parser.OptionExists(
'p') ) {
660 LOG(
"gevgen",
pINFO) <<
"Reading neutrino PDG code";
663 LOG(
"gevgen",
pFATAL) <<
"Unspecified neutrino PDG code - Exiting";
669 bool using_tgtmix =
false;
670 if(
parser.OptionExists(
't') ) {
671 LOG(
"gevgen",
pINFO) <<
"Reading target mix";
672 string stgtmix =
parser.ArgAsString(
't');
675 if(tgtmix.size()==1) {
676 int pdg = atoi(tgtmix[0].c_str());
678 gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
682 for( ; tgtmix_iter != tgtmix.end(); ++tgtmix_iter) {
683 string tgt_with_wgt = *tgtmix_iter;
684 string::size_type open_bracket = tgt_with_wgt.find(
"[");
685 string::size_type close_bracket = tgt_with_wgt.find(
"]");
686 string::size_type ibeg = 0;
687 string::size_type iend = open_bracket;
688 string::size_type jbeg = open_bracket+1;
689 string::size_type jend = close_bracket-1;
690 int pdg = atoi(tgt_with_wgt.substr(ibeg,iend).c_str());
691 double wgt = atof(tgt_with_wgt.substr(jbeg,jend).c_str());
693 <<
"Adding to target mix: pdg = " << pdg <<
", wgt = " << wgt;
694 gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
699 LOG(
"gevgen",
pFATAL) <<
"Unspecified target PDG code - Exiting";
707 if(
parser.OptionExists(
"seed") ) {
708 LOG(
"gevgen",
pINFO) <<
"Reading random number seed";
711 LOG(
"gevgen",
pINFO) <<
"Unspecified random number seed - Using default";
716 if(
parser.OptionExists(
"cross-sections") ) {
717 LOG(
"gevgen",
pINFO) <<
"Reading cross-section file";
720 LOG(
"gevgen",
pINFO) <<
"Unspecified cross-section file";
737 <<
"Random number seed was not set, using default";
746 <<
"No input cross-section spline file";
754 <<
"Neutrino energy: [" 763 <<
"Target code (PDG) & weight fraction (in case of multiple targets): ";
766 int tgtpdgc = iter->first;
767 double wgt = iter->second;
769 <<
" >> " << tgtpdgc <<
" (weight fraction = " << wgt <<
")";
773 LOG(
"gevgen",
pNOTICE) << *RunOpt::Instance();
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
vector< string > Split(string input, string delim)
map< int, double > gOptTgtMix
bool gOptUsingFluxOrTgtMix
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Command line argument parser.