XSecSysts.cxx
Go to the documentation of this file.
3 
4 #include "NOvARwgt/rwgt/genie/GenieSystKnob.h"
5 #include "NOvARwgt/rwgt/generic/NueNumuSysts.h"
6 #include "NOvARwgt/rwgt/genie/COH/COHSysts.h"
7 #include "NOvARwgt/rwgt/genie/QE/MAQESysts.h"
8 #include "NOvARwgt/rwgt/genie/QE/NucOptPtlSysts.h"
9 #include "NOvARwgt/rwgt/genie/QE/ZExpSysts.h"
10 
11 #include "nugen/NuReweight/ReweightLabels.h"
12 
15 
16 #include <list>
17 
18 namespace ana
19 {
20  // ------------------------------------------------------------------------------------------
21 
22  void NOvARwgtSyst::TruthShift(double sigma, caf::SRNeutrinoProxy* nu, double& weight) const
23  {
24  // ConvertSRTruth() caches internally
25  weight *= fNOvARwgtKnob->GetWeight(sigma, novarwgt::ConvertSRTruth(nu));
26  }
27 
28  // ------------------------------------------------------------------------------------------
29 
30  // list of enumerations from rwgt::ReweightLabels because iterating over an
31  // enumerated list is not allowed with gcc 6
32  // This should really go into nugen/NuReweight/ReweightLabels.h at some point
33  namespace
34  {
35  const std::list<rwgt::ReweightLabel_t>& ReweightLabels()
36  {
37  static std::list<rwgt::ReweightLabel_t> labels
38  {
39  rwgt::fReweightMaNCEL,
40  rwgt::fReweightEtaNCEL,
41  rwgt::fReweightNormCCQE,
42  rwgt::fReweightNormCCQEenu,
43  rwgt::fReweightMaCCQEshape,
44  rwgt::fReweightMaCCQE,
45  rwgt::fReweightVecCCQEshape,
46  rwgt::fReweightNormCCRES,
47  rwgt::fReweightMaCCRESshape,
48  rwgt::fReweightMvCCRESshape,
49  rwgt::fReweightMaCCRES,
50  rwgt::fReweightMvCCRES,
51  rwgt::fReweightNormNCRES,
52  rwgt::fReweightMaNCRESshape,
53  rwgt::fReweightMvNCRESshape,
54  rwgt::fReweightMaNCRES,
55  rwgt::fReweightMvNCRES,
56  rwgt::fReweightMaCOHpi,
57  rwgt::fReweightR0COHpi,
58  rwgt::fReweightRvpCC1pi,
59  rwgt::fReweightRvpCC2pi,
60  rwgt::fReweightRvpNC1pi,
61  rwgt::fReweightRvpNC2pi,
62  rwgt::fReweightRvnCC1pi,
63  rwgt::fReweightRvnCC2pi,
64  rwgt::fReweightRvnNC1pi,
65  rwgt::fReweightRvnNC2pi,
66  rwgt::fReweightRvbarpCC1pi,
67  rwgt::fReweightRvbarpCC2pi,
68  rwgt::fReweightRvbarpNC1pi,
69  rwgt::fReweightRvbarpNC2pi,
70  rwgt::fReweightRvbarnCC1pi,
71  rwgt::fReweightRvbarnCC2pi,
72  rwgt::fReweightRvbarnNC1pi,
73  rwgt::fReweightRvbarnNC2pi,
74  rwgt::fReweightAhtBY,
75  rwgt::fReweightBhtBY,
76  rwgt::fReweightCV1uBY,
77  rwgt::fReweightCV2uBY,
78  rwgt::fReweightAhtBYshape,
79  rwgt::fReweightBhtBYshape,
80  rwgt::fReweightCV1uBYshape,
81  rwgt::fReweightCV2uBYshape,
82  rwgt::fReweightNormDISCC,
83  rwgt::fReweightRnubarnuCC,
84  rwgt::fReweightDISNuclMod,
85  rwgt::fReweightNC,
86  rwgt::fReweightAGKY_xF1pi,
87  rwgt::fReweightAGKY_pT1pi,
88  rwgt::fReweightFormZone,
89  rwgt::fReweightMFP_pi,
90  rwgt::fReweightMFP_N,
91  rwgt::fReweightFrCEx_pi,
92  //rwgt::fReweightFrElas_pi,
93  rwgt::fReweightFrInel_pi,
94  rwgt::fReweightFrAbs_pi,
95  rwgt::fReweightFrPiProd_pi,
96  rwgt::fReweightFrCEx_N,
97  //rwgt::fReweightFrElas_N,
98  rwgt::fReweightFrInel_N,
99  rwgt::fReweightFrAbs_N,
100  rwgt::fReweightFrPiProd_N,
101  rwgt::fReweightCCQEPauliSupViaKF,
102  rwgt::fReweightCCQEMomDistroFGtoSF,
103  rwgt::fReweightBR1gamma,
104  rwgt::fReweightBR1eta,
105  rwgt::fReweightTheta_Delta2Npi,
106  rwgt::fReweightZNormCCQE,
107  rwgt::fReweightZExpA1CCQE,
108  rwgt::fReweightZExpA2CCQE,
109  rwgt::fReweightZExpA3CCQE,
110  rwgt::fReweightZExpA4CCQE,
111  rwgt::fReweightAxFFCCQEshape
112  };
113  return labels;
114  }
115  }
116 
117  // ------------------------------------------------------------------------------------------
118 
119  const NOvARwgtSyst * GetGenieKnobSyst(rwgt::ReweightLabel_t knobIdx, std::string altName, std::string altLabel)
120  {
121  // have to use a map rather than a vector because of the GENIE 2->3 change of available knob labels
122  // (we might wind up skipping indices)
123  static std::unordered_map<std::size_t, std::unique_ptr<NOvARwgtSyst>> systs;
124  if (systs.empty())
125  {
126  for (auto itr : ReweightLabels())
127  systs.emplace(itr,
128  std::make_unique<NOvARwgtSyst>(
129  (!altName.empty()) ? altName : genie::rew::GSyst::AsString(genie::rew::EGSyst(itr)),
130  (!altLabel.empty()) ? altLabel : genie::rew::GSyst::AsString(genie::rew::EGSyst(itr)),
131  novarwgt::GetGenieSystKnob(novarwgt::kNugenKnobTranslationTable.at(itr)))
132  );
133  }
134  return systs.at(knobIdx).get();
135  }
136 
137 
138 
139  // ------------------------------------------------------------------------------------------
140 
141  // 2018 COH
142  const NOvARwgtSyst kCOHCCScaleSyst2018("COHCCScale2018", "Coherent CC Scale", novarwgt::kCOHNormCCSystKnob); // CC version
143  const NOvARwgtSyst kCOHNCScaleSyst2018("COHNCScale2018", "Coherent NC Scale", novarwgt::kCOHNormNCSystKnob);
144 
145  // ------------------------------------------------------------------------------------------
146 
147  // 2017 modifications to GENIE knobs: MA CCQE
148  const NOvARwgtSyst kMAQEGenieReducedSyst2017(genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE)) + + "_reduced",
149  genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE)) + + "_reduced",
151 
152  // 2018 modifications to GENIE knobs: MA CCQE
153  const NOvARwgtSyst kMAQEGenieReducedSyst2018(genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE)) + + "_reduced_2018",
154  genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE)) + + "_reduced_2018",
156 
157  // ------------------------------------------------------------------------------------------
158  // 2020 custom z-expansion correlated systs
159  const NOvARwgtSyst kZExpEV1Syst2020("ZExpAxialFFSyst2020_EV1", "CCQE z-exp EV shift #1",novarwgt::kZExpEV1Syst2020);
160  const NOvARwgtSyst kZExpEV2Syst2020("ZExpAxialFFSyst2020_EV2", "CCQE z-exp EV shift #2", novarwgt::kZExpEV2Syst2020);
161  const NOvARwgtSyst kZExpEV3Syst2020("ZExpAxialFFSyst2020_EV3", "CCQE z-exp EV shift #3", novarwgt::kZExpEV3Syst2020);
162  const NOvARwgtSyst kZExpEV4Syst2020("ZExpAxialFFSyst2020_EV4", "CCQE z-exp EV shift #4", novarwgt::kZExpEV4Syst2020);
163 
164 
165  // ------------------------------------------------------------------------------------------
166  // nue/numu difference systs from T2K
167  const NOvARwgtSyst kRadCorrNue("radcorrnue", "Radiative corrections for #nu_{e}",
169  const NOvARwgtSyst kRadCorrNuebar("radcorrnuebar", "Radiative corrections for #bar{#nu}_{e}",
171  const NOvARwgtSyst k2ndClassCurrs("2ndclasscurr", "Second class currents",
173 
174  // ------------------------------------------------------------------------------------------
175 
176  //Nuclear Optical Potential Systs from Removal Energy
177  const NOvARwgtSyst kNucOptPtlSyst("nucoptptl","Nuclear Optical Potential for #nu_{#mu}",novarwgt::kNucOptPtl_Syst);
178 
179 }
const novarwgt::ISystKnob * fNOvARwgtKnob
Definition: XSecSysts.h:30
const MAQEGenieReducedSyst2017 * kMAQEGenieReducedSyst2017
Definition: MAQESysts.cxx:18
const MAQEGenieReducedSyst2018 * kMAQEGenieReducedSyst2018
Definition: MAQESysts.cxx:19
const NOvARwgtSyst kZExpEV2Syst2020("ZExpAxialFFSyst2020_EV2","CCQE z-exp EV shift #2", novarwgt::kZExpEV2Syst2020)
Definition: XSecSysts.h:57
const NOvARwgtSyst k2ndClassCurrs("2ndclasscurr","Second class currents", novarwgt::kSimpleSecondClassCurrentsSystKnob)
Second-class current syst. See documentation in NOvARwgt.
Definition: XSecSysts.h:71
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const COHNormSyst2018 * kCOHNormCCSystKnob
Definition: COHSysts.cxx:15
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
const Var weight
const NOvARwgtSyst kMAQEGenieReducedSyst2018(genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE))++"_reduced_2018", genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE))++"_reduced_2018", novarwgt::kMAQEGenieReducedSyst2018)
2018 &#39;reduced&#39; M_A^QE shift. See documentation in NOvARwgt
Definition: XSecSysts.h:51
const NOvARwgtSyst kMAQEGenieReducedSyst2017(genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE))++"_reduced", genie::rew::GSyst::AsString(genie::rew::EGSyst(rwgt::fReweightMaCCQE))++"_reduced", novarwgt::kMAQEGenieReducedSyst2017)
2017 &#39;reduced&#39; M_A^QE shift. See documentation in NOvARwgt.
Definition: XSecSysts.h:47
void TruthShift(double sigma, caf::SRNeutrinoProxy *nu, double &weight) const override
Definition: XSecSysts.cxx:22
const std::unordered_map< rwgt::ReweightLabel_t, novarwgt::ReweightKnob > kNugenKnobTranslationTable
const NOvARwgtSyst kNucOptPtlSyst("nucoptptl","Nuclear Optical Potential for #nu_{#mu}", novarwgt::kNucOptPtl_Syst)
Nuclear Optical Potential. See documentation in NOvARwgt.
Definition: XSecSysts.h:76
const NOvARwgtSyst kRadCorrNuebar("radcorrnuebar","Radiative corrections for #bar{#nu}_{e}", novarwgt::kSimpleRadiativeCorrNuebarXsecSystKnob)
Radiative corrections syst (nuebars). See documentation in NOvARwgt.
Definition: XSecSysts.h:67
const COHNormSyst2018 * kCOHNormNCSystKnob
Definition: COHSysts.cxx:16
const NOvARwgtSyst kZExpEV1Syst2020("ZExpAxialFFSyst2020_EV1","CCQE z-exp EV shift #1", novarwgt::kZExpEV1Syst2020)
Definition: XSecSysts.h:56
const ZExpAxialFFSyst2020 * kZExpEV2Syst2020
Definition: ZExpSysts.cxx:19
const SimpleSecondClassCurrentsSyst * kSimpleSecondClassCurrentsSystKnob
const NOvARwgtSyst kZExpEV4Syst2020("ZExpAxialFFSyst2020_EV4","CCQE z-exp EV shift #4", novarwgt::kZExpEV4Syst2020)
Definition: XSecSysts.h:59
const NOvARwgtSyst kCOHCCScaleSyst2018("COHCCScale2018","Coherent CC Scale", novarwgt::kCOHNormCCSystKnob)
20% uncertainty scale on coherent CC events. See documentation in NOvARwgt
Definition: XSecSysts.h:40
double sigma(TH1F *hist, double percentile)
const NOvARwgtSyst kZExpEV3Syst2020("ZExpAxialFFSyst2020_EV3","CCQE z-exp EV shift #3", novarwgt::kZExpEV3Syst2020)
Definition: XSecSysts.h:58
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const NOvARwgtSyst kCOHNCScaleSyst2018("COHNCScale2018","Coherent NC Scale", novarwgt::kCOHNormNCSystKnob)
20% uncertainty scale on coherent NC events. See documentation in NOvARwgt
Definition: XSecSysts.h:43
const ZExpAxialFFSyst2020 * kZExpEV1Syst2020
Definition: ZExpSysts.cxx:18
const char * AsString(Resonance_t res)
resonance id -> string
const novarwgt::EventRecord & ConvertSRTruth(const T *nu, bool forceNoCache)
Copy information out of an SRNeutrino.
const SimpleRadiativeCorrNueXSecSyst * kSimpleRadiativeCorrNuebarXsecSystKnob
const NOvARwgtSyst * GetGenieKnobSyst(rwgt::ReweightLabel_t knobIdx, std::string altName, std::string altLabel)
Convenience function to get a GENIE knob syst. (Allows using the GENIE knob name & description as the...
Definition: XSecSysts.cxx:119
const NOvARwgtSyst kRadCorrNue("radcorrnue","Radiative corrections for #nu_{e}", novarwgt::kSimpleRadiativeCorrNueXsecSystKnob)
Radiative corrections syst (nues). See documentation in NOvARwgt.
Definition: XSecSysts.h:64
const ZExpAxialFFSyst2020 * kZExpEV4Syst2020
Definition: ZExpSysts.cxx:21
const NucOptPtl_Syst * kNucOptPtl_Syst
const SimpleRadiativeCorrNueXSecSyst * kSimpleRadiativeCorrNueXsecSystKnob
Base class for systs actually implemented in NOvARwgt.
Definition: XSecSysts.h:17
const ZExpAxialFFSyst2020 * kZExpEV3Syst2020
Definition: ZExpSysts.cxx:20