JointAna2018Systs.cxx
Go to the documentation of this file.
2 
3 #include "CAFAna/Systs/Systs.h"
8 
16 
19 
20 
21 namespace ana
22 {
24  {
25  std::string ret = "";
26  if(ana == kNueAna2018) ret = "Nue2018";
27  if(ana == kNumuAna2018) ret = "Numu2018";
28  if(ana == kJointAna2018) ret = "Joint2018";
29  return ret;
30  }
31 
32  std::vector<const ISyst *> getAna2018LargeXsecSysts(const EAnaType2018 ana)
33  {
34  std::vector<const ISyst *> ret =
35  {
47  GetGenieKnobSyst(rwgt::fReweightMaCCRES),
48  GetGenieKnobSyst(rwgt::fReweightMaNCRES),
49  GetGenieKnobSyst(rwgt::fReweightMvCCRES),
50  GetGenieKnobSyst(rwgt::fReweightCCQEPauliSupViaKF),
51  //GetGenieKnobSyst(rwgt::fReweightFrElas_N),
52  GetGenieKnobSyst(rwgt::fReweightFrCEx_N),
53  GetGenieKnobSyst(rwgt::fReweightFrAbs_N),
54  GetGenieKnobSyst(rwgt::fReweightFrInel_pi),
55  GetGenieKnobSyst(rwgt::fReweightFormZone),
56  };
57  //nue only or joint
58  if(ana != kNumuAna2018){
59  ret.push_back(&kRadCorrNue);
60  ret.push_back(&kRadCorrNuebar);
61  ret.push_back(&k2ndClassCurrs);
62  }
63  //numu only or joint
64  if(ana != kNueAna2018){
65  }
66  return ret;
67  }
68 
69 
70  void AddJointAna2018XSecSysts(std::vector<const ISyst*> &systs,
71  const EAnaType2018 ana,
72  bool smallgenie)
73  {
74  auto temp = getAna2018LargeXsecSysts(ana);
75  for (auto const& s:temp){
76  systs.push_back(s);
77  }
78  if(smallgenie){
79  for (int i =0;i<5; ++i){
80  systs.push_back(GetGeniePrincipals2018Small(i));
81  }
82  systs.push_back(&kTauScaleSyst);
83  }
84  }
85 
86  void AddJointAna2018BeamSysts (std::vector<const ISyst*> &systs,
87  const EAnaType2018 ana)
88  {
89  for (int i =0;i<5; ++i){
90  systs.push_back(GetFluxPrincipals2018(i));
91  }
92  }
93 
94  void AddJointAna2018FileSysts (std::vector<const ISyst*> &systs,
95  const EAnaType2018 ana, const BeamType2018 beam){
96  systs.push_back(&kAnaCalibrationSyst);
97  systs.push_back(&kAnaRelativeCalibSyst);
98  systs.push_back(&kAnaCalibShapeSyst);
99  systs.push_back(&kAnaLightlevelSyst);
100  systs.push_back(&kAnaCherenkovSyst);
101  }
102 
103  void AddJointAna2018NotCorrelSysts(std::vector<const ISyst*> &systs,
104  const EAnaType2018 ana, const BeamType2018 beam)
105  {
106 
107  if(ana != kNumuAna2018){
108  if( beam != kRHC) {
109  systs.push_back(&kNueAcceptSystSignalKin2018FHC);
110  systs.push_back(&kNueAcceptSystBkg2018FHC);
111  systs.push_back(&kMichelTaggingSyst2018);
112  }
113  if( beam != kFHC) {
114  systs.push_back(&kNueAcceptSystSignalKin2018RHC);
115  systs.push_back(&kNueAcceptSystBkg2018RHC);
116  }
117  }
118  if(ana != kNueAna2018){
119  systs.push_back(&kRelMuEScaleSyst2017);
120  }
121 
122  }
123 
124  void AddJointAna2018OtherSysts(std::vector<const ISyst*> &systs,
125  const EAnaType2018 ana, const BeamType2018 beam){
126 
127  systs.push_back(&kNeutronVisEScalePrimariesSyst2018);
128  systs.push_back(&kMuEScaleSyst2017);
129  if( beam != kRHC ) systs.push_back(&kAna2018NormFHC); // temp location
130  if( beam != kFHC ) systs.push_back(&kAna2018NormRHC); // temp location
131 
132  }
133  void AddNonLoadable2018Systs(std::vector<const ISyst*> &systs,
134  const EAnaType2018 ana)
135  {
136  if(ana != kNumuAna2018){
137  systs.push_back(&kRockScaleSyst);
138  }
139  }
140 
141 
142  void AddWrongSignSysts(std::vector<const ISyst*> &systs,
143  const EAnaType2018 ana)
144  {
145  systs.push_back(&kWrongSignScale);
146  }
147 
148 //////////////////////////////////////////////////////////////////////
149  std::vector<const ISyst*> getAllAna2018Systs(const EAnaType2018 ana, const bool smallgenie, const BeamType2018 beam, bool isFit)
150  {
151  std::vector<const ISyst*> ret;
152 
153  AddJointAna2018XSecSysts (ret, ana, smallgenie);
154  AddJointAna2018BeamSysts (ret, ana);
155  AddJointAna2018FileSysts (ret, ana, beam);
156  AddJointAna2018OtherSysts(ret, ana, beam);
157  AddJointAna2018NotCorrelSysts(ret, ana, beam);
158  if(isFit) AddNonLoadable2018Systs(ret, ana);
159 
160  return ret;
161  }
162 
163 
164  //////////////////////////////////////////////////////////////////////
165  //test for CPT analysis
166  //should ideally go into the std analyses
167  std::vector<const ISyst*> getAllCPTSysts(const EAnaType2018 ana, const bool smallgenie, const BeamType2018 beam, bool isFit)
168  {
169  std::vector<const ISyst*> ret;
170 
171  AddJointAna2018XSecSysts (ret, ana, smallgenie);
172  AddJointAna2018BeamSysts (ret, ana);
173  AddJointAna2018FileSysts (ret, ana, beam);
174  AddJointAna2018OtherSysts(ret, ana, beam);
175  AddJointAna2018NotCorrelSysts(ret, ana, beam);
176  AddWrongSignSysts(ret, ana);
177  if(isFit) AddNonLoadable2018Systs(ret, ana);
178 
179  return ret;
180  }
181 
182 
183  //////////////////////////////////////////////////////////////////////
184  //don't really need these functions for analysis, but there are some parts in ana that call them
185 
186  std::vector<const ISyst *> getAna2018SmallXsecSysts(const EAnaType2018 ana)
187  {
188  auto allgenie = getAllXsecSysts_2018();
189  auto largegenie = getAna2018LargeXsecSysts(ana);
190 
191  for (const auto & s:largegenie){
192  for (const auto & a:allgenie){
193  if( a == s ){
194  auto it = std::remove(allgenie.begin(),allgenie.end(),a);
195  allgenie.erase(it);
196  continue;
197  }
198  }
199  }
200  return allgenie;
201  }
202 
204  {
205  auto systs = getAna2018SmallXsecSysts(ana);
206  auto anastr = AnaTypeToString(ana);
207  return new SummedSyst(systs, "SumSmallXSec"+anastr,
208  "Summed small XSec systs "+anastr);
209  }
210 
211  //////////////////////////////////////////////////////////////////////
212  std::vector<const ISyst *> getAna2018NueOnly( const BeamType2018 beam)
213  {
214  std::vector<const ISyst*> ret;
215  ret.push_back(&kRadCorrNue);
216  ret.push_back(&kRadCorrNuebar);
217  ret.push_back(&k2ndClassCurrs);
220 
221  if(beam != kFHC) ret.push_back(&kAna2018NormRHC);
222  if(beam != kRHC) ret.push_back(&kAna2018NormFHC);
223 
224  return ret;
225  }
226 
227  std::vector<const ISyst *> getAna2018NumuOnly( const BeamType2018 beam)
228  {
229  std::vector<const ISyst*> ret;
232  return ret;
233  }
234 
235 
236 
237 }
const NOvARwgtSyst kMECShapeSyst2018AntiNu("MECShape2018AntiNu","MEC 2018 (q_{0}, |#vec{q}|) response, antineutrinos", novarwgt::kMECQ0Q3RespSystNubar2018)
Definition: MECSysts.h:26
Generic way to add systematics in quadrature.
Definition: SummedSysts.h:12
const WrongSignScale kWrongSignScale
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 NueAcceptSystSignalKin2018RHC kNueAcceptSystSignalKin2018RHC
set< int >::iterator it
std::vector< const ISyst * > getAllXsecSysts_2018()
Get master XSec syst list for 2018 analyses.
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
const NOvARwgtSyst kRPACCQEEnhSyst2018("RPAShapeenh2018","RPA shape: higher-Q^{2} enhancement (2018)", novarwgt::kRPACCQEEnhSyst2018)
Definition: RPASysts.h:13
const SummedSyst * getAna2018SummedSmallXsecSysts(const EAnaType2018 ana)
std::vector< const ISyst * > getAna2018NueOnly(const BeamType2018 beam)
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 NuTruthSystComponentScale kTauScaleSyst("NuTauScale","#nu_{#tau} Scale", kIsTau_NT &&!kIsNC_NT, 0.6, NuTruthSystComponentScale::kLinear)
100% uncertainty scale on taus
Definition: Systs.h:176
const NOvARwgtSyst kMECEnuShapeSyst2018AntiNu("MECEnuShapeAntiNu","MEC E_{#nu} shape, antineutrinos", novarwgt::kMECEnuShapeSyst2017_NubarOnly)
Definition: MECSysts.h:32
const NOvARwgtSyst kMECShapeSyst2018Nu("MECShape2018Nu","MEC 2018 (q_{0}, |#vec{q}|) response, neutrinos", novarwgt::kMECQ0Q3RespSystNu2018)
Definition: MECSysts.h:25
const NOvARwgtSyst kMECInitStateNPFracSyst2018AntiNu("MECInitStateNPFracAntiNu","MEC initial state np fraction, antineutrinos", novarwgt::kMECInitStateNPFracSyst2017_NubarOnly)
Definition: MECSysts.h:35
void AddJointAna2018BeamSysts(std::vector< const ISyst * > &systs, const EAnaType2018 ana)
void AddJointAna2018NotCorrelSysts(std::vector< const ISyst * > &systs, const EAnaType2018 ana, const BeamType2018 beam)
const NeutronVisEScaleSyst2018 kNeutronVisEScalePrimariesSyst2018(false)
const DummyAnaSyst kAnaRelativeCalibSyst("RelativeCalib","RelCalib")
const NOvARwgtSyst kMECEnuShapeSyst2018Nu("MECEnuShapeNu","MEC E_{#nu} shape, neutrinos", novarwgt::kMECEnuShapeSyst2017_NuOnly)
Definition: MECSysts.h:31
BeamSyst * GetFluxPrincipals2018(int PCIdx)
Definition: BeamSysts.cxx:89
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 XML_Char * s
Definition: expat.h:262
const DummyAnaSyst kAnaCalibrationSyst("Calibration","AbsCalib")
std::vector< const ISyst * > getAllAna2018Systs(const EAnaType2018 ana, const bool smallgenie, const BeamType2018 beam, bool isFit)
const DummyAnaSyst kAnaCherenkovSyst("Cherenkov","Cherenkov")
std::vector< const ISyst * > getAna2018SmallXsecSysts(const EAnaType2018 ana)
void AddJointAna2018FileSysts(std::vector< const ISyst * > &systs, const EAnaType2018 ana, const BeamType2018 beam)
const RelMuEScaleSyst2017 kRelMuEScaleSyst2017(0.0045, 10.5)
const double a
const NueAcceptSystBkg2018RHC kNueAcceptSystBkg2018RHC
RHC.
const NOvARwgtSyst kMECInitStateNPFracSyst2018Nu("MECInitStateNPFracNu","MEC initial state np fraction, neutrinos", novarwgt::kMECInitStateNPFracSyst2017_NuOnly)
Definition: MECSysts.h:34
const NueAcceptSystSignalKin2018FHC kNueAcceptSystSignalKin2018FHC
const NueAcceptSystBkg2018FHC kNueAcceptSystBkg2018FHC
FHC.
const NOvARwgtSyst kCOHCCScaleSyst2018("COHCCScale2018","Coherent CC Scale", novarwgt::kCOHNormCCSystKnob)
20% uncertainty scale on coherent CC events. See documentation in NOvARwgt
Definition: XSecSysts.h:40
std::vector< const ISyst * > getAna2018LargeXsecSysts(const EAnaType2018 ana)
GeniePCASyst * GetGeniePrincipals2018Small(int PCIdx)
std::string AnaTypeToString(const EAnaType2020 ana)
void AddWrongSignSysts(std::vector< const ISyst * > &systs, const EAnaType2018 ana)
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 DummyAnaSyst kAna2018NormRHC("NormRHC2018","RHC. Norm.")
void AddNonLoadable2018Systs(std::vector< const ISyst * > &systs, const EAnaType2018 ana)
const MichelTaggingSyst2018 kMichelTaggingSyst2018
void AddJointAna2018OtherSysts(std::vector< const ISyst * > &systs, const EAnaType2018 ana, const BeamType2018 beam)
void AddJointAna2018XSecSysts(std::vector< const ISyst * > &systs, const EAnaType2018 ana, bool smallgenie)
std::vector< const ISyst * > getAllCPTSysts(const EAnaType2018 ana, const bool smallgenie, const BeamType2018 beam, bool isFit)
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
std::vector< const ISyst * > getAna2018NumuOnly(const BeamType2018 beam)
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 kAna2018NormFHC("NormFHC2018","FHC. Norm.")
const DummyAnaSyst kAnaCalibShapeSyst("CalibShape","CalibShape")
const DummyRockScaleSyst kRockScaleSyst
const NOvARwgtSyst kRPARESSyst2018("RPAShapeRES2018","RPA shape: resonance events (2018)", novarwgt::kRPARESSyst2018)
Definition: RPASysts.h:21
enum BeamMode string