Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
genie::RunOpt Class Reference

Some common run-time GENIE options. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Framework/Utils/RunOpt.h"

Classes

struct  Cleaner
 

Public Member Functions

void ReadFromCommandLine (int argc, char **argv)
 
TuneIdTune (void) const
 
string EventGeneratorList (void) const
 
string CacheFile (void) const
 
string MesgThresholdFiles (void) const
 
TBits * UnphysEventMask (void) const
 
int EventRecordPrintLevel (void) const
 
int MCJobStatusRefreshRate (void) const
 
bool BareXSecPreCalc (void) const
 
string XMLPath (void) const
 
void SetTuneName (string tuneName="Default")
 
void BuildTune ()
 build tune and inform XSecSplineList More...
 
void SetEventGeneratorList (string evgenlist)
 
void EnableBareXSecPreCalc (bool flag)
 
void Print (ostream &stream) const
 

Static Public Member Functions

static RunOptInstance (void)
 

Private Member Functions

void Init (void)
 
 RunOpt ()
 
 RunOpt (const RunOpt &opt)
 
virtual ~RunOpt ()
 

Private Attributes

TuneIdfTune
 GENIE comprehensive neutrino interaction model tune. More...
 
string fEventGeneratorList
 Name of event generator list to be loaded by the event generation drivers. More...
 
string fCacheFile
 Name of cache file, is cache is to be re-used. More...
 
string fMesgThresholds
 List of files (delimited with : if more than one) with custom mesg stream thresholds. More...
 
TBits * fUnphysEventMask
 Unphysical event mask. More...
 
int fEventRecordPrintLevel
 GHEP event r ecord print level. More...
 
int fMCJobStatusRefreshRate
 MC job status file refresh rate. More...
 
bool fEnableBareXSecPreCalc
 
string fXMLPath
 An path to look for XML in. Higher priority than GXMLPATH. More...
 

Static Private Attributes

static RunOptfInstance = 0
 

Friends

struct Cleaner
 
ostream & operator<< (ostream &stream, const RunOpt &opt)
 

Detailed Description

Some common run-time GENIE options.

Author
Costas Andreopoulos <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

January 29, 2013

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 36 of file RunOpt.h.

Constructor & Destructor Documentation

genie::RunOpt::RunOpt ( )
private

Definition at line 48 of file RunOpt.cxx.

References fInstance, and Init().

Referenced by Instance().

48  : fTune(0)
49 {
50  fInstance = 0;
51 
52  this->Init();
53 }
static RunOpt * fInstance
Definition: RunOpt.h:84
void Init(void)
Definition: RunOpt.cxx:72
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition: RunOpt.h:72
genie::RunOpt::RunOpt ( const RunOpt opt)
private
genie::RunOpt::~RunOpt ( )
privatevirtual

Definition at line 55 of file RunOpt.cxx.

References fInstance, fTune, and fUnphysEventMask.

56 {
57  if ( fTune ) delete fTune ;
58  if ( fUnphysEventMask ) delete fUnphysEventMask ;
59  fInstance = 0;
60 }
static RunOpt * fInstance
Definition: RunOpt.h:84
TBits * fUnphysEventMask
Unphysical event mask.
Definition: RunOpt.h:76
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition: RunOpt.h:72

Member Function Documentation

bool genie::RunOpt::BareXSecPreCalc ( void  ) const
inline
void genie::RunOpt::BuildTune ( )

build tune and inform XSecSplineList

Definition at line 100 of file RunOpt.cxx.

References genie::TuneId::Build(), genie::XSecSplineList::Instance(), LOG, genie::TuneId::Name(), pINFO, genie::XSecSplineList::SetCurrentTune(), and Tune().

Referenced by Initialize(), main(), and XMLPath().

