18 #include <TObjString.h>
25 using std::ostringstream;
27 using namespace genie;
28 using namespace genie::controls;
43 if (fEnv)
delete fEnv;
47 <<
"Taking environment snapshot and saving it in a TFolder";
49 fEnv = gROOT->GetRootFolder()->AddFolder(
"genv",
"GENIE user environment");
50 gROOT->GetListOfBrowsables()->Add(fEnv,
"genv");
54 vector<string> envvars;
58 envvars.push_back(
string(
kMCEnv[ivar]));
62 LOG(
"Ntp",
pINFO) <<
"** MC Job Environment:";
63 vector<string>::iterator variter;
64 for(variter = envvars.begin(); variter != envvars.end(); ++variter) {
67 string var = *variter;
68 string value = (gSystem->Getenv(var.c_str()) ?
69 gSystem->Getenv(var.c_str()) :
"UNDEFINED");
71 LOG(
"Ntp",
pINFO) <<
"$" << var <<
" ---> " << value;
73 entry <<
"envv:" << var <<
";value:" << value;
74 fEnv->Add(
new TObjString(entry.str().c_str()));
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static const char * kMCEnv[]
TFolder * TakeSnapshot(void)