3FlavorAna2020Systs.cxx
Go to the documentation of this file.
2 
3 #include "CAFAna/Systs/Systs.h"
10 #include "CAFAna/Systs/DISSysts.h"
11 #include "CAFAna/Systs/BeamSysts.h"
12 
13 #include "CAFAna/Experiment/SingleSampleExperiment.h" // kCosmicBkgScale
14 
17 
19 #include "3FlavorAna/Systs/EnergySysts2018.h" // kNeutronVisEScalePrimariesSyst2018
21 
27 
28 
29 namespace ana
30 {
32  {
33  std::string ret = "";
34  if(ana == EAnaType2020::kNueAna) ret = "Nue2020";
35  if(ana == EAnaType2020::kNumuAna) ret = "Numu2020";
36  if(ana == EAnaType2020::k3FlavorAna) ret = "3Flavor2020";
37  return ret;
38  }
39 
40  std::vector<const ISyst *> get3FlavorAna2020LargeXsecSysts(const EAnaType2020 ana)
41  {
42  std::vector<const ISyst *> ret =
43  {
48 
49  GetGenieKnobSyst(rwgt::fReweightMaCCRES),
50  GetGenieKnobSyst(rwgt::fReweightMvCCRES),
51  GetGenieKnobSyst(rwgt::fReweightMaNCRES),
52  GetGenieKnobSyst(rwgt::fReweightMvNCRES),
53 
54  GetGenieKnobSyst(rwgt::fReweightZNormCCQE),
55 
58 
60 
62 
65 
72  };
73 
74  //nue only or joint
75  if(ana != EAnaType2020::kNumuAna)
76  {
77  ret.push_back(&kRadCorrNue);
78  ret.push_back(&kRadCorrNuebar);
79  ret.push_back(&k2ndClassCurrs);
80  }
81  //numu only or joint
82  if(ana != EAnaType2020::kNueAna)
83  {
84  }
85  return ret;
86  }
87 
88 
89  void Add3FlavorAna2020XSecSysts(std::vector<const ISyst*> &systs,
90  const EAnaType2020 ana,
91  bool smallgenie)
92  {
94  for (auto const& s:temp)
95  {
96  systs.push_back(s);
97  }
98  if(smallgenie)
99  {
100  // 12 Genie PCs for 2020
101  for (int i =0;i<12; ++i)
102  {
103  systs.push_back(GetGeniePrincipals2020Small(i));
104  }
105  }
106  systs.push_back(&kTauScaleSyst);
107  }
108 
109  void Add3FlavorAna2020BeamSysts (std::vector<const ISyst*> &systs,
110  const EAnaType2020 ana)
111  {
112  // keeping the first 5 flux PCs for 2020
113  for (int i =0;i<5; ++i)
114  {
115  systs.push_back(GetFluxPrincipals2020(i));
116  }
117  }
118 
119  void Add3FlavorAna2020CalibSysts( std::vector<const ISyst*>& systs )
120  {
121  systs.push_back( &kAnaCalibrationSyst );
122  systs.push_back( &kAnaRelativeCalibSyst );
123  systs.push_back( &kAnaCalibShapeSyst );
124  systs.push_back( &kAnaCalibDriftSyst );
125  }
126 
127  void Add3FlavorAna2020LightSysts( std::vector<const ISyst*>& systs )
128  {
129  systs.push_back( &kAnaLightlevelFDSyst );
130  systs.push_back( &kAnaLightlevelNDSyst );
131  systs.push_back( &kAnaCherenkovSyst );
132  }
133 
134  void Add3FlavorAna2020FileSysts( std::vector<const ISyst*> &systs )
135  {
138  }
139 
140  void Add3FlavorAna2020MuEnergySysts( std::vector<const ISyst*> &systs,
141  const EAnaType2020 ana )
142  {
143  systs.push_back( &kUnCorrNDMuEScaleSyst2020 );
144  systs.push_back( &kUnCorrMuCatMuESyst2020 );
145  systs.push_back( &kPileupMuESyst2020 );
146  systs.push_back( &kCorrMuEScaleSyst2020 );
147  if ( ana != EAnaType2020::kNueAna )
148  {
149  systs.push_back( &kUnCorrFDMuEScaleSyst2020 );
150  }
151  }
152 
153  void Add3FlavorAna2020LeptonAngleSysts( std::vector<const ISyst*> &systs,
154  const bool ptExtrap )
155  {
156  if ( ptExtrap )
157  {
158  systs.push_back( &kLeptonAngleSystNDXZ2020 );
159  systs.push_back( &kLeptonAngleSystNDYZ2020 );
160  systs.push_back( &kLeptonAngleSystFDXZ2020 );
161  systs.push_back( &kLeptonAngleSystFDYZ2020 );
162  }
163  }
164 
165  void Add3FlavorAna2020NeutronSysts( std::vector<const ISyst*> &systs )
166  {
167  systs.push_back( &kNeutronVisEScalePrimariesSyst2018 );
168  }
169 
170  void Add3FlavorAna2020NueAcceptSysts( std::vector<const ISyst*> &systs,
171  const EAnaType2020 ana,
172  const BeamType2020 beam,
173  const bool ptExtrap )
174  {
175  if ( ana != EAnaType2020::kNumuAna )
176  {
177  if ( beam != BeamType2020::kRHC )
178  {
179  if ( ptExtrap ) systs.push_back( &kNueAcceptSystSignalKinPtExtrap2020FHC );
180  else systs.push_back( &kNueAcceptSystSignalKin2020FHC );
181  }
182  if ( beam != BeamType2020::kFHC )
183  {
184  if ( ptExtrap ) systs.push_back( &kNueAcceptSystSignalKinPtExtrap2020RHC );
185  else systs.push_back( &kNueAcceptSystSignalKin2020RHC );
186  }
187  }
188  }
189 
190  void Add3FlavorAna2020MichelTagSysts( std::vector<const ISyst*> &systs,
191  const EAnaType2020 ana,
192  const BeamType2020 beam )
193  {
194  if ( ana != EAnaType2020::kNumuAna && beam != BeamType2020::kRHC )
195  {
196  systs.push_back( &kMichelTaggingSyst2020 );
197  }
198  }
199 
200  void Add3FlavorAna2020NotCorrelSysts( std::vector<const ISyst*> &systs,
201  const EAnaType2020 ana,
202  const BeamType2020 beam,
203  const bool ptExtrap )
204  {
205  Add3FlavorAna2020NueAcceptSysts( systs, ana, beam, ptExtrap );
206  Add3FlavorAna2020MichelTagSysts( systs, ana, beam );
207  if ( ana != EAnaType2020::kNueAna )
208  {
209  systs.push_back( &kUnCorrFDMuEScaleSyst2020 );
210  }
211  }
212 
213  void Add3FlavorAna2020NormSysts( std::vector<const ISyst*> &systs,
214  const BeamType2020 beam )
215  {
216  systs.push_back(&kAna2020NormHornCorr);
217  if( beam != BeamType2020::kRHC ) systs.push_back(&kAna2020NormFHC);
218  if( beam != BeamType2020::kFHC ) systs.push_back(&kAna2020NormRHC);
219  }
220 
221  // not for 2020?
222  void AddNonLoadable2020Systs(std::vector<const ISyst*> &systs,
223  const EAnaType2020 ana)
224  {
225  if(ana != EAnaType2020::kNumuAna)
226  {
227  systs.push_back(&kRockScaleSyst);
228  }
229  systs.push_back(&kCosmicBkgScaleSyst);
230  }
231 
232  void Add3FlavorAna2020OtherSysts( std::vector<const ISyst*> &systs,
233  const EAnaType2020 ana,
234  const BeamType2020 beam,
235  const bool ptExtrap )
236  {
237  Add3FlavorAna2020MuEnergySysts( systs, ana );
238  Add3FlavorAna2020LeptonAngleSysts( systs, ptExtrap );
240  Add3FlavorAna2020NormSysts( systs, beam );
241  Add3FlavorAna2020NueAcceptSysts( systs, ana, beam, ptExtrap );
242  Add3FlavorAna2020MichelTagSysts( systs, ana, beam );
243  }
244 
245 //////////////////////////////////////////////////////////////////////
246  std::vector<const ISyst*> get3FlavorAna2020AllSysts(const EAnaType2020 ana, const bool smallgenie, const BeamType2020 beam, const bool isFit, const bool ptExtrap )
247  {
248  std::vector<const ISyst*> ret;
249 
250  Add3FlavorAna2020XSecSysts (ret, ana, smallgenie);
251  Add3FlavorAna2020BeamSysts (ret, ana);
253  Add3FlavorAna2020OtherSysts(ret, ana, beam, ptExtrap);
254  if(isFit) AddNonLoadable2020Systs(ret, ana);
255 
256  return ret;
257  }
258 
259 
260  //////////////////////////////////////////////////////////////////////
261  //test for CPT analysis
262  //should ideally go into the std analyses
263  std::vector<const ISyst*> get3FlavorAna2020AllCPTSysts(const EAnaType2020 ana, const bool smallgenie, const BeamType2020 beam, const bool isFit, const bool ptExtrap )
264  {
265  std::vector<const ISyst*> ret;
266 
267  Add3FlavorAna2020XSecSysts (ret, ana, smallgenie);
268  Add3FlavorAna2020BeamSysts (ret, ana);
270  Add3FlavorAna2020OtherSysts(ret, ana, beam, ptExtrap);
271  // deprecated AddWrongSignSysts(ret, ana);
272  if(isFit) AddNonLoadable2020Systs(ret, ana);
273 
274  return ret;
275  }
276 
277 
278  //////////////////////////////////////////////////////////////////////
279  //don't really need these functions for analysis, but there are some parts in ana that call them
280 
281  std::vector<const ISyst *> get3FlavorAna2020SmallXsecSysts(const EAnaType2020 ana)
282  {
283  auto allgenie = getAllXsecSysts_2020();
284  auto largegenie = get3FlavorAna2020LargeXsecSysts(ana);
285 
286  for (const auto & s:largegenie)
287  {
288  for (const auto & a:allgenie)
289  {
290  if( a == s )
291  {
292  auto it = std::remove(allgenie.begin(),allgenie.end(),a);
293  allgenie.erase(it);
294  continue;
295  }
296  }
297  }
298  return allgenie;
299  }
300 
302  {
304  auto anastr = AnaTypeToString(ana);
305  return new SummedSyst(systs, "SumSmallXSec"+anastr,
306  "Summed small XSec systs "+anastr);
307  }
308 
309  //////////////////////////////////////////////////////////////////////
310  std::vector<const ISyst *> getAna2020NueOnly( const BeamType2020 beam, const bool ptExtrap )
311  {
312  std::vector<const ISyst*> ret;
313  ret.push_back(&kRadCorrNue);
314  ret.push_back(&kRadCorrNuebar);
315  ret.push_back(&k2ndClassCurrs);
319 
320  return ret;
321  }
322 
323  std::vector<const ISyst *> getAna2020NumuOnly( const BeamType2020 beam )
324  {
325  std::vector<const ISyst*> ret;
326  ret.push_back( &kUnCorrFDMuEScaleSyst2020 );
328  return ret;
329  }
330 }
std::vector< const ISyst * > get3FlavorAna2020SmallXsecSysts(const EAnaType2020 ana)
Generic way to add systematics in quadrature.
Definition: SummedSysts.h:12
const NOvARwgtSyst kZExpEV2Syst2020("ZExpAxialFFSyst2020_EV2","CCQE z-exp EV shift #2", novarwgt::kZExpEV2Syst2020)
Definition: XSecSysts.h:57
const DummyAnaSyst kAna2020NormFHC("NormFHC2020","FHC. 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
const NOvARwgtSyst khNFSISyst2020_MFP("hNFSI_MFP_2020","hN FSI mean free path", novarwgt::khNFSISyst2020_MFP)
Definition: FSISysts.h:13
set< int >::iterator it
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
const DummyAnaSyst kAnaLightlevelFDSyst("Light_Level_FD","Light_Level_FD")
const NOvARwgtSyst kMECShapeSyst2020Nu("MECShape2020Nu","MEC 2020 (q_{0}, |#vec{q}|) response, neutrinos", novarwgt::kMECQ0Q3RespSyst2020_NuOnly)
Definition: MECSysts.h:11
const NOvARwgtSyst kDISvnCC1pi_2020("DISvnCC1pi_2020","DIS vnCC1pi", novarwgt::kDIS_CC_1pi_nu_n_SystKnob_2020)
Definition: DISSysts.h:24
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 DummyAnaSyst kAna2020NormHornCorr("NormHornCorr","HornCorr Norm.")
void AddNonLoadable2020Systs(std::vector< const ISyst * > &systs, const EAnaType2020 ana)
const NeutronVisEScaleSyst2018 kNeutronVisEScalePrimariesSyst2018(false)
void Add3FlavorAna2020NeutronSysts(std::vector< const ISyst * > &systs)
const CosmicBkgScaleSyst kCosmicBkgScaleSyst
const DummyAnaSyst kAna2020NormRHC("NormRHC2020","RHC. Norm.")
const NueAcceptSystSignalKin2020FHC kNueAcceptSystSignalKin2020FHC
const DummyAnaSyst kAnaRelativeCalibSyst("RelativeCalib","RelCalib")
void Add3FlavorAna2020FileSysts(std::vector< const ISyst * > &systs)
const LeptonAngleSyst kLeptonAngleSystNDYZ2020("LeptonAngleSystNDYZ2020","Lepton Angle Syst ND YZ", caf::kNEARDET, kAngleShiftYZ, 0.010)
Definition: AngleSysts.h:35
const LeptonAngleSyst kLeptonAngleSystNDXZ2020("LeptonAngleSystNDXZ2020","Lepton Angle Syst ND XZ", caf::kNEARDET, kAngleShiftXZ, 0.010)
Definition: AngleSysts.h:34
const NOvARwgtSyst kRadCorrNuebar("radcorrnuebar","Radiative corrections for #bar{#nu}_{e}", novarwgt::kSimpleRadiativeCorrNuebarXsecSystKnob)
Radiative corrections syst (nuebars). See documentation in NOvARwgt.
Definition: XSecSysts.h:67
void Add3FlavorAna2020MichelTagSysts(std::vector< const ISyst * > &systs, const EAnaType2020 ana, const BeamType2020 beam)
const UnCorrFDMuEScaleSyst2020 kUnCorrFDMuEScaleSyst2020(0.0015)
const XML_Char * s
Definition: expat.h:262
std::vector< const ISyst * > getAllXsecSysts_2020()
const LeptonAngleSyst kLeptonAngleSystFDXZ2020("LeptonAngleSystFDXZ2020","Lepton Angle Syst FD XZ", caf::kFARDET, kAngleShiftXZ, 0.010)
Definition: AngleSysts.h:36
const DummyAnaSyst kAnaCalibrationSyst("Calibration","AbsCalib")
const DummyAnaSyst kAnaCherenkovSyst("Cherenkov","Cherenkov")
const NOvARwgtSyst kZExpEV1Syst2020("ZExpAxialFFSyst2020_EV1","CCQE z-exp EV shift #1", novarwgt::kZExpEV1Syst2020)
Definition: XSecSysts.h:56
void Add3FlavorAna2020OtherSysts(std::vector< const ISyst * > &systs, const EAnaType2020 ana, const BeamType2020 beam, const bool ptExtrap)
const NOvARwgtSyst khNFSISyst2020_EV1("hNFSI_FateFracEV1_2020","hN FSI fate fraction eigenvector #1", novarwgt::khNFSISyst2020_EV1)
Definition: FSISysts.h:10
const double a
const NOvARwgtSyst kMECInitStateNPFracSyst2020AntiNu("MECInitStateNPFrac2020AntiNu","MEC initial state np fraction, antineutrinos", novarwgt::kMECInitStateNPFracSyst2020_NubarOnly)
Definition: MECSysts.h:18
std::vector< const ISyst * > getAna2020NueOnly(const BeamType2020 beam, const bool ptExtrap)
void Add3FlavorAna2020LeptonAngleSysts(std::vector< const ISyst * > &systs, const bool ptExtrap)
const NueAcceptSystSignalKin2020FHC kNueAcceptSystSignalKinPtExtrap2020FHC(ana::kExtrapPt,"accept_signalkin_pTextrap_FHC_2020")
BeamSyst * GetFluxPrincipals2020(int PCIdx)
Definition: BeamSysts.cxx:106
const NOvARwgtSyst kZExpEV4Syst2020("ZExpAxialFFSyst2020_EV4","CCQE z-exp EV shift #4", novarwgt::kZExpEV4Syst2020)
Definition: XSecSysts.h:59
const NOvARwgtSyst kRPACCQEEnhSyst2020("RPAShapeenh2020","RPA shape: higher-Q^{2} enhancement (2020)", novarwgt::kRPACCQEEnhSyst2020)
Definition: RPASysts.h:17
const NOvARwgtSyst kRESLowQ2SuppressionSyst2020("LowQ2RESSupp2020","RES low-Q^2 suppression", novarwgt::kRESLowQ2SuppressionSyst2020)
Definition: RESSysts.h:10
const MichelTaggingSyst2020 kMichelTaggingSyst2020
const NOvARwgtSyst kZExpEV3Syst2020("ZExpAxialFFSyst2020_EV3","CCQE z-exp EV shift #3", novarwgt::kZExpEV3Syst2020)
Definition: XSecSysts.h:58
void Add3FlavorAna2020LightSysts(std::vector< const ISyst * > &systs)
void Add3FlavorAna2020NueAcceptSysts(std::vector< const ISyst * > &systs, const EAnaType2020 ana, const BeamType2020 beam, const bool ptExtrap)
std::string AnaTypeToString(const EAnaType2020 ana)
void Add3FlavorAna2020NormSysts(std::vector< const ISyst * > &systs, const BeamType2020 beam)
void Add3FlavorAna2020MuEnergySysts(std::vector< const ISyst * > &systs, const EAnaType2020 ana)
const NOvARwgtSyst kMECInitStateNPFracSyst2020Nu("MECInitStateNPFrac2020Nu","MEC initial state np fraction, neutrinos", novarwgt::kMECInitStateNPFracSyst2020_NuOnly)
Definition: MECSysts.h:17
const NOvARwgtSyst kMECShapeSyst2020AntiNu("MECShape2020AntiNu","MEC 2020 (q_{0}, |#vec{q}|) response, antineutrinos", novarwgt::kMECQ0Q3RespSyst2020_NubarOnly)
Definition: MECSysts.h:12
std::vector< const ISyst * > get3FlavorAna2020LargeXsecSysts(const EAnaType2020 ana)
const PileupMuESyst2020 kPileupMuESyst2020(0.46, 1.3)
const NOvARwgtSyst kRPACCQESuppSyst2020("RPAShapesupp2020","RPA shape: low-Q^{2} suppression (2020)", novarwgt::kRPACCQESuppSyst2020)
Definition: RPASysts.h:18
const NOvARwgtSyst kMECEnuShapeSyst2020AntiNu("MECEnuShape2020AntiNu","MEC E_{#nu} shape, antineutrinos", novarwgt::kMECEnuShapeSyst2020_NubarOnly)
Definition: MECSysts.h:15
void Add3FlavorAna2020NotCorrelSysts(std::vector< const ISyst * > &systs, const EAnaType2020 ana, const BeamType2020 beam, const bool ptExtrap)
void Add3FlavorAna2020XSecSysts(std::vector< const ISyst * > &systs, const EAnaType2020 ana, bool smallgenie)
const SummedSyst * get3FlavorAna2020SummedSmallXsecSysts(const EAnaType2020 ana)
std::vector< const ISyst * > get3FlavorAna2020AllSysts(const EAnaType2020 ana, const bool smallgenie, const BeamType2020 beam, const bool isFit, const bool ptExtrap)
const CorrMuEScaleSyst2020 kCorrMuEScaleSyst2020(0.0074, 0.0074, 0.0013)
const UnCorrNDMuEScaleSyst2020 kUnCorrNDMuEScaleSyst2020(0.0013)
const DummyAnaSyst kAnaLightlevelNDSyst("Light_Level_ND","Light_Level_ND")
void Add3FlavorAna2020BeamSysts(std::vector< const ISyst * > &systs, const EAnaType2020 ana)
const UnCorrMuCatMuESyst2020 kUnCorrMuCatMuESyst2020(0.0048)
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 DummyAnaSyst kAnaCalibDriftSyst("CalibDrift","CalibDrift")
std::vector< const ISyst * > get3FlavorAna2020AllCPTSysts(const EAnaType2020 ana, const bool smallgenie, const BeamType2020 beam, const bool isFit, const bool ptExtrap)
const LeptonAngleSyst kLeptonAngleSystFDYZ2020("LeptonAngleSystFDYZ2020","Lepton Angle Syst FD YZ", caf::kFARDET, kAngleShiftYZ, 0.010)
Definition: AngleSysts.h:37
const NOvARwgtSyst kRadCorrNue("radcorrnue","Radiative corrections for #nu_{e}", novarwgt::kSimpleRadiativeCorrNueXsecSystKnob)
Radiative corrections syst (nues). See documentation in NOvARwgt.
Definition: XSecSysts.h:64
void Add3FlavorAna2020CalibSysts(std::vector< const ISyst * > &systs)
std::vector< const ISyst * > getAna2020NumuOnly(const BeamType2020 beam)
const NueAcceptSystSignalKin2020RHC kNueAcceptSystSignalKinPtExtrap2020RHC(ana::kExtrapPt,"accept_signalkin_pTextrap_RHC_2020")
const DummyAnaSyst kAnaCalibShapeSyst("CalibShape","CalibShape")
const DummyRockScaleSyst kRockScaleSyst
const NOvARwgtSyst kMECEnuShapeSyst2020Nu("MECEnuShape2020Nu","MEC E_{#nu} shape, neutrinos", novarwgt::kMECEnuShapeSyst2020_NuOnly)
Definition: MECSysts.h:14
GeniePCASyst * GetGeniePrincipals2020Small(int PCIdx)
enum BeamMode string
const NueAcceptSystSignalKin2020RHC kNueAcceptSystSignalKin2020RHC