101 {
102  LOG("RunOpt",pINFO) << "Building tune "<<Tune()->Name();
103  Tune()->Build() ;
105 }
TuneId * Tune(void) const
Definition: RunOpt.h:45
string Name(void) const
Definition: TuneId.h:47
static XSecSplineList * Instance()
void SetCurrentTune(const string &tune)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
#define pINFO
Definition: Messenger.h:63
void Build(const string &name="")
Definition: TuneId.cxx:125
string genie::RunOpt::CacheFile ( void  ) const
inline

Definition at line 47 of file RunOpt.h.

References fCacheFile.

47 { return fCacheFile; }
string fCacheFile
Name of cache file, is cache is to be re-used.
Definition: RunOpt.h:74
void genie::RunOpt::EnableBareXSecPreCalc ( bool  flag)
inline

Definition at line 61 of file RunOpt.h.

References fEnableBareXSecPreCalc, Init(), operator<<, MECModelEnuComparisons::opt, Print(), and runNovaSAM::stream.

Referenced by GetCommandLineArgs().

61 { fEnableBareXSecPreCalc = flag; }
bool fEnableBareXSecPreCalc
Definition: RunOpt.h:79
string genie::RunOpt::EventGeneratorList ( void  ) const
inline

Definition at line 46 of file RunOpt.h.

References fEventGeneratorList.

46 { return fEventGeneratorList; }
string fEventGeneratorList
Name of event generator list to be loaded by the event generation drivers.
Definition: RunOpt.h:73
int genie::RunOpt::EventRecordPrintLevel ( void  ) const
inline

Definition at line 50 of file RunOpt.h.

References fEventRecordPrintLevel.

50 { return fEventRecordPrintLevel; }
int fEventRecordPrintLevel
GHEP event r ecord print level.
Definition: RunOpt.h:77
void genie::RunOpt::Init ( void  )
private

Definition at line 72 of file RunOpt.cxx.

References fCacheFile, fEnableBareXSecPreCalc, fEventGeneratorList, fEventRecordPrintLevel, fMCJobStatusRefreshRate, fMesgThresholds, fTune, fUnphysEventMask, fXMLPath, MECModelEnuComparisons::i, and genie::GHepFlags::NFlags().

Referenced by EnableBareXSecPreCalc(), and RunOpt().

73 {
74  fTune = 0 ;
76  fCacheFile = "";
77  fMesgThresholds = "";
78  fUnphysEventMask = new TBits(GHepFlags::NFlags());
79 //fUnphysEventMask->ResetAllBits(true);
80  for(unsigned int i = 0; i < GHepFlags::NFlags(); i++) {
81  fUnphysEventMask->SetBitNumber(i, true);
82  }
85  fEventGeneratorList = "Default";
86  fXMLPath = "";
87 }
string fMesgThresholds
List of files (delimited with : if more than one) with custom mesg stream thresholds.
Definition: RunOpt.h:75
string fCacheFile
Name of cache file, is cache is to be re-used.
Definition: RunOpt.h:74
int fEventRecordPrintLevel
GHEP event r ecord print level.
Definition: RunOpt.h:77
TBits * fUnphysEventMask
Unphysical event mask.
Definition: RunOpt.h:76
static unsigned int NFlags(void)
Definition: GHepFlags.h:77
int fMCJobStatusRefreshRate
MC job status file refresh rate.
Definition: RunOpt.h:78
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition: RunOpt.h:72
bool fEnableBareXSecPreCalc
Definition: RunOpt.h:79
string fEventGeneratorList
Name of event generator list to be loaded by the event generation drivers.
Definition: RunOpt.h:73
string fXMLPath
An path to look for XML in. Higher priority than GXMLPATH.
Definition: RunOpt.h:81
RunOpt * genie::RunOpt::Instance ( void  )
static
int genie::RunOpt::MCJobStatusRefreshRate ( void  ) const
inline

Definition at line 51 of file RunOpt.h.

References fMCJobStatusRefreshRate.

