588 LOG(
"gevgen_dm",
pINFO) <<
"Parsing command line arguments";
591 RunOpt::Instance()->EnableBareXSecPreCalc(
true);
592 RunOpt::Instance()->ReadFromCommandLine(argc,
argv);
605 if ( !
parser.OptionExists(
"tune") ) {
606 LOG(
"gevgen_dm",
pFATAL) <<
"No Dark Matter tune selected, please select one ";
612 if(
parser.OptionExists(
'n') ) {
613 LOG(
"gevgen_dm",
pINFO) <<
"Reading number of events to generate";
617 <<
"Unspecified number of events to generate - Using default";
622 if(
parser.OptionExists(
'r') ) {
623 LOG(
"gevgen_dm",
pINFO) <<
"Reading MC run number";
626 LOG(
"gevgen_dm",
pINFO) <<
"Unspecified run number - Using default";
631 if(
parser.OptionExists(
'o') ) {
632 LOG(
"gevgen_dm",
pINFO) <<
"Reading output file name";
644 bool using_flux =
false;
645 if(
parser.OptionExists(
'f') ) {
646 LOG(
"gevgen_dm",
pINFO) <<
"Reading flux function";
651 if(
parser.OptionExists(
's')) {
653 <<
"-s option no longer available. Please read the revised code documentation";
663 if(
parser.OptionExists(
'e') ) {
664 LOG(
"gevgen_dm",
pINFO) <<
"Reading dark matter energy";
665 string dme =
parser.ArgAsString(
'e');
668 if(dme.find(
",") != string::npos) {
671 assert(nurange.size() == 2);
672 double emin = atof(nurange[0].c_str());
673 double emax = atof(nurange[1].c_str());
674 assert(emax>emin && emin>=0);
679 <<
"No flux was specified but an energy range was input!";
681 <<
"Events will be generated at fixed E = " <<
gOptDMEnergy <<
" GeV";
689 LOG(
"gevgen_dm",
pFATAL) <<
"Unspecified dark matter energy - Exiting";
695 if(
parser.OptionExists(
'm') ) {
696 LOG(
"gevgen_dm",
pINFO) <<
"Reading dark matter mass";
699 LOG(
"gevgen_dm",
pFATAL) <<
"Unspecified dark matter mass - Exiting";
705 if(
parser.OptionExists(
'g') ) {
706 LOG(
"gevgen_dm",
pINFO) <<
"Reading mediator coupling";
709 LOG(
"gevgen_dm",
pINFO) <<
"Unspecified mediator coupling - Using value from config file";
714 bool using_tgtmix =
false;
715 if(
parser.OptionExists(
't') ) {
716 LOG(
"gevgen_dm",
pINFO) <<
"Reading target mix";
717 string stgtmix =
parser.ArgAsString(
't');
720 if(tgtmix.size()==1) {
721 int pdg = atoi(tgtmix[0].c_str());
723 gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
727 for( ; tgtmix_iter != tgtmix.end(); ++tgtmix_iter) {
728 string tgt_with_wgt = *tgtmix_iter;
729 string::size_type open_bracket = tgt_with_wgt.find(
"[");
730 string::size_type close_bracket = tgt_with_wgt.find(
"]");
731 string::size_type ibeg = 0;
732 string::size_type iend = open_bracket;
733 string::size_type jbeg = open_bracket+1;
734 string::size_type jend = close_bracket-1;
735 int pdg = atoi(tgt_with_wgt.substr(ibeg,iend).c_str());
736 double wgt = atof(tgt_with_wgt.substr(jbeg,jend).c_str());
738 <<
"Adding to target mix: pdg = " << pdg <<
", wgt = " << wgt;
739 gOptTgtMix.insert(map<int, double>::value_type(pdg, wgt));
744 LOG(
"gevgen_dm",
pFATAL) <<
"Unspecified target PDG code - Exiting";
750 if(
parser.OptionExists(
'z') ) {
751 LOG(
"gevgen_dm",
pINFO) <<
"Reading mediator mass ratio";
754 LOG(
"gevgen_dm",
pINFO) <<
"Unspecified mediator mass ratio - Using default";
761 if(
parser.OptionExists(
"seed") ) {
762 LOG(
"gevgen_dm",
pINFO) <<
"Reading random number seed";
765 LOG(
"gevgen_dm",
pINFO) <<
"Unspecified random number seed - Using default";
770 if(
parser.OptionExists(
"cross-sections") ) {
771 LOG(
"gevgen_dm",
pINFO) <<
"Reading cross-section file";
774 LOG(
"gevgen_dm",
pINFO) <<
"Unspecified cross-section file";
791 <<
"Random number seed was not set, using default";
800 <<
"No input cross-section spline file";
808 <<
"Dark matter energy: [" 817 <<
"Target code (PDG) & weight fraction (in case of multiple targets): ";
822 int tgtpdgc = iter->first;
823 double wgt = iter->second;
825 <<
" >> " << tgtpdgc <<
" (weight fraction = " << wgt <<
")";
829 LOG(
"gevgen_dm",
pNOTICE) << *RunOpt::Instance();
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
map< int, double > gOptTgtMix
vector< string > Split(string input, string delim)
bool gOptUsingFluxOrTgtMix
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Command line argument parser.