|
GENIEGenerator
|
A registry. Provides the container for algorithm configuration parameters. More...
#include <Registry.h>
Public Member Functions | |
| Registry () | |
| Registry (string name, bool isReadOnly=true) | |
| Registry (const Registry &) | |
| virtual | ~Registry () |
| Registry & | operator= (const Registry ®) |
| Registry & | operator+= (const Registry ®) |
| void | operator() (RgKey key, int item) |
| void | operator() (RgKey key, bool item) |
| void | operator() (RgKey key, double item) |
| void | operator() (RgKey key, const char *item) |
| void | operator() (RgKey key, string item) |
| void | Lock (void) |
| locks the registry | |
| void | UnLock (void) |
| unlocks the registry (doesn't unlock items) | |
| bool | IsLocked (void) const |
| checks registry lock | |
| void | InhibitItemLocks (void) |
| override individual item locks | |
| void | RestoreItemLocks (void) |
| restore individual item locks | |
| bool | ItemLocksAreActive (void) const |
| check if item locks are active | |
| void | LockItem (RgKey key) |
| locks the registry item | |
| void | UnLockItem (RgKey key) |
| unlocks the registry item | |
| bool | ItemIsLocked (RgKey key) const |
| check item lock | |
| bool | ItemIsLocal (RgKey key) const |
| local or global? | |
| void | OverrideGlobalDef (RgKey key) |
| let item override global default (i.e. a 'local' item) | |
| void | LinkToGlobalDef (RgKey key) |
| link its value to a global default (i.e. a 'global' item) | |
| void | Set (RgIMapPair entry) |
| void | Set (RgKey key, RgBool item) |
| void | Set (RgKey key, RgInt item) |
| void | Set (RgKey key, RgDbl item) |
| void | Set (RgKey key, RgStr item) |
| void | Set (RgKey key, RgAlg item) |
| void | Set (RgKey key, RgCChAr item) |
| void | Set (RgKey key, RgH1F item) |
| void | Set (RgKey key, RgH2F item) |
| void | Set (RgKey key, RgTree item) |
| void | Get (RgKey key, const RegistryItemI *&item) const |
| void | Get (RgKey key, RgBool &item) const |
| void | Get (RgKey key, RgInt &item) const |
| void | Get (RgKey key, RgDbl &item) const |
| void | Get (RgKey key, RgStr &item) const |
| void | Get (RgKey key, RgAlg &item) const |
| void | Get (RgKey key, RgH1F &item) const |
| void | Get (RgKey key, RgH2F &item) const |
| void | Get (RgKey key, RgTree &item) const |
| RgBool | GetBool (RgKey key) const |
| RgInt | GetInt (RgKey key) const |
| RgDbl | GetDouble (RgKey key) const |
| RgStr | GetString (RgKey key) const |
| RgAlg | GetAlg (RgKey key) const |
| RgH1F | GetH1F (RgKey key) const |
| RgH2F | GetH2F (RgKey key) const |
| RgTree | GetTree (RgKey key) const |
| RgBool | GetBoolDef (RgKey key, RgBool def_opt, bool set_def=true) |
| RgInt | GetIntDef (RgKey key, RgInt def_opt, bool set_def=true) |
| RgDbl | GetDoubleDef (RgKey key, RgDbl def_opt, bool set_def=true) |
| RgStr | GetStringDef (RgKey key, RgStr def_opt, bool set_def=true) |
| RgAlg | GetAlgDef (RgKey key, RgAlg def_opt, bool set_def=true) |
| RgIMapConstIter | SafeFind (RgKey key) const |
| int | NEntries (void) const |
| get number of items | |
| bool | Exists (RgKey key) const |
| item with input key exists? | |
| bool | CanSetItem (RgKey key) const |
| can I set the specifed item? | |
| bool | DeleteEntry (RgKey key) |
| delete the spcified item | |
| void | SetName (string name) |
| set the registry name | |
| string | Name (void) const |
| get the registry name | |
| void | Print (ostream &stream) const |
| print the registry to stream | |
| void | Copy (const Registry &) |
| copy the input registry | |
| void | Append (const Registry &, RgKey pfx="") |
| append the input registry. Entries already in the registry are not updated | |
| void | Merge (const Registry &, RgKey pfx="") |
| append the input registry. Entries already in the registry are updated | |
| void | Clear (bool force=false) |
| clear the registry | |
| void | Init (void) |
| initialize the registry | |
| RgType_t | ItemType (RgKey key) const |
| return item type | |
| RgKeyList | FindKeys (RgKey key_part) const |
| create list with all keys containing 'key_part' | |
| const RgIMap & | GetItemMap (void) const |
| void | CopyToFolder (TFolder *folder) const |
| void | AssertExistence (RgKey key0) const |
| void | AssertExistence (RgKey key0, RgKey key1) const |
| void | AssertExistence (RgKey key0, RgKey key1, RgKey key2) const |
Private Member Functions | |
| RegistryItemI * | CloneRegistryItem (const RgKey &key) const |
| Properly clone a registry Item according to its type. | |
Private Attributes | |
| string | fName |
| registry's name | |
| bool | fIsReadOnly |
| is read only? | |
| bool | fInhibitItemLocks |
| RgIMap | fRegistry |
| 'key' -> 'value' map | |
Friends | |
| ostream & | operator<< (ostream &stream, const Registry ®istry) |
A registry. Provides the container for algorithm configuration parameters.
Definition at line 65 of file Registry.h.
| Registry::Registry | ( | ) |
Definition at line 85 of file Registry.cxx.
References Init().
Referenced by Append(), Copy(), Merge(), operator+=(), operator<<, operator=(), and Registry().
| Registry::Registry | ( | string | name, |
| bool | isReadOnly = true ) |
Definition at line 90 of file Registry.cxx.
References fInhibitItemLocks, fIsReadOnly, and fName.
| Registry::Registry | ( | const Registry & | registry | ) |
Definition at line 98 of file Registry.cxx.
References Copy(), fIsReadOnly, fName, and Registry().
|
virtual |
append the input registry. Entries already in the registry are not updated
Definition at line 743 of file Registry.cxx.
References genie::RgType::AsString(), CloneRegistryItem(), fRegistry, InhibitItemLocks(), IsLocked(), LOG, Name(), pERROR, pINFO, pWARN, and Registry().
Referenced by Copy(), and operator+=().
| void Registry::AssertExistence | ( | RgKey | key0 | ) | const |
Definition at line 602 of file Registry.cxx.
References Exists(), LOG, Name(), pERROR, and pFATAL.
Referenced by AssertExistence(), and AssertExistence().
Definition at line 613 of file Registry.cxx.
References AssertExistence().
Definition at line 619 of file Registry.cxx.
References AssertExistence().
| bool Registry::CanSetItem | ( | RgKey | key | ) | const |
can I set the specifed item?
Definition at line 256 of file Registry.cxx.
References IsLocked(), ItemIsLocked(), and ItemLocksAreActive().
Referenced by Set().
| void Registry::Clear | ( | bool | force = false | ) |
clear the registry
Definition at line 864 of file Registry.cxx.
References fRegistry, IsLocked(), LOG, Name(), pINFO, and pWARN.
Referenced by Copy(), and ~Registry().
|
private |
Properly clone a registry Item according to its type.
Definition at line 890 of file Registry.cxx.
References genie::RgType::AsString(), fRegistry, GetAlg(), GetBool(), GetDouble(), GetH1F(), GetH2F(), GetInt(), GetString(), GetTree(), genie::RegistryItemI::IsLocked(), genie::kRgAlg, genie::kRgBool, genie::kRgDbl, genie::kRgH1F, genie::kRgH2F, genie::kRgInt, genie::kRgStr, genie::kRgTree, LOG, Name(), pDEBUG, pERROR, pFATAL, and genie::RegistryItemI::TypeInfo().
| void Registry::Copy | ( | const Registry & | registry | ) |
copy the input registry
Definition at line 722 of file Registry.cxx.
References Append(), Clear(), fInhibitItemLocks, fIsReadOnly, fName, Init(), IsLocked(), LOG, Name(), pINFO, pWARN, and Registry().
Referenced by main(), operator=(), and Registry().
| void Registry::CopyToFolder | ( | TFolder * | folder | ) | const |
Definition at line 626 of file Registry.cxx.
References genie::RgType::AsString(), RgAlg::config, fRegistry, GetAlg(), GetBool(), GetDouble(), GetInt(), GetString(), genie::kRgAlg, genie::kRgBool, genie::kRgDbl, genie::kRgH1F, genie::kRgH2F, genie::kRgInt, genie::kRgStr, genie::kRgTree, LOG, RgAlg::name, pINFO, and genie::RegistryItemI::TypeInfo().
Referenced by genie::NtpMCJobConfig::Load().
| bool Registry::DeleteEntry | ( | RgKey | key | ) |
delete the spcified item
Definition at line 569 of file Registry.cxx.
References Exists(), fIsReadOnly, and fRegistry.
Referenced by Set().
| bool Registry::Exists | ( | RgKey | key | ) | const |
item with input key exists?
Definition at line 563 of file Registry.cxx.
References fRegistry.
Referenced by AssertExistence(), genie::HybridXSecAlgorithm::ChooseXSecAlg(), genie::HadronTransporter::Configure(), DeleteEntry(), genie::GetValueOrUseDefault(), ItemIsLocal(), ItemIsLocked(), LinkToGlobalDef(), genie::HybridXSecAlgorithm::LoadConfig(), LockItem(), OverrideGlobalDef(), and UnLockItem().
create list with all keys containing 'key_part'
Definition at line 840 of file Registry.cxx.
References fRegistry.
Referenced by genie::CascadeReweight::LoadConfig(), genie::Decayer::LoadConfig(), genie::GLRESWdecPythia8::LoadConfig(), genie::PhotonRESWdecPythia8::LoadConfig(), genie::QvalueShifter::LoadConfig(), genie::XSecScaleMap::LoadConfig(), and main().
| void Registry::Get | ( | RgKey | key, |
| const RegistryItemI *& | item ) const |
Definition at line 325 of file Registry.cxx.
References SafeFind().
Referenced by CheckUnitarityLimit(), GetAlg(), GetBool(), GetDouble(), GetInt(), GetString(), genie::GetValueOrUseDefault(), and main().
Definition at line 395 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), LOG, pDEBUG, and SafeFind().
Definition at line 331 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), LOG, pDEBUG, and SafeFind().
Definition at line 363 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), LOG, pDEBUG, and SafeFind().
Definition at line 412 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), LOG, pDEBUG, pWARN, and SafeFind().
Definition at line 428 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), LOG, pDEBUG, pWARN, and SafeFind().
Definition at line 347 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), LOG, pDEBUG, and SafeFind().
Definition at line 379 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), LOG, pDEBUG, and SafeFind().
Definition at line 444 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), LOG, pDEBUG, pWARN, and SafeFind().
Definition at line 488 of file Registry.cxx.
References Get().
Referenced by CloneRegistryItem(), CopyToFolder(), genie::IBDXSecMap::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::XSecScaleMap::LoadConfig(), genie::PauliBlocker::LoadModelType(), and genie::utils::nuclear::NuclQELXSecSuppression().
Definition at line 545 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Definition at line 460 of file Registry.cxx.
References Get().
Referenced by CloneRegistryItem(), CopyToFolder(), genie::utils::gsl::d2XSecRESFast_dWQ2_E::d2XSecRESFast_dWQ2_E(), genie::Decayer::LoadConfig(), genie::GLRESWdecPythia8::LoadConfig(), genie::PhotonRESWdecPythia8::LoadConfig(), and main().
Definition at line 525 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Referenced by genie::utils::gsl::d2XSecRESFast_dWQ2_E::d2XSecRESFast_dWQ2_E(), and main().
Definition at line 474 of file Registry.cxx.
References Get().
Referenced by genie::PDGLibrary::AddDarkSector(), genie::PDGLibrary::AddHNL(), CloneRegistryItem(), CopyToFolder(), genie::utils::gsl::d2XSecRESFast_dWQ2_E::d2XSecRESFast_dWQ2_E(), genie::GVldContext::Decode(), genie::TabulatedLabFrameHadronTensor::dSigma_dT_dCosTheta_rosenbluth(), genie::KPhaseSpace::GetTMaxDFR(), genie::NewQELXSec::Integrate(), and main().
Definition at line 535 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Referenced by genie::utils::gsl::d2XSecRESFast_dWQ2_E::d2XSecRESFast_dWQ2_E(), and main().
Definition at line 495 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), and fRegistry.
Referenced by CloneRegistryItem().
Definition at line 505 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), and fRegistry.
Referenced by CloneRegistryItem().
Definition at line 467 of file Registry.cxx.
References Get().
Referenced by genie::EventGeneratorListAssembler::AssembleGeneratorList(), CloneRegistryItem(), CopyToFolder(), and main().
Definition at line 530 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Referenced by main().
|
inline |
Definition at line 161 of file Registry.h.
References fRegistry.
Referenced by genie::Algorithm::AdoptSubstructure(), genie::Algorithm::ExtractLocalConfig(), genie::Algorithm::ExtractLowerConfig(), genie::Algorithm::FindConfig(), genie::BostedChristyEMPXSec::LoadConfig(), genie::FGMBodekRitchie::LoadConfig(), genie::NuclearModelMap::LoadConfig(), genie::SmithMonizUtils::LoadConfig(), and main().
Definition at line 481 of file Registry.cxx.
References Get().
Referenced by CloneRegistryItem(), CopyToFolder(), genie::Algorithm::FindConfig(), genie::NewQELXSec::Integrate(), and genie::P33PaschosLalakulichPXSec::XSec().
Definition at line 540 of file Registry.cxx.
References genie::GetValueOrUseDefault().
Referenced by main().
Definition at line 515 of file Registry.cxx.
References genie::RegistryItem< T >::Data(), and fRegistry.
Referenced by CloneRegistryItem().
| void Registry::InhibitItemLocks | ( | void | ) |
override individual item locks
Definition at line 163 of file Registry.cxx.
References fInhibitItemLocks.
| void Registry::Init | ( | void | ) |
initialize the registry
Definition at line 855 of file Registry.cxx.
References fInhibitItemLocks, fIsReadOnly, and fName.
Referenced by Copy(), and Registry().
| bool Registry::IsLocked | ( | void | ) | const |
checks registry lock
Definition at line 158 of file Registry.cxx.
References fIsReadOnly.
Referenced by Append(), CanSetItem(), Clear(), Copy(), genie::GetValueOrUseDefault(), and Merge().
| bool Registry::ItemIsLocal | ( | RgKey | key | ) | const |
local or global?
Definition at line 178 of file Registry.cxx.
References Exists(), fRegistry, LOG, and pDEBUG.
Referenced by genie::Algorithm::FindConfig(), and genie::GetValueOrUseDefault().
| bool Registry::ItemIsLocked | ( | RgKey | key | ) | const |
check item lock
Definition at line 218 of file Registry.cxx.
References Exists(), and fRegistry.
Referenced by CanSetItem(), and genie::SetRegistryItem().
| bool Registry::ItemLocksAreActive | ( | void | ) | const |
check if item locks are active
Definition at line 173 of file Registry.cxx.
References fInhibitItemLocks.
Referenced by CanSetItem().
return item type
Definition at line 829 of file Registry.cxx.
References fRegistry, genie::kRgUndefined, and genie::RegistryItemI::TypeInfo().
Referenced by main().
| void Registry::LinkToGlobalDef | ( | RgKey | key | ) |
link its value to a global default (i.e. a 'global' item)
Definition at line 206 of file Registry.cxx.
References Exists(), fRegistry, LOG, and pWARN.
Referenced by genie::GetValueOrUseDefault().
| void Registry::Lock | ( | void | ) |
locks the registry
Definition at line 148 of file Registry.cxx.
References fIsReadOnly.
Referenced by genie::GetValueOrUseDefault(), genie::AlgConfigPool::LoadRegistries(), main(), and main().
| void Registry::LockItem | ( | RgKey | key | ) |
append the input registry. Entries already in the registry are updated
Definition at line 787 of file Registry.cxx.
References genie::RgType::AsString(), CloneRegistryItem(), fRegistry, InhibitItemLocks(), IsLocked(), LOG, Name(), pINFO, pWARN, and Registry().
| string Registry::Name | ( | void | ) | const |
get the registry name
Definition at line 597 of file Registry.cxx.
References fName.
Referenced by Append(), AssertExistence(), Clear(), CloneRegistryItem(), Copy(), genie::Algorithm::ExtractLocalConfig(), genie::Algorithm::ExtractLowerConfig(), Merge(), Print(), and SafeFind().
| int Registry::NEntries | ( | void | ) | const |
get number of items
Definition at line 582 of file Registry.cxx.
References fRegistry.
| void Registry::operator() | ( | RgKey | key, |
| bool | item ) |
| void Registry::operator() | ( | RgKey | key, |
| const char * | item ) |
| void Registry::operator() | ( | RgKey | key, |
| double | item ) |
| void Registry::operator() | ( | RgKey | key, |
| int | item ) |
| void Registry::operator() | ( | RgKey | key, |
| string | item ) |
Definition at line 142 of file Registry.cxx.
References Append(), and Registry().
Definition at line 136 of file Registry.cxx.
References Copy(), and Registry().
| void Registry::OverrideGlobalDef | ( | RgKey | key | ) |
let item override global default (i.e. a 'local' item)
Definition at line 194 of file Registry.cxx.
| void Registry::Print | ( | ostream & | stream | ) | const |
print the registry to stream
Definition at line 679 of file Registry.cxx.
References genie::RgType::AsString(), fInhibitItemLocks, fIsReadOnly, fRegistry, LOG, Name(), pDEBUG, pERROR, genie::RegistryItemI::Print(), and genie::RegistryItemI::TypeInfo().
Referenced by operator<<.
| void Registry::RestoreItemLocks | ( | void | ) |
restore individual item locks
Definition at line 168 of file Registry.cxx.
References fInhibitItemLocks.
| RgIMapConstIter Registry::SafeFind | ( | RgKey | key | ) | const |
| void Registry::Set | ( | RgIMapPair | entry | ) |
Definition at line 267 of file Registry.cxx.
References CanSetItem(), DeleteEntry(), fRegistry, LOG, and pWARN.
Referenced by genie::AlgConfigPool::AddBasicParameter(), genie::AlgConfigPool::AddRootObjParameter(), genie::EmpiricalMECPXSec2015::Configure(), genie::HadronTransporter::Configure(), genie::NuclearModelMap::Configure(), genie::QELEventGeneratorSM::Configure(), genie::QPMDISPXSec::Configure(), genie::QPMDMDISPXSec::Configure(), genie::SmithMonizQELCCPXSec::Configure(), genie::SmithMonizQELCCXSec::Configure(), genie::GetValueOrUseDefault(), IncrementCoefficients(), main(), main(), operator()(), operator()(), operator()(), operator()(), operator()(), Set(), genie::SetRegistryItem(), testReconfigInCommonPool(), and testReconfigInOwnedModules().
Definition at line 305 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 279 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 289 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 310 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 315 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 284 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 300 of file Registry.cxx.
References genie::SetRegistryItem().
Definition at line 320 of file Registry.cxx.
References genie::SetRegistryItem().
| void Registry::SetName | ( | string | name | ) |
set the registry name
Definition at line 588 of file Registry.cxx.
References fIsReadOnly, fName, LOG, and pWARN.
Referenced by genie::AlgConfigPool::LoadRegistries().
| void Registry::UnLock | ( | void | ) |
unlocks the registry (doesn't unlock items)
Definition at line 153 of file Registry.cxx.
References fIsReadOnly.
Referenced by genie::GetValueOrUseDefault(), main(), main(), and testReconfigInCommonPool().
| void Registry::UnLockItem | ( | RgKey | key | ) |
unlocks the registry item
Definition at line 245 of file Registry.cxx.
|
friend |
Definition at line 77 of file Registry.cxx.
References Print(), and Registry().
|
private |
Definition at line 182 of file Registry.h.
Referenced by Copy(), InhibitItemLocks(), Init(), ItemLocksAreActive(), Print(), Registry(), and RestoreItemLocks().
|
private |
is read only?
Definition at line 181 of file Registry.h.
Referenced by Copy(), DeleteEntry(), Init(), IsLocked(), Lock(), Print(), Registry(), Registry(), SetName(), and UnLock().
|
private |
registry's name
Definition at line 180 of file Registry.h.
Referenced by Copy(), Init(), Name(), Registry(), Registry(), and SetName().
|
private |
'key' -> 'value' map
Definition at line 183 of file Registry.h.
Referenced by Append(), Clear(), CloneRegistryItem(), CopyToFolder(), DeleteEntry(), Exists(), FindKeys(), GetH1F(), GetH2F(), GetItemMap(), GetTree(), ItemIsLocal(), ItemIsLocked(), ItemType(), LinkToGlobalDef(), LockItem(), Merge(), NEntries(), OverrideGlobalDef(), Print(), SafeFind(), Set(), and UnLockItem().