GENIEGenerator
|
Abstract class. Provides a data caching mechanism for for concrete implementations of the EventRecordVisitorI interface, generating kinematics and wishing to cache maximum differential xsecs. More...
#include <KineGeneratorWithCache.h>
Protected Member Functions | |
KineGeneratorWithCache () | |
KineGeneratorWithCache (string name) | |
KineGeneratorWithCache (string name, string config) | |
~KineGeneratorWithCache () | |
virtual double | ComputeMaxXSec (const Interaction *in) const =0 |
virtual double | ComputeMaxXSec (const Interaction *in, const int nkey) const |
virtual double | MaxXSec (GHepRecord *evrec, const int nkey=0) const |
virtual double | FindMaxXSec (const Interaction *in, const int nkey=0) const |
virtual void | CacheMaxXSec (const Interaction *in, double xsec, const int nkey=0) const |
virtual double | Energy (const Interaction *in) const |
virtual CacheBranchFx * | AccessCacheBranch (const Interaction *in, const int nkey=0) const |
virtual void | AssertXSecLimits (const Interaction *in, double xsec, double xsec_max) const |
Protected Member Functions inherited from genie::EventRecordVisitorI | |
EventRecordVisitorI () | |
EventRecordVisitorI (string name) | |
EventRecordVisitorI (string name, string config) | |
Protected Member Functions inherited from genie::Algorithm | |
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 |
template<class T > | |
int | GetParamMat (const std::string &comm_name, TMatrixT< T > &mat, bool is_top_call=true) const |
Handle to load matrix of parameters. More... | |
template<class T > | |
int | GetParamMatSym (const std::string &comm_name, TMatrixTSym< T > &mat, bool is_top_call=true) const |
int | GetParamMatKeys (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 | |
const XSecAlgorithmI * | fXSecModel |
double | fSafetyFactor |
ComputeMaxXSec -> ComputeMaxXSec * fSafetyFactor. More... | |
std::vector< double > | vSafetyFactors |
MaxXSec -> MaxXSec * fSafetyFactors[nkey]. More... | |
int | fNumOfSafetyFactors |
Number of given safety factors. More... | |
std::vector< string > | vInterpolatorTypes |
Type of interpolator for each key in a branch. More... | |
int | fNumOfInterpolatorTypes |
Number of given interpolators types. More... | |
double | fMaxXSecDiffTolerance |
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec More... | |
double | fEMin |
min E for which maxxsec is cached - forcing explicit calc. More... | |
bool | fGenerateUniformly |
uniform over allowed phase space + event weight? More... | |
Protected Attributes inherited from genie::Algorithm | |
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... | |
Additional Inherited Members | |
Public Member Functions inherited from genie::EventRecordVisitorI | |
virtual | ~EventRecordVisitorI () |
virtual void | ProcessEventRecord (GHepRecord *event_rec) const =0 |
Public Member Functions inherited from genie::Algorithm | |
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 inherited from genie::Algorithm | |
static string | BuildParamVectKey (const std::string &comm_name, unsigned int i) |
static string | BuildParamVectSizeKey (const std::string &comm_name) |
static string | BuildParamMatKey (const std::string &comm_name, unsigned int i, unsigned int j) |
static string | BuildParamMatRowSizeKey (const std::string &comm_name) |
static string | BuildParamMatColSizeKey (const std::string &comm_name) |
Abstract class. Provides a data caching mechanism for for concrete implementations of the EventRecordVisitorI interface, generating kinematics and wishing to cache maximum differential xsecs.
This class provides some common implementation for handling (retrieving, creating, searching, adding to) the cache. The various super-classes should implement the ComputeMaxXSec(...) method for computing the maximum xsec in case it has not already being pushed into the cache at a previous iteration. \n Update May 15, 2022 IK: It makes possible to cache several values having different keys. The example of using this opportunity see in the class QELEventGeneratorSM.
Definition at line 49 of file KineGeneratorWithCache.h.
|
protected |
Definition at line 34 of file KineGeneratorWithCache.cxx.
|
protected |
Definition at line 40 of file KineGeneratorWithCache.cxx.
|
protected |
Definition at line 46 of file KineGeneratorWithCache.cxx.
|
protected |
Definition at line 52 of file KineGeneratorWithCache.cxx.
|
protectedvirtual |
Definition at line 224 of file KineGeneratorWithCache.cxx.
References genie::Cache::AddCacheBranch(), genie::Interaction::AsString(), genie::Cache::CacheBranchKey(), genie::Cache::FindCacheBranch(), genie::Algorithm::Id(), genie::Cache::Instance(), genie::AlgId::Key(), LOG, and pINFO.
Referenced by CacheMaxXSec(), and FindMaxXSec().
|
protectedvirtual |
Definition at line 252 of file KineGeneratorWithCache.cxx.
References fMaxXSecDiffTolerance, LOG, pERROR, pFATAL, and pWARN.
Referenced by genie::COHKinematicsGenerator::CalculateKin_AlvarezRuso(), genie::SKKinematicsGenerator::CalculateKin_AtharSingleKaon(), genie::COHKinematicsGenerator::CalculateKin_ReinSehgal(), genie::HELeptonKinematicsGenerator::ProcessEventRecord(), genie::DFRKinematicsGenerator::ProcessEventRecord(), genie::NuEKinematicsGenerator::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::DMEKinematicsGenerator::ProcessEventRecord(), genie::RESKinematicsGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::DISKinematicsGenerator::ProcessEventRecord(), genie::HEDISKinematicsGenerator::ProcessEventRecord(), genie::DMELEventGenerator::ProcessEventRecord(), genie::DMDISKinematicsGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::SPPEventGenerator::ProcessEventRecord(), genie::QELEventGeneratorSuSA::SelectLeptonKinematics(), genie::QELKinematicsGenerator::SpectralFuncExperimentalCode(), and genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode().
|
protectedvirtual |
Definition at line 190 of file KineGeneratorWithCache.cxx.
References AccessCacheBranch(), genie::CacheBranchFx::AddValues(), genie::CacheBranchFx::CreateSpline(), Energy(), fEMin, fNumOfInterpolatorTypes, LOG, genie::CacheBranchFx::Map(), pINFO, genie::CacheBranchFx::Spl(), vInterpolatorTypes, and genie::Spline::XMax().
Referenced by MaxXSec().
|
protectedpure virtual |
Implemented in genie::QELEventGeneratorSM, genie::SPPEventGenerator, genie::COHKinematicsGenerator, genie::DMELEventGenerator, genie::QELEventGeneratorSuSA, genie::DMDISKinematicsGenerator, genie::DMELKinematicsGenerator, genie::QELEventGenerator, genie::SKKinematicsGenerator, genie::DMEKinematicsGenerator, genie::DISKinematicsGenerator, genie::IBDKinematicsGenerator, genie::NuEKinematicsGenerator, genie::QELKinematicsGenerator, genie::HELeptonKinematicsGenerator, genie::RESKinematicsGenerator, genie::DFRKinematicsGenerator, and genie::HEDISKinematicsGenerator.
Referenced by ComputeMaxXSec(), and MaxXSec().
|
protectedvirtual |
Reimplemented in genie::QELEventGeneratorSM.
Definition at line 283 of file KineGeneratorWithCache.cxx.
References ComputeMaxXSec().
|
protectedvirtual |
Reimplemented in genie::COHKinematicsGenerator, genie::SKKinematicsGenerator, genie::DMEKinematicsGenerator, genie::NuEKinematicsGenerator, and genie::HELeptonKinematicsGenerator.
Definition at line 213 of file KineGeneratorWithCache.cxx.
References genie::Interaction::InitState(), genie::kRfHitNucRest, and genie::InitialState::ProbeE().
Referenced by CacheMaxXSec(), and FindMaxXSec().
|
protectedvirtual |
Definition at line 105 of file KineGeneratorWithCache.cxx.
References AccessCacheBranch(), Energy(), genie::Spline::Evaluate(), fEMin, LOG, genie::CacheBranchFx::Map(), pINFO, genie::CacheBranchFx::Spl(), genie::Spline::XMax(), and genie::Spline::XMin().
Referenced by MaxXSec().
|
protectedvirtual |
Definition at line 57 of file KineGeneratorWithCache.cxx.
References CacheMaxXSec(), ComputeMaxXSec(), genie::GHepRecord::EventFlags(), FindMaxXSec(), fNumOfSafetyFactors, genie::kISkipKinematicChk, genie::kISkipProcessChk, genie::kKineGenErr, genie::kPSNull, LOG, pINFO, pNOTICE, genie::GHepRecord::SetDiffXSec(), genie::exceptions::EVGThreadException::SetReason(), genie::GHepRecord::Summary(), genie::exceptions::EVGThreadException::SwitchOnFastForward(), and vSafetyFactors.
Referenced by genie::COHKinematicsGenerator::CalculateKin_AlvarezRuso(), genie::SKKinematicsGenerator::CalculateKin_AtharSingleKaon(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgal(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgalFM(), genie::COHKinematicsGenerator::CalculateKin_ReinSehgal(), genie::HELeptonKinematicsGenerator::ProcessEventRecord(), genie::DFRKinematicsGenerator::ProcessEventRecord(), genie::NuEKinematicsGenerator::ProcessEventRecord(), genie::DMEKinematicsGenerator::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::RESKinematicsGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::DISKinematicsGenerator::ProcessEventRecord(), genie::DMELEventGenerator::ProcessEventRecord(), genie::DMDISKinematicsGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::SPPEventGenerator::ProcessEventRecord(), genie::QELEventGeneratorSuSA::SelectLeptonKinematics(), genie::QELKinematicsGenerator::SpectralFuncExperimentalCode(), and genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode().
|
protected |
min E for which maxxsec is cached - forcing explicit calc.
Definition at line 76 of file KineGeneratorWithCache.h.
Referenced by CacheMaxXSec(), FindMaxXSec(), genie::DFRKinematicsGenerator::LoadConfig(), genie::RESKinematicsGenerator::LoadConfig(), genie::SKKinematicsGenerator::LoadConfig(), genie::NuEKinematicsGenerator::LoadConfig(), genie::COHKinematicsGenerator::LoadConfig(), genie::DMEKinematicsGenerator::LoadConfig(), genie::IBDKinematicsGenerator::LoadConfig(), genie::QELKinematicsGenerator::LoadConfig(), genie::DISKinematicsGenerator::LoadConfig(), genie::QELEventGeneratorSuSA::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::DMELKinematicsGenerator::LoadConfig(), genie::DMDISKinematicsGenerator::LoadConfig(), genie::DMELEventGenerator::LoadConfig(), genie::QELEventGeneratorSM::LoadConfig(), and genie::SPPEventGenerator::LoadConfig().
|
protected |
uniform over allowed phase space + event weight?
Definition at line 77 of file KineGeneratorWithCache.h.
Referenced by genie::COHKinematicsGenerator::CalculateKin_AlvarezRuso(), genie::SKKinematicsGenerator::CalculateKin_AtharSingleKaon(), genie::COHKinematicsGenerator::CalculateKin_ReinSehgal(), genie::DFRKinematicsGenerator::LoadConfig(), genie::NuEKinematicsGenerator::LoadConfig(), genie::SKKinematicsGenerator::LoadConfig(), genie::RESKinematicsGenerator::LoadConfig(), genie::COHKinematicsGenerator::LoadConfig(), genie::DMEKinematicsGenerator::LoadConfig(), genie::IBDKinematicsGenerator::LoadConfig(), genie::QELKinematicsGenerator::LoadConfig(), genie::DISKinematicsGenerator::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::QELEventGeneratorSuSA::LoadConfig(), genie::DMELKinematicsGenerator::LoadConfig(), genie::DMDISKinematicsGenerator::LoadConfig(), genie::DMELEventGenerator::LoadConfig(), genie::SPPEventGenerator::LoadConfig(), genie::QELEventGeneratorSM::LoadConfig(), genie::HELeptonKinematicsGenerator::ProcessEventRecord(), genie::NuEKinematicsGenerator::ProcessEventRecord(), genie::DFRKinematicsGenerator::ProcessEventRecord(), genie::SKKinematicsGenerator::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::DMEKinematicsGenerator::ProcessEventRecord(), genie::RESKinematicsGenerator::ProcessEventRecord(), genie::COHKinematicsGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::DISKinematicsGenerator::ProcessEventRecord(), genie::DMELEventGenerator::ProcessEventRecord(), genie::DMDISKinematicsGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), and genie::SPPEventGenerator::ProcessEventRecord().
|
protected |
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
Definition at line 75 of file KineGeneratorWithCache.h.
Referenced by AssertXSecLimits(), genie::DFRKinematicsGenerator::LoadConfig(), genie::HELeptonKinematicsGenerator::LoadConfig(), genie::RESKinematicsGenerator::LoadConfig(), genie::SKKinematicsGenerator::LoadConfig(), genie::NuEKinematicsGenerator::LoadConfig(), genie::COHKinematicsGenerator::LoadConfig(), genie::DMEKinematicsGenerator::LoadConfig(), genie::QELKinematicsGenerator::LoadConfig(), genie::IBDKinematicsGenerator::LoadConfig(), genie::DISKinematicsGenerator::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::QELEventGeneratorSuSA::LoadConfig(), genie::DMELKinematicsGenerator::LoadConfig(), genie::DMDISKinematicsGenerator::LoadConfig(), genie::HEDISKinematicsGenerator::LoadConfig(), genie::DMELEventGenerator::LoadConfig(), genie::QELEventGeneratorSM::LoadConfig(), and genie::SPPEventGenerator::LoadConfig().
|
protected |
Number of given interpolators types.
Definition at line 74 of file KineGeneratorWithCache.h.
Referenced by CacheMaxXSec(), and genie::QELEventGeneratorSM::LoadConfig().
|
protected |
Number of given safety factors.
Definition at line 72 of file KineGeneratorWithCache.h.
Referenced by genie::QELEventGeneratorSM::LoadConfig(), and MaxXSec().
|
protected |
ComputeMaxXSec -> ComputeMaxXSec * fSafetyFactor.
Definition at line 70 of file KineGeneratorWithCache.h.
Referenced by genie::RESKinematicsGenerator::ComputeMaxXSec(), genie::HELeptonKinematicsGenerator::ComputeMaxXSec(), genie::IBDKinematicsGenerator::ComputeMaxXSec(), genie::NuEKinematicsGenerator::ComputeMaxXSec(), genie::QELKinematicsGenerator::ComputeMaxXSec(), genie::DMEKinematicsGenerator::ComputeMaxXSec(), genie::QELEventGenerator::ComputeMaxXSec(), genie::SKKinematicsGenerator::ComputeMaxXSec(), genie::DMELKinematicsGenerator::ComputeMaxXSec(), genie::QELEventGeneratorSuSA::ComputeMaxXSec(), genie::DMELEventGenerator::ComputeMaxXSec(), genie::COHKinematicsGenerator::ComputeMaxXSec(), genie::SPPEventGenerator::ComputeMaxXSec(), genie::DFRKinematicsGenerator::LoadConfig(), genie::HELeptonKinematicsGenerator::LoadConfig(), genie::NuEKinematicsGenerator::LoadConfig(), genie::RESKinematicsGenerator::LoadConfig(), genie::SKKinematicsGenerator::LoadConfig(), genie::DMEKinematicsGenerator::LoadConfig(), genie::COHKinematicsGenerator::LoadConfig(), genie::IBDKinematicsGenerator::LoadConfig(), genie::QELKinematicsGenerator::LoadConfig(), genie::DISKinematicsGenerator::LoadConfig(), genie::QELEventGenerator::LoadConfig(), genie::QELEventGeneratorSuSA::LoadConfig(), genie::DMELKinematicsGenerator::LoadConfig(), genie::DMDISKinematicsGenerator::LoadConfig(), genie::HEDISKinematicsGenerator::LoadConfig(), genie::DMELEventGenerator::LoadConfig(), genie::SPPEventGenerator::LoadConfig(), genie::COHKinematicsGenerator::MaxXSec_AlvarezRuso(), and genie::HEDISKinematicsGenerator::ProcessEventRecord().
|
mutableprotected |
Definition at line 68 of file KineGeneratorWithCache.h.
Referenced by genie::COHKinematicsGenerator::CalculateKin_AlvarezRuso(), genie::SKKinematicsGenerator::CalculateKin_AtharSingleKaon(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgal(), genie::COHKinematicsGenerator::CalculateKin_BergerSehgalFM(), genie::COHKinematicsGenerator::CalculateKin_ReinSehgal(), genie::DFRKinematicsGenerator::ComputeMaxXSec(), genie::RESKinematicsGenerator::ComputeMaxXSec(), genie::HELeptonKinematicsGenerator::ComputeMaxXSec(), genie::QELKinematicsGenerator::ComputeMaxXSec(), genie::IBDKinematicsGenerator::ComputeMaxXSec(), genie::NuEKinematicsGenerator::ComputeMaxXSec(), genie::DMEKinematicsGenerator::ComputeMaxXSec(), genie::DISKinematicsGenerator::ComputeMaxXSec(), genie::QELEventGenerator::ComputeMaxXSec(), genie::SKKinematicsGenerator::ComputeMaxXSec(), genie::DMELKinematicsGenerator::ComputeMaxXSec(), genie::DMDISKinematicsGenerator::ComputeMaxXSec(), genie::QELEventGeneratorSuSA::ComputeMaxXSec(), genie::DMELEventGenerator::ComputeMaxXSec(), genie::COHKinematicsGenerator::ComputeMaxXSec(), genie::QELEventGeneratorSM::ComputeMaxXSec(), genie::SPPEventGenerator::ComputeMaxXSec(), genie::COHKinematicsGenerator::MaxXSec_AlvarezRuso(), genie::COHKinematicsGenerator::MaxXSec_BergerSehgal(), genie::COHKinematicsGenerator::MaxXSec_BergerSehgalFM(), genie::COHKinematicsGenerator::MaxXSec_ReinSehgal(), genie::HELeptonKinematicsGenerator::ProcessEventRecord(), genie::DFRKinematicsGenerator::ProcessEventRecord(), genie::NuEKinematicsGenerator::ProcessEventRecord(), genie::SKKinematicsGenerator::ProcessEventRecord(), genie::DMEKinematicsGenerator::ProcessEventRecord(), genie::QELKinematicsGenerator::ProcessEventRecord(), genie::RESKinematicsGenerator::ProcessEventRecord(), genie::COHKinematicsGenerator::ProcessEventRecord(), genie::QELEventGenerator::ProcessEventRecord(), genie::DMELKinematicsGenerator::ProcessEventRecord(), genie::IBDKinematicsGenerator::ProcessEventRecord(), genie::QELEventGeneratorSuSA::ProcessEventRecord(), genie::DISKinematicsGenerator::ProcessEventRecord(), genie::HEDISKinematicsGenerator::ProcessEventRecord(), genie::DMELEventGenerator::ProcessEventRecord(), genie::DMDISKinematicsGenerator::ProcessEventRecord(), genie::QELEventGeneratorSM::ProcessEventRecord(), genie::SPPEventGenerator::ProcessEventRecord(), genie::HEDISKinematicsGenerator::Scan(), genie::QELEventGeneratorSuSA::SelectLeptonKinematics(), genie::QELKinematicsGenerator::SpectralFuncExperimentalCode(), and genie::DMELKinematicsGenerator::SpectralFuncExperimentalCode().
|
protected |
Type of interpolator for each key in a branch.
Definition at line 73 of file KineGeneratorWithCache.h.
Referenced by CacheMaxXSec(), and genie::QELEventGeneratorSM::LoadConfig().
|
protected |
MaxXSec -> MaxXSec * fSafetyFactors[nkey].
Definition at line 71 of file KineGeneratorWithCache.h.
Referenced by genie::QELEventGeneratorSM::LoadConfig(), and MaxXSec().