GENIEGenerator
Loading...
Searching...
No Matches
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 \at cern.ch> University of Liverpool
Created:\n October 1, 2004
License:\n Copyright (c) 2003-2025, 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()

genie::NtpMCJobConfig::NtpMCJobConfig ( )

◆ ~NtpMCJobConfig()

NtpMCJobConfig::~NtpMCJobConfig ( )
virtual

Definition at line 37 of file NtpMCJobConfig.cxx.

38{
39
40}

Member Function Documentation

◆ GetFolder()

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

Definition at line 34 of file NtpMCJobConfig.h.

34{ return fConfig; }

References fConfig.

◆ Load()

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
53 AlgConfigPool * algconf = AlgConfigPool::Instance();
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}
#define pNOTICE
Definition Messenger.h:61
#define pDEBUG
Definition Messenger.h:63
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
Registry * FindRegistry(string key) const
static AlgConfigPool * Instance()
const vector< string > & ConfigKeyList(void) const
void CopyToFolder(TFolder *folder) const
Definition Registry.cxx:626
vector< string > Split(string input, string delim)

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().

Member Data Documentation

◆ fConfig

TFolder* genie::NtpMCJobConfig::fConfig
private

Definition at line 38 of file NtpMCJobConfig.h.

Referenced by ClassImp(), GetFolder(), and Load().


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