Algorithm abstract base class. More...
#include <Algorithm.h>
Public Member Functions | |
virtual | ~Algorithm () |
virtual void | Configure (const Registry &config) |
virtual void | Configure (string config) |
virtual void | FindConfig (void) |
virtual const Registry & | GetConfig (void) const |
Registry * | GetOwnedConfig (void) |
virtual const AlgId & | Id (void) const |
Get algorithm ID. More... | |
virtual AlgStatus_t | GetStatus (void) const |
Get algorithm status. More... | |
virtual bool | AllowReconfig (void) const |
virtual AlgCmp_t | Compare (const Algorithm *alg) const |
Compare with input algorithm. More... | |
virtual void | SetId (const AlgId &id) |
Set algorithm ID. More... | |
virtual void | SetId (string name, string config) |
const Algorithm * | SubAlg (const RgKey ®istry_key) const |
void | AdoptConfig (void) |
void | AdoptSubstructure (void) |
virtual void | Print (ostream &stream) const |
Print algorithm info. More... | |
Static Public Member Functions | |
static string | BuildParamVectKey (const std::string &comm_name, unsigned int i) |
static string | BuildParamVectSizeKey (const std::string &comm_name) |
Protected Member Functions | |
Algorithm () | |
Algorithm (string name) | |
Algorithm (string name, string config) | |
void | Initialize (void) |
void | DeleteConfig (void) |
void | DeleteSubstructure (void) |
Registry * | ExtractLocalConfig (const Registry &in) const |
Registry * | ExtractLowerConfig (const Registry &in, const string &alg_key) const |
Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key. More... | |
template<class T > | |
bool | GetParam (const RgKey &name, T &p, bool is_top_call=true) const |
template<class T > | |
bool | GetParamDef (const RgKey &name, T &p, const T &def) const |
template<class T > | |
int | GetParamVect (const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const |
Handle to load vectors of parameters. More... | |
int | GetParamVectKeys (const std::string &comm_name, std::vector< RgKey > &k, bool is_top_call=true) const |
int | AddTopRegistry (Registry *rp, bool owns=true) |
add registry with top priority, also update ownership More... | |
int | AddLowRegistry (Registry *rp, bool owns=true) |
add registry with lowest priority, also update ownership More... | |
int | MergeTopRegistry (const Registry &r) |
int | AddTopRegisties (const vector< Registry * > &rs, bool owns=false) |
Add registries with top priority, also udated Ownerships. More... | |
Protected Attributes | |
bool | fAllowReconfig |
bool | fOwnsSubstruc |
true if it owns its substructure (sub-algs,...) More... | |
AlgId | fID |
algorithm name and configuration set More... | |
vector< Registry * > | fConfVect |
vector< bool > | fOwnerships |
ownership for every registry in fConfVect More... | |
AlgStatus_t | fStatus |
algorithm execution status More... | |
AlgMap * | fOwnedSubAlgMp |
local pool for owned sub-algs (taken out of the factory pool) More... | |
Private Attributes | |
Registry * | fConfig |
Summary configuration derived from fConvVect, not necessarily allocated. More... | |
Friends | |
ostream & | operator<< (ostream &stream, const Algorithm &alg) |
Algorithm abstract base class.
Marco Roda <mroda liverpool.ac.uk> University of Liverpool
May 02, 2004
Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org
Definition at line 53 of file Algorithm.h.
|
virtual |
Definition at line 56 of file Algorithm.cxx.
|
protected |
Definition at line 38 of file Algorithm.cxx.
|
protected |
Definition at line 43 of file Algorithm.cxx.
Definition at line 49 of file Algorithm.cxx.
add registry with lowest priority, also update ownership
Definition at line 641 of file Algorithm.cxx.
Add registries with top priority, also udated Ownerships.
Definition at line 693 of file Algorithm.cxx.
add registry with top priority, also update ownership
Definition at line 625 of file Algorithm.cxx.
void Algorithm::AdoptConfig | ( | void | ) |
Clone the configuration registry looked up from the configuration pool and take its ownership
Definition at line 386 of file Algorithm.cxx.
void Algorithm::AdoptSubstructure | ( | void | ) |
Take ownership of the algorithms subtructure (sub-algorithms,...) by copying them from the AlgFactory pool to the local pool Also bring all the configuration variables to the top level config Registry. This can be used to group together a series of algorithms & their configurations and extract (a clone of) this group from the shared pools. Having a series of algorithms/configurations behaving as a monolithic block, with a single point of configuration (the top level) is to be used when bits & pieces of GENIE are used in isolation for data fitting or reweighting
Definition at line 400 of file Algorithm.cxx.
|
inlinevirtual |
Allow reconfigration after initializaton? Algorithms may opt-out, if reconfiguration is not necessary, to improve event reweighting speed.
Definition at line 105 of file Algorithm.h.
|
static |
Definition at line 510 of file Algorithm.cxx.
|
static |
Definition at line 520 of file Algorithm.cxx.
Compare with input algorithm.
Definition at line 286 of file Algorithm.cxx.
|
virtual |
Configure the algorithm with an external registry The registry is merged with the top level registry if it is owned, Otherwise a copy of it is added with the highest priority
Reimplemented in genie::NewQELXSec, genie::AGKYLowW2019, genie::SmithMonizUtils, genie::Intranuke, genie::Intranuke2018, genie::ReinSehgalSPPPXSec, genie::BBA07ELFormFactorsModel, genie::SmithMonizQELCCPXSec, genie::LocalFGM, genie::KovalenkoQELCharmPXSec, genie::NuclearModelMap, genie::NievesQELCCPXSec, genie::GRV98LO, genie::QELEventGeneratorSM, genie::BSKLNBaseRESPXSec2014, genie::SmithMonizQELCCXSec, genie::ReinSehgalRESXSecFast, genie::AGCharm2019, genie::LHAPDF6, genie::FGMBodekRitchie, genie::ReinSehgalRESPXSec, genie::ReinSehgalSPPXSec, genie::BostedChristyEMPXSec, genie::EventGenerator, genie::MartiniEricsonChanfrayMarteauMECPXSec2016, genie::NievesSimoVacasMECPXSec2016, genie::SuSAv2MECPXSec, genie::SpectralFunc1d, genie::SuSAv2QELPXSec, genie::DMElectronPXSec, genie::QPMDMDISStrucFuncBase, genie::ReinSehgalCOHPiPXSec, genie::EffectiveSF, genie::PaisQELLambdaPXSec, genie::QPMDISStrucFuncBase, genie::BardinIMDRadCorPXSec, genie::NuElectronPXSec, genie::LHAPDF5, genie::ReinSehgalRESXSec, genie::QPMDMDISPXSec, genie::SpectralFunc, genie::LwlynSmithQELCCPXSec, genie::HybridXSecAlgorithm, genie::BertuzzoDNuCOHPXSec, genie::LeptoHadronization, genie::LwlynSmithFF, genie::evtlib::EventLibraryInterface, genie::AhrensDMELPXSec, genie::DMElectronXSec, genie::BergerSehgalCOHPiPXSec2015, genie::OutgoingDarkGenerator, genie::BYPDF, genie::GLRESXSec, genie::Pythia8Hadro2019, genie::HEDISInteractionListGenerator, genie::SpectralFunction2p2h, genie::BBA03ELFormFactorsModel, genie::BBA05ELFormFactorsModel, genie::P33PaschosLalakulichPXSec, genie::DMDISInteractionListGenerator, genie::DFRXSec, genie::Pythia6Hadro2019, genie::KLVOxygenIBDPXSec, genie::MECGenerator, genie::PauliBlocker, genie::IMDAnnihilationPXSec, genie::NuElectronXSec, genie::DMDISKinematicsGenerator, genie::AivazisCharmPXSecLO, genie::AlvarezRusoCOHPiPXSec, genie::BergerSehgalFMCOHPiPXSec2015, genie::DarkSectorDecayer, genie::QPMDISPXSec, genie::StrumiaVissaniIBDPXSec, genie::NNBarOscPrimaryVtxGenerator, genie::FermiMover, genie::RESHadronicSystemGenerator, genie::DMELEventGenerator, genie::PrimaryLeptonGenerator, genie::EngelFormFactor, genie::KNOTunedQPMDISPXSec, genie::ReinDFRPXSec, genie::AhrensNCELPXSec, genie::RosenbluthPXSec, genie::TransverseEnhancementFFModel, genie::ZExpAxialFormFactorModel, genie::UnstableParticleDecayer, genie::DISInteractionListGenerator, genie::NucBindEnergyAggregator, genie::HEDISKinematicsGenerator, genie::MECXSec, genie::AlamSimoAtharVacasSKPXSec2014, genie::AlamSimoAtharVacasSKXSec, genie::SlowRsclCharmDISPXSecLO, genie::PattonCEvNSPXSec, genie::DISKinematicsGenerator, genie::GLRESPXSec, genie::PetersonFragm, genie::HEDISPXSec, genie::EmpiricalMECPXSec2015, genie::QELEventGeneratorSuSA, genie::H3AMNuGammaPXSec, genie::DMELKinematicsGenerator, genie::DMELXSec, genie::COHDNuEventGenerator, genie::GLRESGenerator, genie::CollinsSpillerFragm, genie::IBDKinematicsGenerator, genie::SRCNuclearRecoil, genie::KuzminNaumov2016AxialFormFactorModel, genie::RSPPResonanceSelector, genie::DMELInteractionListGenerator, genie::DMDISXSec, genie::COHKinematicsGenerator, genie::COHDNuInteractionListGenerator, genie::AGKY2019, genie::HEDISGenerator, genie::NucleonDecayPrimaryVtxGenerator, genie::QELEventGenerator, genie::CEvNSEventGenerator, genie::XSecLinearCombinations, genie::COHDNuXSec, genie::Decayer, genie::GLRESKinematicsGenerator, genie::TabulatedHadronTensorModelI, genie::HEDISXSec, genie::IBDInteractionListGenerator, genie::DipoleAxialFormFactorModel, genie::RESKinematicsGenerator, genie::RSPPInteractionListGenerator, genie::PhysInteractionSelector, genie::DMEInteractionListGenerator, genie::DMEKinematicsGenerator, genie::COHInteractionListGenerator, genie::HadronTransporter, genie::IBDXSecMap, genie::NHLPrimaryVtxGenerator, genie::QELKinematicsGenerator, genie::DipoleELFormFactorsModel, genie::QELXSec, genie::RESInteractionListGenerator, genie::RSHelicityAmplModelNCn, genie::RSHelicityAmplModelNCp, genie::SKInteractionListGenerator, genie::SKKinematicsGenerator, genie::QvalueShifter, genie::VertexGenerator, genie::DFRInteractionListGenerator, genie::DFRKinematicsGenerator, genie::INukeDeltaPropg, genie::MECInteractionListGenerator, genie::NuEInteractionListGenerator, genie::NuEKinematicsGenerator, genie::QELInteractionListGenerator, genie::CEvNSXSec, genie::COHXSec, genie::DISHadronicSystemGenerator, genie::BYStrucFunc, genie::DISXSec, genie::GLRESInteractionListGenerator, genie::CascadeReweight, genie::RESXSec, genie::COHXSecAR, genie::IMDXSec, genie::DMBYStrucFunc, genie::XSecScaleI, genie::evtlib::EvtLibPXSec, and genie::evtlib::EvtLibInteractionListGenerator.
Definition at line 62 of file Algorithm.cxx.
|
virtual |
Configure the algorithm from the AlgoConfigPool based on param_set string given in input An algorithm contains a vector of registries coming from different xml configuration files, which are loaded according a very precise prioriy This methods will load a number registries in order of priority: 1) "Tunable" parameter set from CommonParametes. This is loaded with the highest prioriry and it is designed to be used for tuning procedure Usage not expected from the user. 2) For every string defined in "CommonParame" the corresponding parameter set will be loaded from CommonParameter.xml 3) parameter set specified by the config string and defined in the xml file of the algorithm 4) if config is not "Default" also the Default parameter set from the same xml file will be loaded Effectively this avoids the repetion of a parameter when it is not changed in the requested configuration
Reimplemented in genie::NewQELXSec, genie::AGKYLowW2019, genie::SmithMonizUtils, genie::Intranuke, genie::Intranuke2018, genie::ReinSehgalSPPPXSec, genie::BBA07ELFormFactorsModel, genie::SmithMonizQELCCPXSec, genie::LocalFGM, genie::KovalenkoQELCharmPXSec, genie::NuclearModelMap, genie::NievesQELCCPXSec, genie::HAIntranuke, genie::GRV98LO, genie::QELEventGeneratorSM, genie::BSKLNBaseRESPXSec2014, genie::SmithMonizQELCCXSec, genie::ReinSehgalRESXSecFast, genie::AGCharm2019, genie::LHAPDF6, genie::FGMBodekRitchie, genie::ReinSehgalRESPXSec, genie::ReinSehgalSPPXSec, genie::BostedChristyEMPXSec, genie::EventGenerator, genie::MartiniEricsonChanfrayMarteauMECPXSec2016, genie::NievesSimoVacasMECPXSec2016, genie::SuSAv2MECPXSec, genie::SpectralFunc1d, genie::SuSAv2QELPXSec, genie::DMElectronPXSec, genie::QPMDMDISStrucFuncBase, genie::ReinSehgalCOHPiPXSec, genie::EffectiveSF, genie::PaisQELLambdaPXSec, genie::QPMDISStrucFuncBase, genie::BardinIMDRadCorPXSec, genie::NuElectronPXSec, genie::LHAPDF5, genie::ReinSehgalRESXSec, genie::QPMDMDISPXSec, genie::SpectralFunc, genie::LwlynSmithQELCCPXSec, genie::HybridXSecAlgorithm, genie::BertuzzoDNuCOHPXSec, genie::LeptoHadronization, genie::LwlynSmithFF, genie::evtlib::EventLibraryInterface, genie::AhrensDMELPXSec, genie::DMElectronXSec, genie::BergerSehgalCOHPiPXSec2015, genie::OutgoingDarkGenerator, genie::BYPDF, genie::GLRESXSec, genie::Pythia8Hadro2019, genie::HEDISInteractionListGenerator, genie::SpectralFunction2p2h, genie::BBA03ELFormFactorsModel, genie::BBA05ELFormFactorsModel, genie::P33PaschosLalakulichPXSec, genie::DMDISInteractionListGenerator, genie::DFRXSec, genie::Pythia6Hadro2019, genie::KLVOxygenIBDPXSec, genie::MECGenerator, genie::PauliBlocker, genie::IMDAnnihilationPXSec, genie::NuElectronXSec, genie::DMDISKinematicsGenerator, genie::AivazisCharmPXSecLO, genie::AlvarezRusoCOHPiPXSec, genie::BergerSehgalFMCOHPiPXSec2015, genie::DarkSectorDecayer, genie::QPMDISPXSec, genie::StrumiaVissaniIBDPXSec, genie::NNBarOscPrimaryVtxGenerator, genie::FermiMover, genie::RESHadronicSystemGenerator, genie::DMELEventGenerator, genie::PrimaryLeptonGenerator, genie::EngelFormFactor, genie::KNOTunedQPMDISPXSec, genie::ReinDFRPXSec, genie::AhrensNCELPXSec, genie::RosenbluthPXSec, genie::TransverseEnhancementFFModel, genie::ZExpAxialFormFactorModel, genie::UnstableParticleDecayer, genie::DISInteractionListGenerator, genie::NucBindEnergyAggregator, genie::HEDISKinematicsGenerator, genie::MECXSec, genie::AlamSimoAtharVacasSKPXSec2014, genie::AlamSimoAtharVacasSKXSec, genie::SlowRsclCharmDISPXSecLO, genie::PattonCEvNSPXSec, genie::DISKinematicsGenerator, genie::GLRESPXSec, genie::PetersonFragm, genie::HEDISPXSec, genie::EmpiricalMECPXSec2015, genie::QELEventGeneratorSuSA, genie::H3AMNuGammaPXSec, genie::DMELKinematicsGenerator, genie::DMELXSec, genie::COHDNuEventGenerator, genie::GLRESGenerator, genie::CollinsSpillerFragm, genie::IBDKinematicsGenerator, genie::SRCNuclearRecoil, genie::KuzminNaumov2016AxialFormFactorModel, genie::RSPPResonanceSelector, genie::DMELInteractionListGenerator, genie::DMDISXSec, genie::COHKinematicsGenerator, genie::COHDNuInteractionListGenerator, genie::AGKY2019, genie::HEDISGenerator, genie::NucleonDecayPrimaryVtxGenerator, genie::QELEventGenerator, genie::CEvNSEventGenerator, genie::XSecLinearCombinations, genie::COHDNuXSec, genie::Decayer, genie::GLRESKinematicsGenerator, genie::TabulatedHadronTensorModelI, genie::HEDISXSec, genie::IBDInteractionListGenerator, genie::DipoleAxialFormFactorModel, genie::RESKinematicsGenerator, genie::RSPPInteractionListGenerator, genie::PhysInteractionSelector, genie::DMEInteractionListGenerator, genie::DMEKinematicsGenerator, genie::COHInteractionListGenerator, genie::HadronTransporter, genie::IBDXSecMap, genie::NHLPrimaryVtxGenerator, genie::QELKinematicsGenerator, genie::DipoleELFormFactorsModel, genie::QELXSec, genie::RESInteractionListGenerator, genie::RSHelicityAmplModelNCn, genie::RSHelicityAmplModelNCp, genie::SKInteractionListGenerator, genie::SKKinematicsGenerator, genie::QvalueShifter, genie::VertexGenerator, genie::DFRInteractionListGenerator, genie::DFRKinematicsGenerator, genie::INukeDeltaPropg, genie::MECInteractionListGenerator, genie::NuEInteractionListGenerator, genie::NuEKinematicsGenerator, genie::QELInteractionListGenerator, genie::CEvNSXSec, genie::COHXSec, genie::DISHadronicSystemGenerator, genie::BYStrucFunc, genie::DISXSec, genie::GLRESInteractionListGenerator, genie::CascadeReweight, genie::RESXSec, genie::COHXSecAR, genie::IMDXSec, genie::DMBYStrucFunc, genie::XSecScaleI, genie::evtlib::EvtLibPXSec, and genie::evtlib::EvtLibInteractionListGenerator.
Definition at line 118 of file Algorithm.cxx.
|
protected |
Definition at line 463 of file Algorithm.cxx.
|
protected |
Definition at line 488 of file Algorithm.cxx.
Split an incoming configuration Registry into a block valid for this algorithm Ownership of the returned registry belongs to the algo
Definition at line 558 of file Algorithm.cxx.
|
protected |
Split an incoming configuration Registry into a block valid for the sub-algo identified by alg_key.
Definition at line 589 of file Algorithm.cxx.
|
virtual |
Lookup configuration from the config pool Similar logic from void Configure(string)
Definition at line 127 of file Algorithm.cxx.
|
virtual |
Get configuration registry Evaluate the summary of the configuration and returns it The summary of a configuration is a merge of all the registries known to the algorithm (see Configure() methods) but every parameter is appearing only once and in case of repetitions, only the parameter from the registry with the highest prioriry is considered.
Definition at line 246 of file Algorithm.cxx.
Registry * Algorithm::GetOwnedConfig | ( | void | ) |
Returns the pointer of the summary registry, see previous method Gives access to the summary so it could be changed. The usage of this method is deprecated as it is mantained only for back compatibility. If you need to add or chage a parter (or more), use the AddTopRegistry() instead
Definition at line 279 of file Algorithm.cxx.
|
protected |
Ideal access to a parameter value from the vector of registries Returns true if the value is found and the parameters is set
|
protected |
Ideal access to a parameter value from the vector of registries, With default value. Returns true if the value is set from the registries, false if the value is the default
|
protected |
Handle to load vectors of parameters.
|
protected |
Definition at line 528 of file Algorithm.cxx.
|
inlinevirtual |
|
inlinevirtual |
|
protected |
Definition at line 335 of file Algorithm.cxx.
|
protected |
Merge with top level registry if first reg of the vector is owned Otherwise an owned copy is added as a top registry
Definition at line 658 of file Algorithm.cxx.
|
virtual |
Print algorithm info.
Definition at line 315 of file Algorithm.cxx.
|
virtual |
Definition at line 310 of file Algorithm.cxx.
Access the sub-algorithm pointed to by the input key, either from the local pool or from AlgFactory's pool
Definition at line 345 of file Algorithm.cxx.
|
friend |
Definition at line 31 of file Algorithm.cxx.
|
protected |
Definition at line 156 of file Algorithm.h.
|
private |
Summary configuration derived from fConvVect, not necessarily allocated.
Definition at line 199 of file Algorithm.h.
ideally these members should go private Registry will be access only through the GetParam method configurations registries from various sources the order of the vector is the precedence in case of repeated parameters position 0 -> Highest precedence
Definition at line 164 of file Algorithm.h.
|
protected |
algorithm name and configuration set
Definition at line 159 of file Algorithm.h.
|
protected |
local pool for owned sub-algs (taken out of the factory pool)
Definition at line 170 of file Algorithm.h.
ownership for every registry in fConfVect
Definition at line 167 of file Algorithm.h.
|
protected |
true if it owns its substructure (sub-algs,...)
Definition at line 158 of file Algorithm.h.
|
protected |
algorithm execution status
Definition at line 169 of file Algorithm.h.