GReWeightINukeParams.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::rew::GReWeightINukeParams
5 
6 \brief Helper class for cross section model reweighting
7 
8 \author Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
9  University of Liverpool & STFC Rutherford Appleton Lab
10 
11  Jim Dobson <J.Dobson07 \at imperial.ac.uk>
12  Imperial College London
13 
14 \created Sep 10, 2009
15 
16 \cpright Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration
17  For the full text of the license visit http://copyright.genie-mc.org
18  or see $GENIE/LICENSE
19 */
20 //____________________________________________________________________________
21 
22 #ifndef _G_REWEIGHT_INTRANUKE_PARAMS_H_
23 #define _G_REWEIGHT_INTRANUKE_PARAMS_H_
24 
25 #include <map>
26 
27 #include "PDG/PDGUtils.h"
28 #include "ReWeight/GSyst.h"
29 
30 using std::map;
31 
32 class TLorentzVector;
33 
34 namespace genie {
35 namespace rew {
36 
38 
39  public:
40 
41  typedef enum EHadronType {
45  } HadronType_t;
46 
47  static HadronType_t HadronTypeFromPdg(int pdgc) {
48  if(pdg::IsPion (pdgc)) return kRwINukePion;
49  if(pdg::IsNucleon(pdgc)) return kRwINukeNucl;
50  return kRwINukeUndefined;
51  }
52 
55 
56  class Fates;
57  class MFP;
58 
59  Fates * FateParams (int pdgc) const; ///<
60  MFP * MeanFreePathParams (int pdgc) const; ///<
61  void Reset (void); ///<
62  void Reconfigure (void); ///<
63  double ChisqPenalty (void) const; ///<
64  void SetTwkDial (GSyst_t s, double val); ///<
65 
66  //.........................................................................
67  //
68  // nested class: Fates
69  //
70  //.........................................................................
71 
72  class Fates {
73  public :
74  Fates(HadronType_t hadtype = kRwINukeUndefined);
75  ~Fates();
76 
77  double ScaleFactor (GSyst_t s, const TLorentzVector & p4) const; ///< see next
78  double ScaleFactor (GSyst_t s, double KE=-1.) const; ///< fate fraction scale factor = 1 + twk_dial * fractional_err
79  bool IsIncluded (GSyst_t s) const; ///< is included?
80  bool IsCushionTerm (GSyst_t s) const; ///< is it a cushion term?
81  bool IsTweaked (GSyst_t s) const; ///< is included & tweaked to non-def value?
82  bool IsTweaked (void) const; ///< is any param tweaked
83  void Reset (void); ///<
84  void Reconfigure (void); ///<
85  double ChisqPenalty (void) const; ///<
86  void SetTwkDial (GSyst_t s, double val); ///<
87 
88  private:
89 
90  bool IsHandled (GSyst_t s) const;
91  void AddCushionTerms (void);
92  double ActualTwkDial (GSyst_t s, double KE=-1.) const; ///< actual tweaking dial for input systematic at input kinetic energy
93 
94  HadronType_t fHadType; ///<
95  map<GSyst_t, double> fSystValuesUser; ///< List of systematics included & values set by the user
96  mutable
97  map<GSyst_t, double> fSystValuesActual; ///< List of systematics included & values actually used (user values limited to physical range)
98  map<GSyst_t, bool> fIsCushion; ///< cushion term flag
99 
100  }; // Fates nested class
101 
102 
103  //.........................................................................
104  //
105  // nested class: MFP
106  //
107  //.........................................................................
108 
109  class MFP {
110  public :
111  MFP(HadronType_t hadtype = kRwINukeUndefined);
112  ~MFP();
113 
114  double ScaleFactor (void) const; ///< mean free path scale factor = 1 + twk_dial * fractional_err
115  double TwkDial (void) const; ///< current value of mfp tweak dial
116  bool IsIncluded (void) const; ///<
117  bool IsTweaked (void) const; ///<
118  double ChisqPenalty (void) const; ///<
119  void Reset (void); ///<
120  void SetTwkDial (double val); ///<
121 
122  private:
123  HadronType_t fHadType; ///<
125  double fTwkDial; ///<
126  bool fIsIncluded; ///<
127 
128  }; // MFP nested class
129 
130 
131  private:
132 
133  void Init(void);
134 
139 
140  }; //GReWeightINukeParams
141 
142 } // rew namespace
143 } // genie namespace
144 
145 #endif // _G_REWEIGHT_INTRANUKE_PARAMS_H_
146 
147 
bool IsPion(int pdgc)
Definition: PDGUtils.cxx:296
bool IsTweaked(void) const
is any param tweaked
#include "Numerical/GSFunc.h"
Definition: AlgCmp.h:26
MFP * MeanFreePathParams(int pdgc) const
bool IsNucleon(int pdgc)
Definition: PDGUtils.cxx:316
Helper class for cross section model reweighting.
static HadronType_t HadronTypeFromPdg(int pdgc)
bool IsCushionTerm(GSyst_t s) const
is it a cushion term?
void SetTwkDial(GSyst_t s, double val)
map< GSyst_t, double > fSystValuesActual
List of systematics included & values actually used (user values limited to physical range) ...
bool IsIncluded(GSyst_t s) const
is included?
An enumeration of systematic parameters.
map< GSyst_t, bool > fIsCushion
cushion term flag
map< GSyst_t, double > fSystValuesUser
List of systematics included & values set by the user.
Fates(HadronType_t hadtype=kRwINukeUndefined)
double ScaleFactor(GSyst_t s, const TLorentzVector &p4) const
see next
static const double s
Definition: Units.h:99
enum genie::rew::GReWeightINukeParams::EHadronType HadronType_t
double ActualTwkDial(GSyst_t s, double KE=-1.) const
actual tweaking dial for input systematic at input kinetic energy