GReWeightNuXSecCCQE.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::rew::GReWeightNuXSecCCQE
5 
6 \brief Reweighting CCQE GENIE neutrino cross sections
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 Aug 1, 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_NU_XSEC_CCQE_H_
23 #define _G_REWEIGHT_NU_XSEC_CCQE_H_
24 
25 //#define _G_REWEIGHT_CCQE_DEBUG_
26 
27 #include <map>
28 #include <string>
29 
30 #include "ReWeight/GReWeightI.h"
31 
32 using std::map;
33 using std::string;
34 
35 class TFile;
36 class TNtupleD;
37 
38 namespace genie {
39 
40 class XSecAlgorithmI;
41 class Registry;
42 
43 namespace rew {
44 
46  {
47  public:
48  static const int kModeMa = 0;
49  static const int kModeNormAndMaShape = 1;
50  static const int kModeZExp = 2;
51 
52  static const int fZExpMaxSyst = 4; ///< maximum number of systematics
53 
56 
57  // implement the GReWeightI interface
58  bool IsHandled (GSyst_t syst);
59  void SetSystematic (GSyst_t syst, double val);
60  void Reset (void);
61  void Reconfigure (void);
62  double CalcWeight (const EventRecord & event);
63 
64  // various config options
65  void SetMode (int mode) { fMode = mode; }
66  void RewNue (bool tf ) { fRewNue = tf; }
67  void RewNuebar (bool tf ) { fRewNuebar = tf; }
68  void RewNumu (bool tf ) { fRewNumu = tf; }
69  void RewNumubar (bool tf ) { fRewNumubar = tf; }
70  void SetMaPath (string p) { fMaPath = p; }
71  // z-expansion specific options
72  void SetZExpPath (string p){ fZExpPath = p; }
73 
74  private:
75 
76  void Init (void);
77  double CalcWeightNorm (const EventRecord & event);
78  double CalcWeightMaShape (const EventRecord & event);
79  double CalcWeightMa (const EventRecord & event);
80  double CalcWeightZExp (const EventRecord & event);
81 
82  XSecAlgorithmI * fXSecModelDef; ///< default model
83  XSecAlgorithmI * fXSecModel; ///< tweaked model
84  Registry * fXSecModelConfig; ///< config in tweaked model
85  string fFFModel;
86 
87  int fMode; ///< 0: Ma, 1: Norm and MaShape, 2: Z-Expansion
88  bool fRewNue; ///< reweight nu_e CC?
89  bool fRewNuebar; ///< reweight nu_e_bar CC?
90  bool fRewNumu; ///< reweight nu_mu CC?
91  bool fRewNumubar; ///< reweight nu_mu_bar CC?
92  string fMaPath; ///< M_{A} path in config Registry
93  double fNormTwkDial; ///<
94  double fNormDef; ///<
95  double fNormCurr; ///<
96  double fMaTwkDial; ///<
97  double fMaDef; ///<
98  double fMaCurr; ///<
99 
100  int fZExpCurrIdx; ///< current coefficient index
101  int fZExpMaxCoef; ///< max number of coefficients to use
102  string fZExpPath; ///< algorithm path to get coefficients
103  double fZExpTwkDial[fZExpMaxSyst]; ///<
104  double fZExpDef [fZExpMaxSyst]; ///<
105  double fZExpCurr [fZExpMaxSyst]; ///< array of current parameter values
106 
107 #ifdef _G_REWEIGHT_CCQE_DEBUG_
108  TFile * fTestFile;
109  TNtupleD * fTestNtp;
110 #endif
111  };
112 
113 } // rew namespace
114 } // genie namespace
115 
116 #endif
117 
Cross Section Calculation Interface.
bool fRewNuebar
reweight nu_e_bar CC?
#include "Numerical/GSFunc.h"
Definition: AlgCmp.h:26
std::string string
Definition: nybbler.cc:12
Reweighting CCQE GENIE neutrino cross sections.
int fZExpCurrIdx
current coefficient index
string fMaPath
M_{A} path in config Registry.
double CalcWeightZExp(const EventRecord &event)
double fZExpCurr[fZExpMaxSyst]
array of current parameter values
Definition: tf_graph.h:23
bool fRewNumubar
reweight nu_mu_bar CC?
XSecAlgorithmI * fXSecModelDef
default model
double CalcWeightMaShape(const EventRecord &event)
Registry * fXSecModelConfig
config in tweaked model
void SetSystematic(GSyst_t syst, double val)
update the value for the specified nuisance param
An enumeration of systematic parameters.
double CalcWeightMa(const EventRecord &event)
void Reconfigure(void)
propagate updated nuisance parameter values to actual MC, etc
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition: EventRecord.h:38
p
Definition: test.py:228
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
string fZExpPath
algorithm path to get coefficients
int fMode
0: Ma, 1: Norm and MaShape, 2: Z-Expansion
bool fRewNumu
reweight nu_mu CC?
XSecAlgorithmI * fXSecModel
tweaked model
int fZExpMaxCoef
max number of coefficients to use
double CalcWeight(const EventRecord &event)
calculate a weight for the input event using the current nuisance param values
double CalcWeightNorm(const EventRecord &event)
void Reset(void)
set all nuisance parameters to default values
Event finding and building.
static const int fZExpMaxSyst
maximum number of systematics
GENIE event reweighting engine ABC.
Definition: GReWeightI.h:31
bool IsHandled(GSyst_t syst)
does the current weight calculator handle the input nuisance param?