GENIEGenerator
|
The GENIE Algorithm Factory. More...
#include <AlgFactory.h>
Classes | |
struct | Cleaner |
singleton cleaner More... | |
Public Member Functions | |
const Algorithm * | GetAlgorithm (const AlgId &algid) |
const Algorithm * | GetAlgorithm (string name, string conf="Default") |
Algorithm * | AdoptAlgorithm (const AlgId &algid) const |
Algorithm * | AdoptAlgorithm (string name, string conf="Default") const |
void | ForceReconfiguration (bool ignore_alg_opt_out=false) |
void | Print (ostream &stream) const |
print algorithm factory More... | |
Static Public Member Functions | |
static AlgFactory * | Instance () |
Private Member Functions | |
AlgFactory () | |
AlgFactory (const AlgFactory &alg_factory) | |
virtual | ~AlgFactory () |
Algorithm * | InstantiateAlgorithm (string name, string config) const |
Private Attributes | |
map< string, Algorithm * > | fAlgPool |
'algorithm key' (namespace::name/config) -> 'algorithmic object' map More... | |
Static Private Attributes | |
static AlgFactory * | fInstance = 0 |
sinleton's self More... | |
Friends | |
struct | Cleaner |
ostream & | operator<< (ostream &stream, const AlgFactory &algf) |
The GENIE Algorithm Factory.
Definition at line 39 of file AlgFactory.h.
|
private |
Definition at line 37 of file AlgFactory.cxx.
References fInstance.
Referenced by Instance().
|
private |
|
privatevirtual |
Definition at line 42 of file AlgFactory.cxx.
References fAlgPool, and fInstance.
Like GetAlgorithm() but the algorithm is not placed at the AlgFactory pool and its ownership is transfered to the caller
Hands over an algorithm instance that is owned by the client. The client can alter this object (eg. reconfigure) but the AlgFactory does not keep track of it and the client is responsible for deleting it.
Definition at line 116 of file AlgFactory.cxx.
References genie::AlgId::Config(), and genie::AlgId::Name().
Referenced by genie::Algorithm::AdoptSubstructure(), genie::GEVGDriver::BuildInteractionSelector(), GetCrossSection(), genie::EmpiricalMECPXSec2015::LoadConfig(), main(), and testReconfigInOwnedModules().
Algorithm * AlgFactory::AdoptAlgorithm | ( | string | name, |
string | conf = "Default" |
||
) | const |
Definition at line 125 of file AlgFactory.cxx.
References InstantiateAlgorithm().
void AlgFactory::ForceReconfiguration | ( | bool | ignore_alg_opt_out = false | ) |
Forces a reconfiguration of all algorithms kept at the factory pool. The algorithms look up their nominal configuration from the config pool. Use that to propagate modifications made directly at the config pool.
Definition at line 131 of file AlgFactory.cxx.
References genie::Algorithm::AllowReconfig(), genie::AlgId::Config(), genie::Algorithm::Configure(), fAlgPool, genie::Algorithm::Id(), LOG, and pNOTICE.
Referenced by IncrementCoefficients(), main(), and testReconfigInCommonPool().
Instantiates, configures and returns a pointer to the specified algorithm. The algorithm is placed at the AlgFactory pool (is owned by the factory) from where it will be looked up at subsequent calls.
Manages the instantiation and "storage/retrieval" of algorithms. These algorithms are owned by the factory and it hands over (to the client) a "const Algorithm *" that can be dynamically casted to the requested Algorithm Interface (eg. XSecAlgorithmI, Decayer, PdfModelI, etc...)
Definition at line 75 of file AlgFactory.cxx.
References genie::AlgId::Config(), and genie::AlgId::Name().
Referenced by BuildStdNtuple(), CalculateFormFactor(), genie::utils::gsl::d2Xsec_dQ2dv::d2Xsec_dQ2dv(), genie::utils::gsl::dv_dQ2_E::dv_dQ2_E(), GenerateOriginMomentum(), GenerateOriginPosition(), GetAlgorithms(), GetIntranuke(), genie::hnl::FluxCreator::GetProductionProbs(), genie::hnl::selector::GetValidChannelWidths(), HNLGenerator(), genie::NewQELXSec::Integrate(), genie::ReinSehgalRESPXSec::LoadConfig(), genie::BSKLNBaseRESPXSec2014::LoadConfig(), genie::PauliBlocker::LoadModelType(), main(), NeutronOscGenerator(), NucleonDecayGenerator(), genie::utils::nuclear::NuclQELXSecSuppression(), genie::utils::mec::OldTensorContraction(), ReadInConfig(), genie::Algorithm::SubAlg(), TestDecay(), TestPythiaTauDecays(), testReconfigInCommonPool(), and VerticalSlice().
const Algorithm * AlgFactory::GetAlgorithm | ( | string | name, |
string | conf = "Default" |
||
) |
Definition at line 85 of file AlgFactory.cxx.
References fAlgPool, InstantiateAlgorithm(), LOG, pDEBUG, pFATAL, and SLOG.
|
static |
Definition at line 64 of file AlgFactory.cxx.
References AlgFactory(), genie::AlgFactory::Cleaner::DummyMethodAndSilentCompiler(), and fInstance.
Referenced by genie::Algorithm::AdoptSubstructure(), genie::GEVGDriver::BuildInteractionSelector(), BuildStdNtuple(), genie::utils::gsl::d2Xsec_dQ2dv::d2Xsec_dQ2dv(), genie::utils::gsl::dv_dQ2_E::dv_dQ2_E(), GenerateOriginMomentum(), GenerateOriginPosition(), GetCrossSection(), GetIntranuke(), genie::hnl::FluxCreator::GetProductionProbs(), genie::hnl::selector::GetValidChannelWidths(), HNLGenerator(), genie::NewQELXSec::Integrate(), genie::EmpiricalMECPXSec2015::LoadConfig(), genie::ReinSehgalRESPXSec::LoadConfig(), genie::BSKLNBaseRESPXSec2014::LoadConfig(), genie::PauliBlocker::LoadModelType(), main(), NeutronOscGenerator(), NucleonDecayGenerator(), genie::utils::nuclear::NuclQELXSecSuppression(), genie::utils::mec::OldTensorContraction(), ReadInConfig(), genie::Algorithm::SubAlg(), TestDecay(), TestPythiaTauDecays(), testReconfigInCommonPool(), testReconfigInOwnedModules(), and VerticalSlice().
|
private |
method instantiating (based on TClass * TROOT::GetClass(name)) & configuring algorithmic objects
Instantiate the requested object based on the registration of its TClass through the generated ROOT dictionaries The class of any object instantiated here must have a LinkDef entry.
Definition at line 151 of file AlgFactory.cxx.
References genie::Algorithm::Configure(), LOG, pDEBUG, and pERROR.
Referenced by AdoptAlgorithm(), and GetAlgorithm().
void AlgFactory::Print | ( | ostream & | stream | ) | const |
print algorithm factory
Definition at line 183 of file AlgFactory.cxx.
References fAlgPool, genie::Algorithm::GetConfig(), genie::AlgConfigPool::GlobalParameterList(), genie::Algorithm::Id(), and genie::AlgConfigPool::Instance().
Referenced by genie::operator<<().
|
friend |
Definition at line 89 of file AlgFactory.h.
|
friend |
Definition at line 28 of file AlgFactory.cxx.
|
private |
'algorithm key' (namespace::name/config) -> 'algorithmic object' map
Definition at line 77 of file AlgFactory.h.
Referenced by ForceReconfiguration(), GetAlgorithm(), Print(), and ~AlgFactory().
|
staticprivate |
sinleton's self
Definition at line 74 of file AlgFactory.h.
Referenced by AlgFactory(), Instance(), ~AlgFactory(), and genie::AlgFactory::Cleaner::~Cleaner().