INCLConfigParser.h
Go to the documentation of this file.
1 #include "Framework/Conventions/GBuild.h"
2 #ifdef __GENIE_INCL_ENABLED__
3 
4 /** \file INCLConfigParser.h
5  * \brief A class for parsing input and producing a INCL++ Config
6  * Copied from INC++ main
7  * class name can't be changed from "ConfigParser" to "INCLConfigParser"
8  * due to code in $INCL_SRC_DIR/utils/include/G4INCLConfig.hh:
9  * friend class ::ConfigParser;
10  * and this code needs the access to the private data members
11  * By default copy of the class isn't compiled into any available INC++ library
12  * so we're stuck with the name for the class, but we'll leave the
13  * filename changed to indicate that it references INCL++
14  *
15  * \date 17th July 2014
16  * \author Davide Mancusi
17  */
18 
19 #ifndef INCLCONFIGPARSER_HH_
20 #define INCLCONFIGPARSER_HH_
21 
22 #ifdef HAS_BOOST_PROGRAM_OPTIONS
23 
24 #include <string>
25 #include "G4INCLConfig.hh"
26 
27 #include <boost/program_options/options_description.hpp>
28 #include <boost/program_options/parsers.hpp>
29 #include <boost/program_options/positional_options.hpp>
30 #include <boost/program_options/variables_map.hpp>
31 
32 namespace po = boost::program_options;
33 
34 class ConfigParser {
35  public:
36  ConfigParser();
37  ~ConfigParser();
38 
39  G4INCL::Config *parse(int argc, char *argv[]);
40  std::string echo(G4INCL::Config const * const aConfig);
41 
42  private:
44  po::options_description runOptDesc;
45  po::options_description hiddenOptDesc;
46  po::options_description genericOptDesc;
47  po::options_description physicsOptDesc;
48  po::options_description cmdLineOptions;
49  po::options_description configFileOptions;
50  po::options_description visibleOptions;
51  po::positional_options_description p;
52  po::variables_map variablesMap;
53 
54  static const int randomSeedMin = 1;
55  static const int randomSeedMax = ((1<<30)-1)+(1<<30);
56 
57  static const std::string suggestHelpMsg;
58 
59  // Define the names of the de-excitation models
60  static const std::string theNoneName;
61 #ifdef INCL_DEEXCITATION_SMM
62  static const std::string theSMMName;
63 #endif
64 #ifdef INCL_DEEXCITATION_GEMINIXX
65  static const std::string theGEMINIXXName;
66 #endif
67 #ifdef INCL_DEEXCITATION_ABLAXX
68  static const std::string theABLAv3pName;
69 #endif
70 #ifdef INCL_DEEXCITATION_ABLA07
71  static const std::string theABLA07Name;
72 #endif
73 
74  static const std::string listSeparator;
75 
76  std::string deExcitationModelList;
77  std::string defaultDeExcitationModel;
78 
79  std::string echoOptionsDescription(const po::options_description &aDesc);
80 };
81 
82 // alias for GENIE
83 typedef ConfigParser INCLConfigParser;
84 
85 #endif // HAS_BOOST_PROGRAM_OPTIONS
86 
87 #endif // INCLCONFIGPARSER_HH_
88 
89 #endif // __GENIE_INCL_ENABLED__
std::string string
Definition: nybbler.cc:12
typename config_impl< T >::type Config
Definition: ModuleMacros.h:52
static Config * config
Definition: config.cpp:1054
p
Definition: test.py:223