GENIEGenerator
Loading...
Searching...
No Matches
KineGeneratorWithCache.h
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3
4\class genie::KineGeneratorWithCache
5
6\brief Abstract class. Provides a data caching mechanism for for concrete
7 implementations of the EventRecordVisitorI interface, generating
8 kinematics and wishing to cache maximum differential xsecs.
9
10 This class provides some common implementation for handling
11 (retrieving, creating, searching, adding to) the cache.
12 The various super-classes should implement the ComputeMaxXSec(...)
13 method for computing the maximum xsec in case it has not already
14 being pushed into the cache at a previous iteration. \n
15
16 Update May 15, 2022 IK:
17 It makes possible to cache several values having different keys.
18 The example of using this opportunity see in
19 the class QELEventGeneratorSM.
20
21\author Costas Andreopoulos <c.andreopoulos \at cern.ch>
22 University of Liverpool \n
23 Igor Kakorin <kakorin@jinr.ru>
24 Joint Institute for Nuclear Research
25
26\created December 15, 2004
27
28\cpright Copyright (c) 2003-2025, The GENIE Collaboration
29 For the full text of the license visit http://copyright.genie-mc.org
30*/
31//____________________________________________________________________________
32
33#ifndef _KINE_GENERATOR_WITH_CACHE_H_
34#define _KINE_GENERATOR_WITH_CACHE_H_
35
36#include <string>
37
41
42using std::string;
43
44namespace genie {
45
46class CacheBranchFx;
47class XSecAlgorithmI;
48
50
51protected:
53 KineGeneratorWithCache(string name);
54 KineGeneratorWithCache(string name, string config);
56
57 virtual double ComputeMaxXSec (const Interaction * in) const = 0;
58 virtual double ComputeMaxXSec (const Interaction * in, const int nkey) const;
59 virtual double MaxXSec (GHepRecord * evrec, const int nkey=0) const;
60 virtual double FindMaxXSec (const Interaction * in, const int nkey=0) const;
61 virtual void CacheMaxXSec (const Interaction * in, double xsec, const int nkey=0) const;
62 virtual double Energy (const Interaction * in) const;
63
64 virtual CacheBranchFx * AccessCacheBranch (const Interaction * in, const int nkey=0) const;
65
66 virtual void AssertXSecLimits (const Interaction * in, double xsec, double xsec_max) const;
67
68 mutable const XSecAlgorithmI * fXSecModel;
69
70 double fSafetyFactor; ///< ComputeMaxXSec -> ComputeMaxXSec * fSafetyFactor
71 std::vector<double> vSafetyFactors; ///< MaxXSec -> MaxXSec * fSafetyFactors[nkey]
72 int fNumOfSafetyFactors; ///< Number of given safety factors
73 std::vector<string> vInterpolatorTypes; ///< Type of interpolator for each key in a branch
74 int fNumOfInterpolatorTypes; ///< Number of given interpolators types
75 double fMaxXSecDiffTolerance; ///< max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
76 double fEMin; ///< min E for which maxxsec is cached - forcing explicit calc.
77 bool fGenerateUniformly; ///< uniform over allowed phase space + event weight?
78};
79
80} // genie namespace
81
82#endif // _KINE_GENERATOR_WITH_CACHE_H_
A simple cache branch storing the cached data in a TNtuple.
GENIE's GHEP MC event record.
Definition GHepRecord.h:45
Summary information for an interaction.
Definition Interaction.h:56
virtual void AssertXSecLimits(const Interaction *in, double xsec, double xsec_max) const
std::vector< string > vInterpolatorTypes
Type of interpolator for each key in a branch.
std::vector< double > vSafetyFactors
MaxXSec -> MaxXSec * fSafetyFactors[nkey].
virtual double FindMaxXSec(const Interaction *in, const int nkey=0) const
bool fGenerateUniformly
uniform over allowed phase space + event weight?
virtual void CacheMaxXSec(const Interaction *in, double xsec, const int nkey=0) const
double fMaxXSecDiffTolerance
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
virtual double ComputeMaxXSec(const Interaction *in) const =0
double fEMin
min E for which maxxsec is cached - forcing explicit calc.
double fSafetyFactor
ComputeMaxXSec -> ComputeMaxXSec * fSafetyFactor.
int fNumOfInterpolatorTypes
Number of given interpolators types.
virtual double Energy(const Interaction *in) const
int fNumOfSafetyFactors
Number of given safety factors.
virtual double MaxXSec(GHepRecord *evrec, const int nkey=0) const
virtual CacheBranchFx * AccessCacheBranch(const Interaction *in, const int nkey=0) const
Cross Section Calculation Interface.
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25