53 #include <TObjString.h>
58 #include "Framework/Conventions/GBuild.h"
81 using std::ostringstream;
83 using namespace genie;
84 using namespace genie::controls;
94 int main(
int argc,
char ** argv)
119 const string common_key_root =
"Common";
121 std::map<std::string,std::string> common_list;
122 std::set<std::string> common_files;
132 vector<string>::const_iterator keyiter;
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 ) {
164 std::string keynm = it->first;
165 if ( keynm.find(common_key_root) == 0 ) {
167 std::string type = keynm.substr( common_key_root.size() );
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);
180 std::cout << std::endl;
184 std::cout <<
"GetXMLPathList returns: ";
186 auto xmlpathitr = xmlpathlist.begin();
187 for ( ; xmlpathitr != xmlpathlist.end(); ++xmlpathitr) {
188 std::cout << std::endl <<
" " << *xmlpathitr;
190 std::cout << std::endl << std::endl;
195 std::set<std::string>::iterator typeitr = common_files.begin();
196 for ( ; typeitr != common_files.end(); ++typeitr ) {
197 std::string fname = std::string(
"Common") + *typeitr + std::string(
".xml");
199 std::cout <<
"using file " << commonpath << std::endl;
202 std::map<std::string,std::string>::iterator cpitr = common_list.begin();
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;
214 std::cout << std::endl;
217 common = algconf->
CommonList(
"Param",
"Tunable");
219 std::cout <<
"no CommonParam \"Tunable\"" << std::endl;
221 std::cout << *common;
224 std::cout << std::endl << std::endl;
227 unsigned int ivar = 0;
230 string var =
kMCEnv[ivar];
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";
271 bool help = parser.OptionExists(
'h');
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 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
int main(int argc, char **argv)
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
void BuildTune()
build tune and inform XSecSplineList
RgStr GetStringDef(RgKey key, RgStr def_opt, bool set_def=true)
static RunOpt * Instance(void)
vector< string > Split(string input, string delim)
A registry. Provides the container for algorithm configuration parameters.
string PrintFramedMesg(string mesg, unsigned int nl=1, const char f='*')
Registry * FindRegistry(string key) const
void MesgThresholds(string inpfile)
Command line argument parser.
void GetCommandLineArgs(int argc, char **argv)
void CacheFile(string inpfile)
void EnableBareXSecPreCalc(bool flag)
static AlgConfigPool * Instance()