51 { return fMCJobStatusRefreshRate; }
int fMCJobStatusRefreshRate
MC job status file refresh rate.
Definition: RunOpt.h:78
string genie::RunOpt::MesgThresholdFiles ( void  ) const
inline

Definition at line 48 of file RunOpt.h.

References fMesgThresholds.

48 { return fMesgThresholds; }
string fMesgThresholds
List of files (delimited with : if more than one) with custom mesg stream thresholds.
Definition: RunOpt.h:75
void genie::RunOpt::Print ( ostream &  stream) const

Definition at line 165 of file RunOpt.cxx.

References fCacheFile, fEnableBareXSecPreCalc, fEventGeneratorList, fEventRecordPrintLevel, fMCJobStatusRefreshRate, fMesgThresholds, fTune, fUnphysEventMask, fXMLPath, and genie::GHepFlags::NFlags().

Referenced by EnableBareXSecPreCalc(), and genie::operator<<().

166 {
167  stream << "Global running options:";
168  if ( fTune ) stream << "\n GENIE tune: " << *fTune;
169  stream << "\n Event generator list: " << fEventGeneratorList;
170  stream << "\n User-specified message thresholds : " << fMesgThresholds;
171  stream << "\n Cache file : " << fCacheFile;
172  stream << "\n Unphysical event mask (bits: "
173  << GHepFlags::NFlags()-1 << " -> 0) : " << *fUnphysEventMask;
174  stream << "\n Event record print level : " << fEventRecordPrintLevel;
175  stream << "\n MC job status file refresh rate: " << fMCJobStatusRefreshRate;
176  stream << "\n Pre-calculate all free-nucleon cross-sections? : "
177  << ((fEnableBareXSecPreCalc) ? "Yes" : "No");
178 
179  if (fXMLPath.size()) {
180  stream << "\n XMLPath over-ride : "<<fXMLPath;
181  }
182 
183  stream << "\n";
184 }
string fMesgThresholds
List of files (delimited with : if more than one) with custom mesg stream thresholds.
Definition: RunOpt.h:75
string fCacheFile
Name of cache file, is cache is to be re-used.
Definition: RunOpt.h:74
int fEventRecordPrintLevel
GHEP event r ecord print level.
Definition: RunOpt.h:77
TBits * fUnphysEventMask
Unphysical event mask.
Definition: RunOpt.h:76
static unsigned int NFlags(void)
Definition: GHepFlags.h:77
int fMCJobStatusRefreshRate
MC job status file refresh rate.
Definition: RunOpt.h:78
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition: RunOpt.h:72
bool fEnableBareXSecPreCalc
Definition: RunOpt.h:79
string fEventGeneratorList
Name of event generator list to be loaded by the event generation drivers.
Definition: RunOpt.h:73
string fXMLPath
An path to look for XML in. Higher priority than GXMLPATH.
Definition: RunOpt.h:81
void genie::RunOpt::ReadFromCommandLine ( int  argc,
char **  argv 
)

Definition at line 107 of file RunOpt.cxx.

References genie::CmdLnArgParser::ArgAsInt(), genie::CmdLnArgParser::ArgAsString(), fCacheFile, fEnableBareXSecPreCalc, fEventRecordPrintLevel, fMCJobStatusRefreshRate, fMesgThresholds, fUnphysEventMask, fXMLPath, MECModelEnuComparisons::i, LOG, getGoodRuns4SAM::n, genie::GHepFlags::NFlags(), genie::CmdLnArgParser::OptionExists(), plot_validation_datamc::parser, pDEBUG, SetEventGeneratorList(), and SetTuneName().

Referenced by GetCommandLineArgs().

