53 #include <TObjString.h> 58 #include "Framework/Conventions/GBuild.h" 81 using std::ostringstream;
83 using namespace genie;
119 const string common_key_root =
"Common";
121 std::map<std::string,std::string> common_list;
122 std::set<std::string> common_files;
134 for(keyiter = vconfkeys.begin(); keyiter != vconfkeys.end(); ++keyiter) {
136 string key = *keyiter;
137 std::cout <<
"Registry key: " << key <<
std::endl;
140 assert(vkey.size()==2);
141 string alg_name = vkey[0];
142 string param_set = vkey[1];
145 <<
"alg_name: " << alg_name <<
", param_set: " << param_set;
159 std::cout << *config_registry;
163 it != config_registry->GetItemMap().end() ; ++it ) {
165 if ( keynm.find(common_key_root) == 0 ) {
169 std::string cpstr = config_registry->GetStringDef(keynm,
"not-found",
false);
170 if ( cpstr !=
"not-found") {
172 for (
size_t i=0; i<cps.size(); ++i) {
173 common_list[cps[i]] =
type;
174 common_files.insert(type);
184 std::cout <<
"GetXMLPathList returns: ";
186 auto xmlpathitr = xmlpathlist.begin();
187 for ( ; xmlpathitr != xmlpathlist.end(); ++xmlpathitr) {
188 std::cout <<
std::endl <<
" " << *xmlpathitr;
196 for ( ; typeitr != common_files.end(); ++typeitr ) {
199 std::cout <<
"using file " << commonpath <<
std::endl;
203 for ( ; cpitr != common_list.end(); ++cpitr) {
204 if ( cpitr->second != *typeitr )
continue;
205 std::cout <<
"Common" << cpitr->second <<
" \"" << cpitr->first <<
"\"";
207 common = algconf->
CommonList(cpitr->second,cpitr->first);
209 std::cout <<
"\n\tno Common" << cpitr->second <<
" \"" << cpitr->first <<
"\"" <<
std::endl;
211 std::cout << *common;
217 common = algconf->
CommonList(
"Param",
"Tunable");
219 std::cout <<
"no CommonParam \"Tunable\"" <<
std::endl;
221 std::cout << *common;
227 unsigned int ivar = 0;
231 string value = (gSystem->Getenv(var.c_str()) ?
232 gSystem->Getenv(var.c_str()) :
"UNDEFINED");
234 std::cout <<
"$" << var <<
" ---> " << value <<
std::endl;
245 LOG(
"gconfigdump",
pFATAL) <<
" No TuneId in RunOption";
260 LOG(
"gconfigdump",
pINFO) <<
"Parsing command line arguments";
293 <<
"\n\n" <<
"Syntax:" <<
"\n" 294 <<
"\n gconfigdump [-h]" 295 <<
"\n [--event-generator-list list_name]" 296 <<
"\n [--tune G18_02a_00_000] (or your preferred tune identifier)"
string GetXMLPathList(bool add_tune=true)
void GetCommandLineArgs(int argc, char **argv)
THE MAIN GENIE PROJECT NAMESPACE
void ReadFromCommandLine(int argc, char **argv)
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Registry * CommonList(const string &file_id, const string &set_name) const
map< RgKey, RegistryItemI * >::const_iterator RgIMapConstIter
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static const char * kMCEnv[]
string GetXMLFilePath(string basename)
const vector< string > & ConfigKeyList(void) const
Misc GENIE control constants.
void BuildTune()
build tune and inform XSecSplineList
static RunOpt * Instance(void)
vector< string > Split(string input, string delim)
A registry. Provides the container for algorithm configuration parameters.
int main(int argc, char **argv)
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Registry * FindRegistry(string key) const
void MesgThresholds(string inpfile)
Command line argument parser.
bool OptionExists(char opt)
was option set?
void CacheFile(string inpfile)
void EnableBareXSecPreCalc(bool flag)
QTextStream & endl(QTextStream &s)
static AlgConfigPool * Instance()