Public Member Functions | Private Attributes | List of all members
genie::NtpMCJobEnv Class Reference

Stores a snapshot of your environment in ROOT TFolder along with the output event tree. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+3.10-2.17-e17-debug/GENIE-Generator/src/Framework/Ntuple/NtpMCJobEnv.h"

Public Member Functions

 NtpMCJobEnv ()
 
virtual ~NtpMCJobEnv ()
 
TFolder * TakeSnapshot (void)
 
TFolder * GetFolder (void)
 

Private Attributes

TFolder * fEnv
 

Detailed Description

Stores a snapshot of your environment in ROOT TFolder along with the output event tree.

Author
Costas Andreopoulos <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

September 10, 2006

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 27 of file NtpMCJobEnv.h.

Constructor & Destructor Documentation

NtpMCJobEnv::NtpMCJobEnv ( )

Definition at line 37 of file NtpMCJobEnv.cxx.

38 {
39  fEnv = 0;
40 }
NtpMCJobEnv::~NtpMCJobEnv ( )
virtual

Definition at line 42 of file NtpMCJobEnv.cxx.

43 {
44 
45 }

Member Function Documentation

TFolder* genie::NtpMCJobEnv::GetFolder ( void  )
inline

Definition at line 35 of file NtpMCJobEnv.h.

References fEnv.

35 { return fEnv; }
TFolder * NtpMCJobEnv::TakeSnapshot ( void  )

Definition at line 47 of file NtpMCJobEnv.cxx.

References HTMLTools::entry(), genie::controls::kMCEnv, LOG, pINFO, pNOTICE, and PandAna.Demos.tute_pid_validation::var.

Referenced by genie::NtpWriter::Initialize().

48 {
49  if (fEnv) delete fEnv;
50  fEnv = 0;
51 
52  LOG("Ntp", pNOTICE)
53  << "Taking environment snapshot and saving it in a TFolder";
54 
55  fEnv = gROOT->GetRootFolder()->AddFolder("genv","GENIE user environment");
56  gROOT->GetListOfBrowsables()->Add(fEnv,"genv");
57 
58  fEnv->SetOwner(true);
59 
60  vector<string> envvars;
61 
62  unsigned int ivar=0;
63  while(kMCEnv[ivar]) {
64  envvars.push_back(string(kMCEnv[ivar]));
65  ivar++;
66  }
67 
68  LOG("Ntp", pINFO) << "** MC Job Environment:";
69  vector<string>::iterator variter;
70  for(variter = envvars.begin(); variter != envvars.end(); ++variter) {
71 
72  ostringstream entry;
73  string var = *variter;
74  string value = (gSystem->Getenv(var.c_str()) ?
75  gSystem->Getenv(var.c_str()) : "UNDEFINED");
76 
77  LOG("Ntp", pINFO) << "$" << var << " ---> " << value;
78 
79  entry << "envv:" << var << ";value:" << value;
80  fEnv->Add(new TObjString(entry.str().c_str()));
81  }
82  return fEnv;
83 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const XML_Char int const XML_Char * value
Definition: expat.h:331
static const char * kMCEnv[]
Definition: EnvSnapshot.h:25
#define pINFO
Definition: Messenger.h:63
#define pNOTICE
Definition: Messenger.h:62
def entry(str)
Definition: HTMLTools.py:26

Member Data Documentation

TFolder* genie::NtpMCJobEnv::fEnv
private

Definition at line 39 of file NtpMCJobEnv.h.

Referenced by GetFolder().


The documentation for this class was generated from the following files: