syst_variations.h
Go to the documentation of this file.
1 #pragma once
2 
3 
5 #include "CAFAna/Core/Loaders.h"
6 #include "CAFAna/Cuts/Cuts.h"
11 #include "CAFAna/Systs/XSecSysts.h"
13 #include "CAFAna/Systs/BeamSysts.h"
22 
23 #include <TFile.h>
24 #include <TString.h>
25 #include <vector>
26 #include <iostream>
27 
28 
29 using namespace ana;
30 
31 ana::Loaders * GetLoaders2017 (const TString option, const TString period="full"){
32 
33  Loaders * loaders = new Loaders();
34 
35  auto caftype = ana::ECAFType::kDecaf ;
36 
37  if (option.Contains("cafs")) caftype = ana::ECAFType::kFullCAF;
38  if (option.Contains("nueconcat")) caftype = ana::ECAFType::kNueConcat;
39  if (option.Contains("numuconcat")) caftype = ana::ECAFType::kNumuConcat;
40 
41  if(option.Contains("CalibrationUp")) loaders = new Prod3AbsCalibLoaders(caftype, +1, period.Data());
42  else if(option.Contains("CalibrationDown")) loaders = new Prod3AbsCalibLoaders(caftype, -1, period.Data());
43  else if(option.Contains("CalibShape")) loaders = new Prod3CalibShapeLoaders(caftype, period.Data());
44  else if(option.Contains("Cherenkov")) loaders = new Prod3CherenkovLoaders(caftype, period.Data());
45  else if(option.Contains("LightLevelUp")) loaders = new Prod3LightLevelLoaders(caftype,+1, period.Data());
46  else if(option.Contains("LightLevelDown")) loaders = new Prod3LightLevelLoaders(caftype,-1,period.Data());
47  else if(option.Contains("LightLevelNom")) loaders = new Prod3LightLevelLoaders(caftype, 0,period.Data());
48  else if(option.Contains("RelativeCalib")){
49  int sign = (option.Contains("Up") ? +1:-1);
50  loaders = new Prod3AbsCalibLoaders(caftype, sign, period.Data());
51  auto temploaders = new Prod3AbsCalibLoaders(caftype, - sign, period.Data());
52  auto oppositeNDMC = temploaders->GetLoaderPath(caf::kNEARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap);
54  std::cout << "Swapped calibration loader" << oppositeNDMC << std::endl;
55  delete temploaders;
56  }
57  else if (option.Contains("NoTau") ) {
59  if (option.Contains("2sigmaNoTau") ){
60  std::string posneg = (option.Contains("Up")) ? "pos" : "neg";
61  std::string NonSwa = "prod_decaf_R17-03-01-prod3reco.m_fd_genie_nonswap_fhc_nova_v08_full_calib-shift-fd-xyview-"+posneg+"-offset-2sigma_nue_or_numu_or_nus_contain_v1";
62  std::string FluSwa = "prod_decaf_R17-03-01-prod3reco.m_fd_genie_fluxswap_fhc_nova_v08_full_calib-shift-fd-xyview-"+posneg+"-offset-2sigma_nue_or_numu_or_nus_contain_v1";
65  }
66  }
67  else loaders = new Prod3NomLoaders (caftype, period.Data());
68 
69  if(option.Contains("RHC")) {
70  std::cout << "\nWARNING using RHC datasets with the 2017 FHC-optimized analysis "
71  << "\nThis is unofficial!! You've been warned\n\n";
72  loaders = new Prod3NomLoaders(caftype, period.Data(), "full", Loaders::kRHC);
73  }
74 
75  return loaders;
76 }
77 
78 // Use the shifted ND MC as fake data
79 // Use Swap** below to use nominal NDMC as fake data instead
80 ana::Loaders * GetLoaders2017FakeData (const TString option, const TString period="full"){
81 
82  Loaders * loaders, *temploaders;
83 
84  auto caftype = ana::ECAFType::kDecaf ;
85 
86  if (option.Contains("nueconcat")) caftype = ana::ECAFType::kNueConcat;
87  if (option.Contains("numuconcat")) caftype = ana::ECAFType::kNumuConcat;
88 
89  if(option.Contains("LightLevel")) loaders = new Prod3LightLevelLoaders(caftype, 0,period.Data());
90  else loaders = new Prod3NomLoaders (caftype, period.Data());
91 
92  if(option.Contains("Nom")) {
93  std::cerr << "You picked fake data = nominal MC. "
94  <<"This is a silly in and out test, and all your ratios will be one. "
95  <<"\nEdit the code if this is truly what you want" << std::endl;
96  exit(1);
97  }
98 
99  if(option.Contains("CalibrationUp")) temploaders = new Prod3AbsCalibLoaders(caftype, +1, period.Data());
100  else if(option.Contains("CalibrationDown")) temploaders = new Prod3AbsCalibLoaders(caftype, -1, period.Data());
101  else if(option.Contains("CalibShape")) temploaders = new Prod3CalibShapeLoaders(caftype, period.Data());
102  else if(option.Contains("Cherenkov")) temploaders = new Prod3CherenkovLoaders(caftype, period.Data());
103  else if(option.Contains("LightLevelUp")) temploaders = new Prod3LightLevelLoaders(caftype,+1, period.Data());
104  else if(option.Contains("LightLevelDown")) temploaders = new Prod3LightLevelLoaders(caftype,-1,period.Data());
105  else temploaders = new Prod3NomLoaders (caftype, period.Data());
106 
107  if(option.Contains("RHC")) temploaders = new Prod3NomLoaders(caftype, period.Data(), "full", Loaders::kRHC);
108 
109  auto shiftedMCpath = temploaders->GetLoaderPath(caf::kNEARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap);
111  std::cout << "Swapped real data loader for " << shiftedMCpath << std::endl;
112  return loaders;
113 }
114 
115 void SwapNDDataLoader(Loaders* loaders, const TString option, const TString period="full")
116 {
117  auto caftype = ana::ECAFType::kDecaf;
118  auto flxtype = option.Contains("RHC") ? Loaders::kRHC : Loaders::kFHC;
119 
120  if (option.Contains("cafs")) caftype = ana::ECAFType::kFullCAF;
121  if (option.Contains("nueconcat")) caftype = ana::ECAFType::kNueConcat;
122  if (option.Contains("numuconcat")) caftype = ana::ECAFType::kNumuConcat;
123 
124  auto temploaders = new Prod3NomLoaders (caftype, period.Data(), "full", flxtype);
125  auto nominalNDMC = temploaders->GetLoaderPath(caf::kNEARDET, Loaders::kMC, ana::kBeam, Loaders::kNonSwap);
126  delete temploaders;
127  std::cout << "\n\nSwapping ND Data for fake data \n\n";
128  std::cout << "Before "
130  << "\n";
132  std::cout << "After "
134  << std::endl << std::endl;
135 }
136 
137 //////////////////////////////////////////////////////////////////////
138 std::vector <const ISyst*> GetSystematics2017 (const TString option)
139 {
140  std::vector <const ISyst*> ret;
141 
142  if(option.Contains("BeamTransport")){
143  ret = { & kBeamHornCurrent,
144  & kBeamSpotSize,
145  & kBeamPosX,
146  & kBeamPosY,
147  & kBeamH1PosX,
148  & kBeamH1PosY,
149  & kBeamH2PosX,
150  & kBeamH2PosY,
151  & kBeamTarget,
152  & kBeamMagField,
154  };
155  }
156  else if(option.Contains("BeamAllTransport")){
157  ret = { & kBeamAllTransport };
158  }
159  else if(option.Contains("PPFXSyst")){
160  for (int i =0; i<15; i++){
161  ret.push_back(GetPPFXPrincipals(i));
162  }
163  }
164  else if(option.Contains("XSecSyst") ){
165  auto geniesysts = getAllXsecSysts_2017();
166  int minsyst=0, maxsyst=geniesysts.size();
167  if(option.Contains("XSecSyst_Frac")){ minsyst= 0; maxsyst=3;
168  std::cout << "\n\nOnly looking at a small range; " << minsyst << " -- " << maxsyst << "\n\n" << std::endl;}
169  if(option.Contains("XSecSyst_1of6")){ minsyst= 0; maxsyst=14;}
170  if(option.Contains("XSecSyst_2of6")){ minsyst=14; maxsyst=28;}
171  if(option.Contains("XSecSyst_3of6")){ minsyst=28; maxsyst=42;}
172  if(option.Contains("XSecSyst_4of6")){ minsyst=42; maxsyst=56;}
173  if(option.Contains("XSecSyst_5of6")){ minsyst=56; maxsyst=70;}
174  if(option.Contains("XSecSyst_6of6")){ minsyst=70; maxsyst=84;}
175 
176  for(int i = minsyst; i < maxsyst; ++i) {
177  if (i >= (int)geniesysts.size()) break;
178  ret.push_back(geniesysts[i]);
179  }
180  }
181  else if (option.Contains ("NumuEnergySyst")){
182  ret = {
183  &kMuEScaleSyst2017, // 1.0% abs (FD + ND) muon E scale applied to muon track length
184  &kRelMuEScaleSyst2017, // .76% rel (FD only) muon E scale applied to muon track length
185  &kDirectHadEScaleSyst2017, // 5% hadronic energy scale shift.
186  &kDirectRelHadEScaleSyst2017 // The relative hadronic energy scale shift
187  };
188  }
189  else if (option.Contains ("NueExtrapSyst")){
190  ret = {
193  };
194  }
195  else if(option.Contains("AllSmall")){
197  }
198  else if (option.Contains("NuMuSmall")){
200  }
201 
202  return ret;
203 }
204 
205 
206 
207 struct ShiDef {
208  TString syst_name;
209  TString sigma_name;
211 };
212 
213 std::vector <ShiDef> GetShifts2017 (const TString option) {
214 
215  std::vector <ShiDef> ret;
216 
217  if(option.Contains("BeamTransport") ||
218  option.Contains("BeamAllTransport") ||
219  option.Contains("PPFXSyst") ||
220  option.Contains("XSecSyst") ||
221  option.Contains("NumuEnergySyst") ||
222  option.Contains("NueExtrapSyst") ||
223  option.Contains("AllSmall") ||
224  option.Contains("NuMuSmall")
225  ){
226  auto systs = GetSystematics2017(option);
227 
228  for (auto syst:systs){
229  for (auto sigma:{+2,+1,-1,-2}) {
230  TString sig_str = (sigma>0?"plus":"minus");
231  if(abs(sigma)==1) sig_str+="One";
232  if(abs(sigma)==2) sig_str+="Two";
233  ret.push_back({syst->ShortName(),sig_str,SystShifts(syst,sigma)});
234  std::cout << setw(40) << (TString) "Added " + syst->ShortName() + "_" + sig_str + " || ";
235  }//end sigmas
236  std::cout << std::endl;
237  }//end systs
238  }//end beam or xsec
239  else {
240  TString topstr, lowstr;
241  topstr = "Nominal"; lowstr= "noShift";
242 
243  if (option.Contains("CalibrationUp")) { topstr= "Calibration"; lowstr="plusOne";}
244  else if(option.Contains("CalibrationDown")) { topstr= "Calibration"; lowstr="minusOne";}
245  else if(option.Contains("RelativeCalibUp")) { topstr= "RelativeCalib";lowstr="plusTwo";}
246  else if(option.Contains("RelativeCalibDown")){ topstr= "RelativeCalib";lowstr="minusTwo";}
247  else if(option.Contains("CalibShape")) { topstr= "CalibShape"; lowstr="plusOne"; }
248  else if(option.Contains("Cherenkov")) { topstr= "Cherenkov"; lowstr="plusOne"; }
249  else if(option.Contains("LightLevelUp")) { topstr= "Lightlevel"; lowstr="plusOne";}
250  else if(option.Contains("LightLevelDown")) { topstr= "Lightlevel"; lowstr="minusOne";}
251  else if(option.Contains("LightLevelNom")) { topstr= "Lightlevel"; lowstr="noShift";}
252  else if(option.Contains("CalibrationUp_2sigmaNoTau" ) ){ topstr= "Calibration";lowstr="plusTwo"; }
253  else if(option.Contains("CalibrationDown_2sigmaNoTau") ){ topstr= "Calibration";lowstr="minusTwo"; }
254  else if(option.Contains("RPA2018")) {topstr = "RPA2018"; lowstr = "noShift"; }
255 
256  ret = {{topstr, lowstr,kNoShift}};
257  }
258  return ret;
259 }
260 
261 
262 struct SNameDef{
263  const TString syst_name;//shift.syst_name
264  std::vector<TString> sigma_names;//shift.sigma_name
265 };
266 
267 std::vector<SNameDef> GetShiftNames2017(const TString opt = "all"){
268 
269  std::vector <SNameDef> names;
270 
271  if(opt=="test"){
272  names.push_back( { "RPA2018",{"noShift"} });
273  names.push_back( { "SumSmallXSecJoint2017",{"plusOne","minusOne","plusTwo","minusTwo"}});
274 // names.push_back( { "extrap_signalkin",{"plusOne","minusOne","plusTwo","minusTwo"}});
275 // names.push_back( { "extrap_bkg",{"plusOne","minusOne","plusTwo","minusTwo"}});
276  }
277  if(opt=="Calibration" || opt.Contains("all")) names.push_back( { "Calibration", {"plusOne","minusOne"} } );
278  //if(opt=="Calibration" || opt.Contains("all")) names.push_back( { "Calibration",{"plusOne","minusOne","plusTwo","minusTwo"} } );
279  if(opt=="RelativeCalib" || opt.Contains("all")) names.push_back( { "RelativeCalib",{"plusTwo","minusTwo"} } );
280  if(opt=="CalibShape" || opt.Contains("all")) names.push_back( { "CalibShape", {"plusOne"} });
281  if(opt=="Cherenkov" || opt.Contains("all")) names.push_back( { "Cherenkov", {"plusOne"} });
282  if(opt=="Lightlevel" || opt.Contains("all")) names.push_back( { "Lightlevel", {"plusOne","minusOne"} });
283 // if(opt=="RPA2018" || opt.Contains("all")) names.push_back( { "RPA2018",{"noShift"} } );
284 
285  if(opt.Contains("all") && opt.Contains("Reduced") ) {
286  std::vector <const ISyst*> systs;
287  const ISyst* s;
288  if(!opt.Contains("Super") ) {
289  systs = {&kMECq0ShapeSyst2017,
291  GetGenieKnobSyst(rwgt::fReweightMaCCRES),
292  GetGenieKnobSyst(rwgt::fReweightMaNCRES),
293  GetGenieKnobSyst(rwgt::fReweightMvCCRES),
295  &kDISvnCC1pi,
297  &kRadCorrNue,
301  for (int i =0; i<5; i++){
302  systs.push_back(GetPPFXPrincipals(i));
303  }
304  }
305  // Some nue specific ones...
306  if(opt.Contains("Nue") ) {
307  systs.push_back(&kNueExtrapSystSignalKin2017);
308  systs.push_back(&kNueExtrapSystBkg2017);
309  }
310  if(opt.Contains("Numu") ) {
311  systs.push_back(&kMuEScaleSyst2017);
312  systs.push_back(&kRelMuEScaleSyst2017);
313  systs.push_back(&kDirectHadEScaleSyst2017);
314  systs.push_back(&kDirectRelHadEScaleSyst2017);
316  }
317  // Want kBeamAll
318  systs.push_back(&kBeamAllTransport);
319  // Fill names with the systs we've just added..
320  for (auto const & syst:systs)
321  names.push_back( { syst->ShortName(),{"plusOne","minusOne","plusTwo","minusTwo"}} );
322  }
323  if(opt=="all"){
324  for( auto c:{"BeamTransport","BeamAllTransport","PPFXSyst","NumuEnergySyst","NueExtrapSyst","AllSmall","XSecSyst"} ){ //nue wants XSec to be last
325  auto systs = GetSystematics2017(c);
326  for (auto const & syst:systs)
327  names.push_back( { syst->ShortName(),{"plusOne","minusOne","plusTwo","minusTwo"}} );
328  }//end beam or xsec
329  }
330  else {
331  auto systs = GetSystematics2017(opt);
332  for (auto const & syst:systs)
333  names.push_back( { syst->ShortName(),{"plusOne","minusOne","plusTwo","minusTwo"}} );
334  }
335  return names;
336 }
337 
338 ////////////////////////////////////////////////////////////
339 ////////////////////////////////////////////////////////////
340 
341  //Numu ND
342  // const Cut cut_numund_SA = kNumuND;
343  // const HistAxis axis_numu_SA = kNumuNonQEAxisFirstAna;
346 // NuMu Reconstructed Muon Energy
347 const HistAxis axis_muEn("Reconstructed Muon Energy (GeV)", kNumuCCEOptimisedBinning, kMuE);
348 // NuMu Hadronic energy fraction
349 const HistAxis axis_HadEFrac("Hadronic Energy Fraction", Binning::Simple(50, 0.0, 1.01), kHadEFrac);
350 
351  //nue ND
354 
355  //Nue FD
356  const Cut cut_nuefd_all = kNue2017FDAllSamples; //core and peripheral
358 
359  //Numu FD
361 
362  //Same 3 CVN Bins for SA and 2017; upgrade var to 2017
364  const HistAxis axis_nue_3bin ("Nue Energy / CVN", kNue2DBinning, tempEnergyCVN2D);
366  const HistAxis axis_nue_1bin ("Reconstructed neutrino energy (GeV)",
368 
369  struct ExtrapDef{
370  TString name;
371  const HistAxis axis;
372  const Cut fdcut;
373  const Cut nuendcut;
374  const Cut numundcut;
375  };
376  //all 2017 cuts, with 3 or 4 bins
377 
378  std::vector <ExtrapDef> GetExtrapolationDefs (const TString analysis, const TString period){
379  std::vector <ExtrapDef> ret;
380  if(analysis.Contains("nue")){
381  ret.push_back ({"EnergyCVN2D_3bin",axis_nue_3bin, cut_nuefd_core, cut_nuend, cut_numund});
382  ret.push_back ({"EnergyCVN2D", axis_nue_4bin, cut_nuefd_all, cut_nuend, cut_numund});
383  //ret.push_back ({"Energy_1bin", axis_nue_1bin, cut_nuefd_core, cut_nuend, cut_numund});
384  }
385  else if(analysis.Contains("numu")){
386 // TString fdspecfile = "/nova/app/users/karlwarb/Tag_S17-10-09/Workspace/NuMuSystematics/FDQuantileHists/final_" + period + "_FD_histo_for_quantile_cuts.root";
387  TString fdspecfile = "/nova/ana/nu_mu_ana/Ana2017/Quantiles/final_" + period + "_FD_histo_for_quantile_cuts.root";
388  TFile* inFile = TFile::Open(fdspecfile);
389  if(inFile->IsZombie()) {
390  std::cout << "Problem with file " << fdspecfile << std::endl;
391  abort();
392  }
393  gDirectory->cd("dir_FDSpec2D");
394  TH2 *FDSpec2D = (TH2*)inFile->FindObjectAny("FDSpec2D");
395  double nquantiles = 4;
396  std::vector<Cut> HadEFracQuantCuts = QuantileCutsFromTH2(FDSpec2D, kNumuCCOptimisedAxis,
397  kHadEFracAxis, nquantiles);
398  for(int i=0;i< nquantiles; ++i){
399  ret.push_back({"Energy_Quant" +std::to_string(i+1), axis_numu ,
400  cut_numufd && HadEFracQuantCuts[i], kNoCut, cut_numund && HadEFracQuantCuts[i]});
401  //ret.push_back({"MuonEn_Quant" +std::to_string(i+1), axis_muEn ,
402  // cut_numufd && HadEFracQuantCuts[i], kNoCut, cut_numund && HadEFracQuantCuts[i]});
403  //ret.push_back({"HadEFrac_Quant"+std::to_string(i+1), axis_HadEFrac,
404  // cut_numufd && HadEFracQuantCuts[i], kNoCut, cut_numund && HadEFracQuantCuts[i]})
405 
406  }
407  ret.push_back({"Energy", axis_numu, cut_numufd, kNoCut, cut_numund});
408  }
409  else {
410  std:: cerr << "Please mention nue or numu in analysis" << std::endl;
411  }
412 
413  return ret;
414  }
BeamSyst * GetPPFXPrincipals(int PCIdx)
Definition: BeamSysts.cxx:65
const Cut cut_nuefd_all
Near Detector underground.
Definition: SREnums.h:10
For nominal spectra and reweighting systs (xsec/flux)
Definition: Prod3Loaders.h:40
ana::Loaders * GetLoaders2017FakeData(const TString option, const TString period="full")
Far Detector at Ash River.
Definition: SREnums.h:11
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
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
const BeamSyst kBeamTarget((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"7mmTargetZ","+/- 7mm Target z Position")
Target z position shift +/-7mm.
Definition: BeamSysts.h:113
const Cut cut_numund
const Var kCVNe
PID
Definition: Vars.cxx:35
TString syst_name
const Cut kNumuCutFD2017
Definition: NumuCuts2017.h:39
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
const Binning kCVNNLBinning
Definition: Binnings.cxx:20
const HistAxis axis_HadEFrac("Hadronic Energy Fraction", Binning::Simple(50, 0.0, 1.01), kHadEFrac)
const BeamSyst kBeamHornCurrent((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"2kA","2kAHornCurrent","+/- 2kA Horn Current")
Horn Current +/-2kA.
Definition: BeamSysts.h:97
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
_Var< T > Var2D(const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb)
Variable formed from two input variables.
Definition: Var.cxx:247
const HistAxis kHadEFracAxis("E_{had.} / E_{#nu}", Binning::Simple(200, 0, 1), kHadEFrac)
HistAxis that implements Hadronic Energy fraction binning used by L.Vinton to derive Hadronic Energy ...
Definition: HistAxes.h:30
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 Cut fdcut
const Cut kNue2017NDCVNSsb
Definition: NueCuts2017.h:302
OStream cerr
Definition: OStream.cxx:7
const HistAxis axis_nue_3bin("Nue Energy / CVN", kNue2DBinning, tempEnergyCVN2D)
void DisableLoader(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Definition: Loaders.cxx:65
TString name
void abs(TH1 *hist)
const Cut numundcut
const Var tempEnergyCVN2D
const Cut kNue2017FD
Full FD nue selection for 2017 analysis.
Definition: NueCuts2017.h:130
std::vector< SNameDef > GetShiftNames2017(const TString opt="all")
std::vector< ShiDef > GetShifts2017(const TString option)
const HistAxis axis_nue_4bin
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
ana::Loaders * GetLoaders2017(const TString option, const TString period="full")
const Cut cut_nuend
const Binning kNueSAEnergyBinning
The energy part of the SA 2D binning.
Definition: Binnings.cxx:17
const BeamSyst kBeamGeomWater((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"1mmHornWater","+/- 1mm water on Horn 1")
Water layer on horn 1: +/- 1mm.
Definition: BeamSysts.h:128
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 Cut cut_numufd
std::string GetLoaderPath(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap) const
Definition: Loaders.cxx:89
ifstream inFile
Definition: AnaPlotMaker.h:34
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 BeamSyst kBeamH1PosX((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"3mmHorn1X","+/- 3mm Horn 1 X Position")
Horn 1 and 2 position +-3mm in X and Y separately.
Definition: BeamSysts.h:107
const HistAxis axis_muEn("Reconstructed Muon Energy (GeV)", kNumuCCEOptimisedBinning, kMuE)
const Var kNueEnergy2017([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;return NueRecoE_2017FDFit(kCVNemE(sr), kCVNhadE(sr));})
Definition: NueEnergy2017.h:11
const RelMuEScaleSyst2017 kRelMuEScaleSyst2017(0.0045, 10.5)
const Var kHadEFrac
Definition: NumuVars.h:24
TString sigma_name
const HistAxis axis_numu_for_nuesig
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:131
const DirectHadEScaleSyst2017 kDirectHadEScaleSyst2017(0.05)
const Cut kNumuCutND2017
Definition: NumuCuts2017.h:41
const HistAxis axis_nue_1bin("Reconstructed neutrino energy (GeV)", kNueSAEnergyBinning, kNueEnergy2017)
const NueExtrapSystSignalKin2017 kNueExtrapSystSignalKin2017
std::vector< ExtrapDef > GetExtrapolationDefs(const TString analysis, const TString period)
const HistAxis axis
std::vector< TString > sigma_names
const SummedSyst * getAna2017SummedSmallXsecSysts(const EAnaType2017 ana)
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39;...
Definition: HistAxes.h:24
const Binning kNue2DBinning
10 energy bins x 3 pid bins is 30 bins in 1D
Definition: Binnings.cxx:23
const NueExtrapSystBkg2017 kNueExtrapSystBkg2017
double sigma(TH1F *hist, double percentile)
const HistAxis kNue2017Axis("NuE Energy / Analysis Bin", kNue2017Binning, kNue2017AnaBin)
Definition: NueCuts2017.h:313
const SystShifts kNoShift
Definition: SystShifts.cxx:21
OStream cout
Definition: OStream.cxx:6
const BeamSyst kBeamPosY((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"1mmBeamShiftY","Beam Position Y")
Definition: BeamSysts.h:104
const DirectRelHadEScaleSyst2017 kDirectRelHadEScaleSyst2017(0.05)
const BeamSyst kBeamH1PosY((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"3mmHorn1Y","+/- 3mm Horn 1 Y Position")
Definition: BeamSysts.h:108
const TString syst_name
const HistAxis axis_numu
const BeamSyst kBeamSpotSize((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"0.2mmBeamSpotSize","0p2mmBeamSpotSize"," 1.3 +/- 0.2 mm Spot Size")
Beam Spot Size 1.3 +/- 0.2 mm both XY.
Definition: BeamSysts.h:100
const NOvARwgtSyst kMECq0ShapeSyst2017("MECq0Shape","MEC q_{0} shape", novarwgt::kMECq0ShapeSyst2017)
Definition: MECSysts.h:41
const BeamSyst kBeamH2PosX((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"3mmHorn2X","+/- 3mm Horn 2 X Position")
Definition: BeamSysts.h:109
std::vector< Loaders * > loaders
Definition: syst_header.h:386
const Binning kNumuCCEOptimisedBinning
Optimised binning for numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39; in that talk...
Definition: Binnings.cxx:28
exit(0)
std::vector< Cut > QuantileCutsFromTH2(TH2 *quantileHist, const HistAxis &independentAxis, const HistAxis &quantileAxis, const unsigned int &numQuantiles, const bool verbose)
: Do the same as the QuantileCuts function but taking in the TH2 instead of making it...
const NOvARwgtSyst kRPARESSyst2017("RPAShapeRES2017","RPA shape: resonance events", novarwgt::kRPARESSyst2017)
Definition: RPASysts.h:20
const BeamSyst kBeamPosX((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"1mmBeamShiftX","Beam Position X")
Beam position on target +-1 mm, X/Y separately.
Definition: BeamSysts.h:103
const Cut cut_nuefd_core
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
const BeamSyst kBeamH2PosY((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"3mmHorn2Y","+/- 3mm Horn 2 Y Position")
Definition: BeamSysts.h:110
const BeamSyst kBeamMagField((FindCAFAnaDir()+"/data/beam/TABeamSyst_2018Dec11.root"),"Magnetic Field in Decay Pipe","MagnFieldDecayPipe","Magnetic Field in Decay Pipe")
Constant magnetic field in decay pipe.
Definition: BeamSysts.h:116
const Var kMuE
Definition: NumuVars.h:22
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
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
SystShifts shift
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:107
const NOvARwgtSyst kRadCorrNue("radcorrnue","Radiative corrections for #nu_{e}", novarwgt::kSimpleRadiativeCorrNueXsecSystKnob)
Radiative corrections syst (nues). See documentation in NOvARwgt.
Definition: XSecSysts.h:64
void SwapNDDataLoader(Loaders *loaders, const TString option, const TString period="full")
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.
Definition: Cut.h:109
std::vector< const ISyst * > GetSystematics2017(const TString option)
std::vector< const ISyst * > getAllXsecSysts_2017()
Get master XSec syst list for 2017 analyses.
def sign(x)
Definition: canMan.py:197
const Cut nuendcut
const Cut kNue2017FDAllSamples
Our FD selection including all samples, for making predictions, etc.
Definition: NueCuts2017.h:155
enum BeamMode string