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

Stores the GENIE configuration in ROOT TFolders 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/NtpMCJobConfig.h"

Public Member Functions

 NtpMCJobConfig ()
 
virtual ~NtpMCJobConfig ()
 
TFolder * Load (void)
 
TFolder * GetFolder (void)
 

Private Attributes

TFolder * fConfig
 

Detailed Description

Stores the GENIE configuration in ROOT TFolders along with the output event tree.

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

October 1, 2004

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 NtpMCJobConfig.h.

Constructor & Destructor Documentation

genie::NtpMCJobConfig::NtpMCJobConfig ( )
NtpMCJobConfig::~NtpMCJobConfig ( )
virtual

Definition at line 43 of file NtpMCJobConfig.cxx.

44 {
45 
46 }

Member Function Documentation

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

Definition at line 35 of file NtpMCJobConfig.h.

References fConfig.

35 { return fConfig; }
TFolder * NtpMCJobConfig::Load ( void  )

Definition at line 48 of file NtpMCJobConfig.cxx.

References ana::assert(), genie::AlgConfigPool::ConfigKeyList(), genie::Registry::CopyToFolder(), fConfig, genie::AlgConfigPool::FindRegistry(), genie::AlgConfigPool::Instance(), findDuplicateFiles::key, LOG, pDEBUG, pNOTICE, and genie::utils::str::Split().

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

49 {
50  if (fConfig) delete fConfig;
51  fConfig = 0;
52 
53  LOG("Ntp", pNOTICE)
54  << "Converting configuration registries to TFolders";
55 
56  fConfig = gROOT->GetRootFolder()->AddFolder("gconfig","GENIE configs");
57  gROOT->GetListOfBrowsables()->Add(fConfig,"gconfig");
58 
60 
61  const vector<string> & vconfkeys = algconf->ConfigKeyList();
62  vector<string>::const_iterator keyiter;
63 
64  for(keyiter = vconfkeys.begin(); keyiter != vconfkeys.end(); ++keyiter) {
65 
66  string key = *keyiter;
67 
68  LOG("Ntp",pDEBUG) << "Current configuration registry key" << key;
69 
70  vector<string> vkey = utils::str::Split(key,"/");
71  assert(vkey.size()==2);
72  string alg_name = vkey[0];
73  string param_set = vkey[1];
74 
75  LOG("Ntp",pDEBUG)
76  << "alg_name: " << alg_name << ", param_set: " << param_set;
77 
78  if( !(fConfig->FindObject(alg_name.c_str())) ) {
79  LOG("Ntp",pDEBUG) << "Adding new folder for alg: " << alg_name;
80  fConfig->AddFolder(alg_name.c_str(), "");
81  }
82  TFolder * alg_folder = (TFolder *) fConfig->FindObject(alg_name.c_str());
83 
84  LOG("Ntp",pDEBUG) << "Adding folder for param set: " << param_set;
85  TFolder * config_folder = alg_folder->AddFolder(param_set.c_str(), "");
86 
87  LOG("Ntp",pDEBUG) << "Accessing Registry & converting it to TFolder";
88  Registry * config_registry = algconf->FindRegistry(key);
89  config_registry->CopyToFolder(config_folder);
90  }
91 
92  return fConfig;
93 }
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Definition: AlgConfigPool.h:41
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
const vector< string > & ConfigKeyList(void) const
vector< string > Split(string input, string delim)
Definition: StringUtils.cxx:42
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
assert(nhit_max >=nhit_nbins)
Registry * FindRegistry(string key) const
#define pNOTICE
Definition: Messenger.h:62
void CopyToFolder(TFolder *folder) const
Definition: Registry.cxx:641
static AlgConfigPool * Instance()
#define pDEBUG
Definition: Messenger.h:64

Member Data Documentation

TFolder* genie::NtpMCJobConfig::fConfig
private

Definition at line 39 of file NtpMCJobConfig.h.

Referenced by GetFolder(), and Load().


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