108 {
109  LOG("RunOpt",pDEBUG) << "Reading "<<argc-1<<" command line arguments.";
110  CmdLnArgParser parser(argc,argv);
111 
112  if( parser.OptionExists("enable-bare-xsec-pre-calc") ) {
113  fEnableBareXSecPreCalc = true;
114  } else
115  if( parser.OptionExists("disable-bare-xsec-pre-calc") ) {
116  fEnableBareXSecPreCalc = false;
117  }
118 
119  if( parser.OptionExists("cache-file") ) {
120  fCacheFile = parser.ArgAsString("cache-file");
121  }
122 
123  if( parser.OptionExists("message-thresholds") ) {
124  fMesgThresholds = parser.ArgAsString("message-thresholds");
125  }
126 
127  if( parser.OptionExists("event-record-print-level") ) {
128  fEventRecordPrintLevel = parser.ArgAsInt("event-record-print-level");
129  }
130 
131  if( parser.OptionExists("mc-job-status-refresh-rate") ) {
132  fMCJobStatusRefreshRate = TMath::Max(
133  1, parser.ArgAsInt("mc-job-status-refresh-rate"));
134  }
135 
136  if( parser.OptionExists("event-generator-list") ) {
137  SetEventGeneratorList(parser.ArgAsString("event-generator-list"));
138  }
139 
140  if (parser.OptionExists("xml-path")) {
141  fXMLPath = parser.ArgAsString("xml-path");
142  }
143 
144  if( parser.OptionExists("tune") ) {
145  SetTuneName( parser.ArgAsString("tune") ) ;
146  }
147  else {
148  SetTuneName( "Default" );
149  }// else ( parser.OptionExists("tune") )
150 
151  if( parser.OptionExists("unphysical-event-mask") ) {
152  const char * bitfield =
153  parser.ArgAsString("unphysical-event-mask").c_str();
154  unsigned int n = GHepFlags::NFlags();
155  unsigned int i = 0;
156  while (i < n) {
157  bool flag = (bitfield[i]=='1');
158  fUnphysEventMask->SetBitNumber(n-1-i,flag);
159  i++;
160  } //i
161  }
162 
163 }
string fMesgThresholds
List of files (delimited with : if more than one) with custom mesg stream thresholds.
Definition: RunOpt.h:75
string fCacheFile
Name of cache file, is cache is to be re-used.
Definition: RunOpt.h:74
int fEventRecordPrintLevel
GHEP event r ecord print level.
Definition: RunOpt.h:77
void SetEventGeneratorList(string evgenlist)
Definition: RunOpt.h:60
TBits * fUnphysEventMask
Unphysical event mask.
Definition: RunOpt.h:76
static unsigned int NFlags(void)
Definition: GHepFlags.h:77
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
int fMCJobStatusRefreshRate
MC job status file refresh rate.
Definition: RunOpt.h:78
bool fEnableBareXSecPreCalc
Definition: RunOpt.h:79
void SetTuneName(string tuneName="Default")
Definition: RunOpt.cxx:89
string fXMLPath
An path to look for XML in. Higher priority than GXMLPATH.
Definition: RunOpt.h:81
#define pDEBUG
Definition: Messenger.h:64
void genie::RunOpt::SetEventGeneratorList ( string  evgenlist)
inline

Definition at line 60 of file RunOpt.h.

References fEventGeneratorList.

Referenced by ReadFromCommandLine().

60 { fEventGeneratorList = evgenlist; }
string fEventGeneratorList
Name of event generator list to be loaded by the event generation drivers.
Definition: RunOpt.h:73
void genie::RunOpt::SetTuneName ( string  tuneName = "Default")

Definition at line 89 of file RunOpt.cxx.

References fTune, genie::gDefaultTune, LOG, genie::TuneId::Name(), and pNOTICE.

Referenced by ReadFromCommandLine(), and XMLPath().

90 {
91  if ( tuneName == "Default" || tuneName == "" ) tuneName = gDefaultTune;
92  if ( fTune ) {
93  LOG("RunOpt",pNOTICE) << "RunOpt::SetTune() already had " << fTune->Name()
94  << ", now being re-set to " << tuneName;
95  delete fTune;
96  }
97  fTune = new TuneId( tuneName ) ;
98 }
string Name(void) const
Definition: TuneId.h:47
static const string gDefaultTune
Definition: RunOpt.cxx:37
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition: RunOpt.h:72
#define pNOTICE
Definition: Messenger.h:62
TuneId* genie::RunOpt::Tune ( void  ) const
inline

