GENIEGenerator
Loading...
Searching...
No Matches
RunOpt.h
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3
4\class genie::RunOpt
5
6\brief Some common run-time GENIE options.
7
8\author Costas Andreopoulos <c.andreopoulos \at cern.ch>
9 University of Liverpool
10
11\created January 29, 2013
12
13\cpright Copyright (c) 2003-2025, The GENIE Collaboration
14 For the full text of the license visit http://copyright.genie-mc.org
15*/
16//____________________________________________________________________________
17
18#ifndef _RUN_OPT_H_
19#define _RUN_OPT_H_
20
21#include <iostream>
22#include <string>
23
25
26class TBits;
27
28using std::ostream;
29
30namespace genie {
31
32class RunOpt;
33ostream & operator << (ostream & stream, const RunOpt & opt);
34
35class RunOpt
36{
37public:
38 static RunOpt * Instance(void);
39
40 // Read options from the command line. Call from all GENIE command-line apps.
41 void ReadFromCommandLine(int argc, char ** argv);
42 // Centralized printout of what ReadFromCommandLine() will look for
43 static std::string RunOptSyntaxString(bool include_generator_specific);
44
45 // Get options set.
46 TuneId * Tune (void) const { return fTune; }
47 string EventGeneratorList (void) const { return fEventGeneratorList; }
48 string CacheFile (void) const { return fCacheFile; }
49 string MesgThresholdFiles (void) const { return fMesgThresholds; }
50 TBits* UnphysEventMask (void) const { return fUnphysEventMask; }
51 int EventRecordPrintLevel (void) const { return fEventRecordPrintLevel; }
53 bool BareXSecPreCalc (void) const { return fEnableBareXSecPreCalc; }
54 string XMLPath (void) const { return fXMLPath; }
55
56 // If a user accesses the GENIE objects directly, then most of the options above
57 // can be set directly to the relevant objects (Messenger, Cache, etc).
58 //
59 void SetTuneName(string tuneName="Default");
60 void BuildTune(); ///< build tune and inform XSecSplineList
61 void SetEventGeneratorList(string evgenlist) { fEventGeneratorList = evgenlist; }
63
64 // Print
65 void Print (ostream & stream) const;
66 friend ostream & operator << (ostream & stream, const RunOpt & opt);
67
68private:
69
70 void Init (void);
71
72 // options
73 TuneId * fTune; ///< GENIE comprehensive neutrino interaction model tune.
74 string fEventGeneratorList; ///< Name of event generator list to be loaded by the event generation drivers.
75 string fCacheFile; ///< Name of cache file, is cache is to be re-used.
76 string fMesgThresholds; ///< List of files (delimited with : if more than one) with custom mesg stream thresholds.
77 TBits* fUnphysEventMask; ///< Unphysical event mask.
78 int fEventRecordPrintLevel; ///< GHEP event r ecord print level.
79 int fMCJobStatusRefreshRate; ///< MC job status file refresh rate.
80 bool fEnableBareXSecPreCalc; ///< Cache calcs relevant to free-nucleon xsecs before any nuclear xsec computation?
81 ///< The option switches on/off cacheing calculations which interfere with event reweighting.
82 string fXMLPath; ///< An path to look for XML in. Higher priority than GXMLPATH
83
84 // Self
85 static RunOpt * fInstance;
86
87 // Singleton class: constructors are private
88 RunOpt();
89 RunOpt(const RunOpt & opt);
90 virtual ~RunOpt();
91
92 // Clean-up
93 struct Cleaner {
96 if (RunOpt::fInstance !=0) {
97 delete RunOpt::fInstance;
99 }
100 }
101 };
102 friend struct Cleaner;
103};
104
105} // genie namespace
106#endif // _RUN_OPT_H_
Some common run-time GENIE options.
Definition RunOpt.h:36
friend ostream & operator<<(ostream &stream, const RunOpt &opt)
Definition RunOpt.cxx:32
void Init(void)
Definition RunOpt.cxx:64
int fEventRecordPrintLevel
GHEP event r ecord print level.
Definition RunOpt.h:78
string EventGeneratorList(void) const
Definition RunOpt.h:47
bool fEnableBareXSecPreCalc
Definition RunOpt.h:80
void ReadFromCommandLine(int argc, char **argv)
Definition RunOpt.cxx:99
virtual ~RunOpt()
Definition RunOpt.cxx:47
TuneId * Tune(void) const
Definition RunOpt.h:46
bool BareXSecPreCalc(void) const
Definition RunOpt.h:53
string fEventGeneratorList
Name of event generator list to be loaded by the event generation drivers.
Definition RunOpt.h:74
RunOpt(const RunOpt &opt)
TBits * fUnphysEventMask
Unphysical event mask.
Definition RunOpt.h:77
static std::string RunOptSyntaxString(bool include_generator_specific)
Definition RunOpt.cxx:157
int MCJobStatusRefreshRate(void) const
Definition RunOpt.h:52
string fCacheFile
Name of cache file, is cache is to be re-used.
Definition RunOpt.h:75
void BuildTune()
build tune and inform XSecSplineList
Definition RunOpt.cxx:92
string fMesgThresholds
List of files (delimited with : if more than one) with custom mesg stream thresholds.
Definition RunOpt.h:76
static RunOpt * fInstance
Definition RunOpt.h:85
void EnableBareXSecPreCalc(bool flag)
Definition RunOpt.h:62
void SetTuneName(string tuneName="Default")
Definition RunOpt.cxx:81
static RunOpt * Instance(void)
Definition RunOpt.cxx:54
string CacheFile(void) const
Definition RunOpt.h:48
TBits * UnphysEventMask(void) const
Definition RunOpt.h:50
string MesgThresholdFiles(void) const
Definition RunOpt.h:49
TuneId * fTune
GENIE comprehensive neutrino interaction model tune.
Definition RunOpt.h:73
string fXMLPath
An path to look for XML in. Higher priority than GXMLPATH.
Definition RunOpt.h:82
int EventRecordPrintLevel(void) const
Definition RunOpt.h:51
int fMCJobStatusRefreshRate
MC job status file refresh rate.
Definition RunOpt.h:79
string XMLPath(void) const
Definition RunOpt.h:54
void SetEventGeneratorList(string evgenlist)
Definition RunOpt.h:61
void Print(ostream &stream) const
Definition RunOpt.cxx:185
GENIE tune ID.
Definition TuneId.h:37
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
void DummyMethodAndSilentCompiler()
Definition RunOpt.h:94