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 <constantinos.andreopoulos \at cern.ch>
17  University of Liverpool & STFC Rutherford Appleton Laboratory
18 
19 \created December 15, 2004
20 
21 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
22  For the full text of the license visit http://copyright.genie-mc.org
23 */
24 //____________________________________________________________________________
25 
26 #ifndef _KINE_GENERATOR_WITH_CACHE_H_
27 #define _KINE_GENERATOR_WITH_CACHE_H_
28 
29 #include <string>
30 
33 #include "Framework/Utils/Range1.h"
34 
35 using std::string;
36 
37 namespace genie {
38 
39 class CacheBranchFx;
40 class XSecAlgorithmI;
41 
43 
44 protected:
47  KineGeneratorWithCache(string name, string config);
49 
50  virtual double ComputeMaxXSec (const Interaction * in) const = 0;
51  virtual double MaxXSec (GHepRecord * evrec) const;
52  virtual double FindMaxXSec (const Interaction * in) const;
53  virtual void CacheMaxXSec (const Interaction * in, double xsec) const;
54  virtual double Energy (const Interaction * in) const;
55 
56  virtual CacheBranchFx * AccessCacheBranch (const Interaction * in) const;
57 
58  virtual void AssertXSecLimits (const Interaction * in, double xsec, double xsec_max) const;
59 
60  mutable const XSecAlgorithmI * fXSecModel;
61 
62  double fSafetyFactor; ///< maxxsec -> maxxsec * safety_factor
63  double fMaxXSecDiffTolerance; ///< max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
64  double fEMin; ///< min E for which maxxsec is cached - forcing explicit calc.
65  bool fGenerateUniformly; ///< uniform over allowed phase space + event weight?
66 };
67 
68 } // genie namespace
69 
70 #endif // _KINE_GENERATOR_WITH_CACHE_H_
static QCString name
Definition: declinfo.cpp:673
Cross Section Calculation Interface.
virtual double MaxXSec(GHepRecord *evrec) const
bool fGenerateUniformly
uniform over allowed phase space + event weight?
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
double fSafetyFactor
maxxsec -> maxxsec * safety_factor
std::string string
Definition: nybbler.cc:12
virtual void AssertXSecLimits(const Interaction *in, double xsec, double xsec_max) const
double fMaxXSecDiffTolerance
max{100*(xsec-maxxsec)/.5*(xsec+maxxsec)} if xsec>maxxsec
Abstract class. Provides a data caching mechanism for for concrete implementations of the EventRecord...
Summary information for an interaction.
Definition: Interaction.h:56
static Config * config
Definition: config.cpp:1054
virtual double ComputeMaxXSec(const Interaction *in) const =0
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:37
GENIE&#39;s GHEP MC event record.
Definition: GHepRecord.h:45
virtual double FindMaxXSec(const Interaction *in) const