JointAna2017Systs.cxx
Go to the documentation of this file.
3 #include "CAFAna/Systs/Systs.h"
10 #include "CAFAna/Systs/MECSysts.h"
11 #include "CAFAna/Systs/RPASysts.h"
12 
14 
15 #include "Utilities/func/MathUtil.h"
16 
17 #include <cmath>
18 #include <cassert>
19 
20 
21 namespace ana
22 {
24  {
25  std::string ret = "";
26  if(ana == kNueAna2017) ret = "Nue2017";
27  if(ana == kNumuAna2017) ret = "Numu2017";
28  if(ana == kJointAna2017) ret = "Joint2017";
29  return ret;
30  }
31 
32  std::vector<const ISyst *> getAna2017LargeXsecSysts(const EAnaType2017 ana)
33  {
34  std::vector<const ISyst *> ret =
35  {
41  GetGenieKnobSyst(rwgt::fReweightMaCCRES),
42  GetGenieKnobSyst(rwgt::fReweightMaNCRES),
43  GetGenieKnobSyst(rwgt::fReweightMvCCRES),
44  };
45  //nue only or joint
46  if(ana != kNumuAna2017){
47  ret.push_back(&kRadCorrNue);
48  ret.push_back(&kRadCorrNuebar);
49  ret.push_back(&k2ndClassCurrs);
50  }
51  //numu only or joint
52  if(ana != kNueAna2017){
53  }
54  return ret;
55  }
56 
57 
58  std::vector<const ISyst *> getAna2017SmallXsecSysts(const EAnaType2017 ana)
59  {
60  auto allgenie = getAllXsecSysts_2017();
61  auto largegenie = getAna2017LargeXsecSysts(ana);
62 
63  for (const auto & s:largegenie){
64  for (const auto & a:allgenie){
65  if( a == s ){
66  auto it = std::remove(allgenie.begin(),allgenie.end(),a);
67  allgenie.erase(it);
68  continue;
69  }
70  }
71  }
72  return allgenie;
73  }
74 
76  {
77  auto systs = getAna2017SmallXsecSysts(ana);
78  auto anastr = AnaTypeToString(ana);
79  return new SummedSyst(systs, "SumSmallXSec"+anastr,
80  "Summed small XSec systs "+anastr);
81 
82  }
83 
84  //////////////////////////////////////////////////////////////////////
85 
86  const DummyAnaSyst kNue2017NormSig ("NueNormSig","Sig. Norm.");
87  const DummyAnaSyst kNue2017NormBkg ("NueNormBkg","Bkg. Norm.");
88  const DummyAnaSyst kAna2017NormBoth ("NormBoth","Sig+Bkg Norm.");
89 
90  //////////////////////////////////////////////////////////////////////
91  void AddJointAna2017XSecSysts(std::vector<const ISyst*> &systs,
92  const EAnaType2017 ana,
93  bool smallgenie)
94  {
95  auto temp = getAna2017LargeXsecSysts(ana);
96  for (auto const& s:temp){
97  systs.push_back(s);
98  }
99  if(smallgenie) systs.push_back(getAna2017SummedSmallXsecSysts(kJointAna2017));
100  }
101 
102  void AddJointAna2017BeamSysts (std::vector<const ISyst*> &systs,
103  const EAnaType2017 ana)
104  {
105  for (int i =0;i<5; ++i){
106  systs.push_back(GetPPFXPrincipals(i));
107  }
108  systs.push_back(&kBeamAllTransport);
109  }
110 
111  void AddJointAna2017FileSysts (std::vector<const ISyst*> &systs,
112  const EAnaType2017 ana){
113  //Hacked systematics to be used in the fit. Nue or numu doesn't matter
114  systs.push_back(&kAnaCalibrationSyst);
115  systs.push_back(&kAnaRelativeCalibSyst);
116  systs.push_back(&kAnaCalibShapeSyst);
117  systs.push_back(&kAnaLightlevelSyst);
118  systs.push_back(&kAnaCherenkovSyst);
119  }
120 
121 
122  void AddJointAna2017NormSysts(std::vector<const ISyst*> &systs,
123  const EAnaType2017 ana)
124  {
125  systs.push_back(&kAna2017NormBoth);
126  }
127 
128  void AddJointAna2017OtherSysts(std::vector<const ISyst*> &systs,
129  const EAnaType2017 ana)
130  {
131  if(ana != kNumuAna2017){
132  systs.push_back(&kNueExtrapSystSignalKin2017);
133  systs.push_back(&kNueExtrapSystBkg2017);
134 // systs.push_back(&kNue2017NormSig);
135 // systs.push_back(&kNue2017NormBkg);
136  }
137  if(ana != kNueAna2017){
138  systs.push_back(&kMuEScaleSyst2017);
139  systs.push_back(&kRelMuEScaleSyst2017);
140 // systs.push_back(&kDirectHadEScaleSyst2017);
141  }
142 
143  }
144 
145 //////////////////////////////////////////////////////////////////////
146  std::vector<const ISyst*> getAllAna2017Systs(const EAnaType2017 ana, const bool smallgenie)
147  {
148  std::vector<const ISyst*> ret;
149  AddJointAna2017XSecSysts (ret, ana, smallgenie);
150  AddJointAna2017BeamSysts (ret, ana);
151  AddJointAna2017FileSysts (ret, ana);
152  AddJointAna2017NormSysts (ret, ana);
153  AddJointAna2017OtherSysts(ret, ana);
154  return ret;
155  }
156 
157 
158 
159 
160 
161 }
BeamSyst * GetPPFXPrincipals(int PCIdx)
Definition: BeamSysts.cxx:72
Generic way to add systematics in quadrature.
Definition: SummedSysts.h:12
const DummyAnaSyst kNue2017NormBkg("NueNormBkg","Bkg. Norm.")
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
void AddJointAna2017NormSysts(std::vector< const ISyst * > &systs, const EAnaType2017 ana)
set< int >::iterator it
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
void AddJointAna2017OtherSysts(std::vector< const ISyst * > &systs, const EAnaType2017 ana)
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
const DummyAnaSyst kAnaRelativeCalibSyst("RelativeCalib","RelCalib")
const NOvARwgtSyst kDISvnCC1pi_2017("DISvnCC1pi_2017","DIS vnCC1pi", novarwgt::kDIS_CC_1pi_nu_n_SystKnob_2017)
Definition: DISSysts.h:59
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 MuEScaleSyst2017 kMuEScaleSyst2017(0.0074, 0.0012)
const DummyAnaSyst kAnaLightlevelSyst("Lightlevel","Lightlevel")
const NOvARwgtSyst kRPACCQEEnhSyst2017("RPAShapeenh2017","RPA shape: higher-Q^{2} enhancement (2017)", novarwgt::kRPACCQEEnhSyst2017)
Definition: RPASysts.h:11
const XML_Char * s
Definition: expat.h:262
const DummyAnaSyst kAnaCalibrationSyst("Calibration","AbsCalib")
const DummyAnaSyst kAnaCherenkovSyst("Cherenkov","Cherenkov")
const RelMuEScaleSyst2017 kRelMuEScaleSyst2017(0.0045, 10.5)
const double a
const BeamSyst kBeamAllTransport((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"totErr","beamTransportComb","Combined Beam Transport Systematics")
All Beam Transport systematics combined in quadratures.
Definition: BeamSysts.h:135
const NueExtrapSystSignalKin2017 kNueExtrapSystSignalKin2017
void AddJointAna2017XSecSysts(std::vector< const ISyst * > &systs, const EAnaType2017 ana, bool smallgenie)
const SummedSyst * getAna2017SummedSmallXsecSysts(const EAnaType2017 ana)
std::vector< const ISyst * > getAna2017LargeXsecSysts(const EAnaType2017 ana)
const NueExtrapSystBkg2017 kNueExtrapSystBkg2017
std::string AnaTypeToString(const EAnaType2020 ana)
const DummyAnaSyst kNue2017NormSig("NueNormSig","Sig. Norm.")
void AddJointAna2017FileSysts(std::vector< const ISyst * > &systs, const EAnaType2017 ana)
void AddJointAna2017BeamSysts(std::vector< const ISyst * > &systs, const EAnaType2017 ana)
const NOvARwgtSyst kMECq0ShapeSyst2017("MECq0Shape","MEC q_{0} shape", novarwgt::kMECq0ShapeSyst2017)
Definition: MECSysts.h:41
const NOvARwgtSyst kRPARESSyst2017("RPAShapeRES2017","RPA shape: resonance events", novarwgt::kRPARESSyst2017)
Definition: RPASysts.h:20
std::vector< const ISyst * > getAllAna2017Systs(const EAnaType2017 ana, const bool smallgenie)
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 DummyAnaSyst kAna2017NormBoth("NormBoth","Sig+Bkg Norm.")
std::vector< const ISyst * > getAllXsecSysts_2017()
Get master XSec syst list for 2017 analyses.
const DummyAnaSyst kAnaCalibShapeSyst("CalibShape","CalibShape")
std::vector< const ISyst * > getAna2017SmallXsecSysts(const EAnaType2017 ana)
enum BeamMode string