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.
15 
16 \author Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
17  University of Liverpool & STFC Rutherford Appleton Lab
18 
19 \created December 15, 2004
20 
21 \cpright Copyright (c) 2003-2019, The GENIE Collaboration
22  For the full text of the license visit http://copyright.genie-mc.org
23  or see $GENIE/LICENSE
24 */
25 //____________________________________________________________________________
26 
27 #ifndef _KINE_GENERATOR_WITH_CACHE_H_
28 #define _KINE_GENERATOR_WITH_CACHE_H_
29 
30 #include <string>
31 
34 #include "Framework/Utils/Range1.h"
35 
36 using std::string;
37 
38 namespace genie {
39 
40 class CacheBranchFx;
41 class XSecAlgorithmI;
42 
44 
45 protected:
48  KineGeneratorWithCache(string name, string config);
50 
51  virtual double ComputeMaxXSec (const Interaction * in) const = 0;
52  virtual double MaxXSec (GHepRecord * evrec) const;
53  virtual double FindMaxXSec (const Interaction * in) const;
54  virtual void CacheMaxXSec (const Interaction * in, double xsec) const;
55  virtual double Energy (const Interaction * in) const;
56 
57  virtual CacheBranchFx * AccessCacheBranch (const Interaction * in) const;
58 
59  virtual void AssertXSecLimits (const Interaction * in, double xsec, double xsec_max) const;
60 
61  mutable const XSecAlgorithmI * fXSecModel;
62 
63  double fSafetyFactor; ///< maxxsec -> maxxsec * safety_factor
64  double fMaxXSecDiffTolerance; ///< max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
65  double fEMin; ///< min E for which maxxsec is cached - forcing explicit calc.
66  bool fGenerateUniformly; ///< uniform over allowed phase space + event weight?
67 };
68 
69 } // genie namespace
70 
71 #endif // _KINE_GENERATOR_WITH_CACHE_H_
Cross Section Calculation Interface.
virtual double MaxXSec(GHepRecord *evrec) const
const XML_Char * name
Definition: expat.h:151
bool fGenerateUniformly
uniform over allowed phase space + event weight?
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
double fSafetyFactor
maxxsec -> maxxsec * safety_factor
virtual void AssertXSecLimits(const Interaction *in, double xsec, double xsec_max) const
double fMaxXSecDiffTolerance
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
Definition: config.py:1
Abstract class. Provides a data caching mechanism for for concrete implementations of the EventRecord...
Summary information for an interaction.
Definition: Interaction.h:56
virtual double ComputeMaxXSec(const Interaction *in) const =0
Double_t xsec[nknots]
Definition: testXsec.C:47
ifstream in
Definition: comparison.C:7
double fEMin
min E for which maxxsec is cached - forcing explicit calc.
virtual double Energy(const Interaction *in) const
virtual CacheBranchFx * AccessCacheBranch(const Interaction *in) const
virtual void CacheMaxXSec(const Interaction *in, double xsec) const
A simple cache branch storing the cached data in a TNtuple.
Definition: CacheBranchFx.h:38
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:46
virtual double FindMaxXSec(const Interaction *in) const
enum BeamMode string