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 <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 <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

January 29, 2013

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

Definition at line 35 of file RunOpt.h.

Constructor & Destructor Documentation

genie::RunOpt::RunOpt ( )
private

Definition at line 40 of file RunOpt.cxx.

40  : fTune(0)
41 {
42  fInstance = 0;
43 
44  this->Init();
45 }
static RunOpt * fInstance
Definition: RunOpt.h:83
void Init(void)
Definition: RunOpt.cxx:64
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition: RunOpt.h:71
genie::RunOpt::RunOpt ( const RunOpt opt)
private
genie::RunOpt::~RunOpt ( )
privatevirtual

Definition at line 47 of file RunOpt.cxx.

48 {
49  if ( fTune ) delete fTune ;
50  if ( fUnphysEventMask ) delete fUnphysEventMask ;
51  fInstance = 0;
52 }
static RunOpt * fInstance
Definition: RunOpt.h:83
TBits * fUnphysEventMask
Unphysical event mask.
Definition: RunOpt.h:75
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition: RunOpt.h:71

Member Function Documentation

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

Definition at line 51 of file RunOpt.h.

51 { return fEnableBareXSecPreCalc; }
bool fEnableBareXSecPreCalc
Definition: RunOpt.h:78
void genie::RunOpt::BuildTune ( )

build tune and inform XSecSplineList

Definition at line 92 of file RunOpt.cxx.

93 {
94  LOG("RunOpt",pINFO) << "Building tune "<<Tune()->Name();
95  Tune()->Build() ;
97 }
TuneId * Tune(void) const
Definition: RunOpt.h:44
string Name(void) const
Definition: TuneId.h:46
ChannelGroupService::Name Name
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:96
#define pINFO
Definition: Messenger.h:62
void Build(const string &name="")
Definition: TuneId.cxx:124
string genie::RunOpt::CacheFile ( void  ) const
inline

Definition at line 46 of file RunOpt.h.

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

Definition at line 60 of file RunOpt.h.

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

Definition at line 45 of file RunOpt.h.

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

Definition at line 49 of file RunOpt.h.

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

Definition at line 64 of file RunOpt.cxx.

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

Definition at line 54 of file RunOpt.cxx.

55 {
56  if(fInstance == 0) {
57  static RunOpt::Cleaner cleaner;
58  cleaner.DummyMethodAndSilentCompiler();
59  fInstance = new RunOpt;
60  }
61  return fInstance;
62 }
static RunOpt * fInstance
Definition: RunOpt.h:83
friend struct Cleaner
Definition: RunOpt.h:100
int genie::RunOpt::MCJobStatusRefreshRate ( void  ) const
inline

Definition at line 50 of file RunOpt.h.

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

Definition at line 47 of file RunOpt.h.

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

Definition at line 157 of file RunOpt.cxx.

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

Definition at line 99 of file RunOpt.cxx.

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

Definition at line 59 of file RunOpt.h.

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

Definition at line 81 of file RunOpt.cxx.

82 {
83  if ( tuneName == "Default" || tuneName == "" ) tuneName = gDefaultTune;
84  if ( fTune ) {
85  LOG("RunOpt",pNOTICE) << "RunOpt::SetTune() already had " << fTune->Name()
86  << ", now being re-set to " << tuneName;
87  delete fTune;
88  }
89  fTune = new TuneId( tuneName ) ;
90 }
string Name(void) const
Definition: TuneId.h:46
static const string gDefaultTune
Definition: RunOpt.cxx:29
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition: RunOpt.h:71
#define pNOTICE
Definition: Messenger.h:61
TuneId* genie::RunOpt::Tune ( void  ) const
inline

Definition at line 44 of file RunOpt.h.

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

Definition at line 48 of file RunOpt.h.

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

Definition at line 52 of file RunOpt.h.

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

Friends And Related Function Documentation

friend struct Cleaner
friend

Definition at line 100 of file RunOpt.h.

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

Definition at line 32 of file RunOpt.cxx.

33 {
34  opt.Print(stream);
35  return stream;
36 }
opt
Definition: train.py:196

Member Data Documentation

string genie::RunOpt::fCacheFile
private

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

Definition at line 73 of file RunOpt.h.

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 78 of file RunOpt.h.

string genie::RunOpt::fEventGeneratorList
private

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

Definition at line 72 of file RunOpt.h.

int genie::RunOpt::fEventRecordPrintLevel
private

GHEP event r ecord print level.

Definition at line 76 of file RunOpt.h.

RunOpt * genie::RunOpt::fInstance = 0
staticprivate

Definition at line 83 of file RunOpt.h.

int genie::RunOpt::fMCJobStatusRefreshRate
private

MC job status file refresh rate.

Definition at line 77 of file RunOpt.h.

string genie::RunOpt::fMesgThresholds
private

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

Definition at line 74 of file RunOpt.h.

TuneId* genie::RunOpt::fTune
private

GENIE comprehensive neutrino interaction model tune.

Definition at line 71 of file RunOpt.h.

TBits* genie::RunOpt::fUnphysEventMask
private

Unphysical event mask.

Definition at line 75 of file RunOpt.h.

string genie::RunOpt::fXMLPath
private

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

Definition at line 80 of file RunOpt.h.


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