Definition at line 45 of file RunOpt.h.

References fTune.

Referenced by BuildTune().

45 { return fTune; }
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition: RunOpt.h:72
TBits* genie::RunOpt::UnphysEventMask ( void  ) const
inline

Definition at line 49 of file RunOpt.h.

References fUnphysEventMask.

49 { return fUnphysEventMask; }
TBits * fUnphysEventMask
Unphysical event mask.
Definition: RunOpt.h:76
string genie::RunOpt::XMLPath ( void  ) const
inline

Definition at line 53 of file RunOpt.h.

References BuildTune(), fXMLPath, and SetTuneName().

53 { return fXMLPath; }
string fXMLPath
An path to look for XML in. Higher priority than GXMLPATH.
Definition: RunOpt.h:81

Friends And Related Function Documentation

friend struct Cleaner
friend

Definition at line 101 of file RunOpt.h.

ostream& operator<< ( ostream &  stream,
const RunOpt opt 
)
friend

Definition at line 40 of file RunOpt.cxx.

Referenced by EnableBareXSecPreCalc().

41 {
42  opt.Print(stream);
43  return stream;
44 }

Member Data Documentation

string genie::RunOpt::fCacheFile
private

Name of cache file, is cache is to be re-used.

Definition at line 74 of file RunOpt.h.

Referenced by CacheFile(), Init(), Print(), and ReadFromCommandLine().

bool genie::RunOpt::fEnableBareXSecPreCalc
private

Cache calcs relevant to free-nucleon xsecs before any nuclear xsec computation? The option switches on/off cacheing calculations which interfere with event reweighting.

Definition at line 79 of file RunOpt.h.

Referenced by BareXSecPreCalc(), EnableBareXSecPreCalc(), Init(), Print(), and ReadFromCommandLine().

string genie::RunOpt::fEventGeneratorList
private

Name of event generator list to be loaded by the event generation drivers.

Definition at line 73 of file RunOpt.h.

Referenced by EventGeneratorList(), Init(), Print(), and SetEventGeneratorList().

int genie::RunOpt::fEventRecordPrintLevel
private

GHEP event r ecord print level.

Definition at line 77 of file RunOpt.h.

Referenced by EventRecordPrintLevel(), Init(), Print(), and ReadFromCommandLine().

RunOpt * genie::RunOpt::fInstance = 0
staticprivate
int genie::RunOpt::fMCJobStatusRefreshRate
private

MC job status file refresh rate.

Definition at line 78 of file RunOpt.h.

Referenced by Init(), MCJobStatusRefreshRate(), Print(), and ReadFromCommandLine().

string genie::RunOpt::fMesgThresholds
private

List of files (delimited with : if more than one) with custom mesg stream thresholds.

Definition at line 75 of file RunOpt.h.

Referenced by Init(), MesgThresholdFiles(), Print(), and ReadFromCommandLine().

TuneId* genie::RunOpt::fTune
private

GENIE comprehensive neutrino interaction model tune.

Definition at line 72 of file RunOpt.h.

Referenced by Init(), Print(), SetTuneName(), Tune(), and ~RunOpt().

TBits* genie::RunOpt::fUnphysEventMask
private

Unphysical event mask.

Definition at line 76 of file RunOpt.h.

Referenced by Init(), Print(), ReadFromCommandLine(), UnphysEventMask(), and ~RunOpt().

string genie::RunOpt::fXMLPath
private

An path to look for XML in. Higher priority than GXMLPATH.

Definition at line 81 of file RunOpt.h.

Referenced by Init(), Print(), ReadFromCommandLine(), and XMLPath().


The documentation for this class was generated from the following files: