GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 <c.andreopoulos cern.ch> University of Liverpool
Created:
October 1, 2004
License:
Copyright (c) 2003-2024, 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

NtpMCJobConfig::NtpMCJobConfig ( )

Definition at line 32 of file NtpMCJobConfig.cxx.

33 {
34  fConfig = 0;
35 }
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.

References fConfig.

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

Definition at line 42 of file NtpMCJobConfig.cxx.

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

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

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();
56  vector<string>::const_iterator keyiter;
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
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
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.

Referenced by GetFolder(), and Load().


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