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 <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 <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

October 1, 2004

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

Definition at line 26 of file NtpMCJobConfig.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file NtpMCJobConfig.cxx.

38 {
39 
40 }

Member Function Documentation

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

Definition at line 34 of file NtpMCJobConfig.h.

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

Definition at line 42 of file NtpMCJobConfig.cxx.

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

Member Data Documentation

TFolder* genie::NtpMCJobConfig::fConfig
private

Definition at line 38 of file NtpMCJobConfig.h.


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