plot_nue_filesyst_pred.C
Go to the documentation of this file.
6 #include "CAFAna/Core/HistAxis.h"
8 #include "CAFAna/Core/Ratio.h"
9 #include "CAFAna/Core/Spectrum.h"
11 #include "CAFAna/Cuts/TimingCuts.h"
12 #include "CAFAna/Cuts/Cuts.h"
13 #include "CAFAna/Cuts/NueCutsSecondAna.h"
15 #include "CAFAna/Cuts/SpillCuts.h"
16 #include "CAFAna/Decomp/IDecomp.h"
23 #include "CAFAna/Vars/HistAxes.h"
25 #include "CAFAna/Vars/Vars.h"
26 
27 #include "OscLib/IOscCalc.h"
28 
30 
32 
33 #include "TCanvas.h"
34 #include "TFile.h"
35 #include "TH1.h"
36 #include "TLegend.h"
37 #include "TPad.h"
38 #include "TDirectory.h"
39 
40 
41 using namespace ana;
42 
43 
44 
46 {
47  std::cout << "Let's go...." << std::endl;
48 
49  std::string fname = "foutNew200.root";
50 
51  const int kNumPreds = 2;
52  const std::string predNames[kNumPreds] = {"pred_propDecomp", "pred_comboDecomp"};
53 
54  const int kNumSysts = 3;
55  const std::string systNames[kNumSysts] = {"Nominal", "Calibration", "Lightlevel"};
56 
57  const int kNumShifts = 3;
58  const std::string shiftNames[kNumShifts] = {"noShift","plusOne", "minusOne"};
59 
60  const int kNumPlots = 5;
61  const std::string varNames[kNumPlots] = {"shwCalE", "hadCalE", "recoNuE", "id_cvne", "EnergyCVN2D"};
62 
63 
64  for(int predIdx = 0; predIdx < 1; ++predIdx)
65  {
66  const char* predName = predNames[predIdx].c_str();
67  std::cout << "predName" << predName << std::endl;
68 
69  for(int varIdx = 0; varIdx < kNumPlots; ++varIdx)
70  {
71  const char* varName = varNames[varIdx].c_str();
72  std::cout << "varName" << varName << std::endl;
73 
74  PredictionExtrap* predsPropNom = LoadFromFile<PredictionExtrap>(fname, TString::Format("%s/%s/%s/nue_pred_%s", predName, systNames[0].c_str(), shiftNames[0].c_str(), varName).Data()).release();
75 
76  for(int systIdx = 1; systIdx < kNumSysts; ++systIdx)
77  {
78  const char* systName = systNames[systIdx].c_str();
79  std::cout << "systName" << systName << std::endl;
80 
81 
82  PredictionExtrap* predsPropPlus = LoadFromFile<PredictionExtrap>(fname, TString::Format("%s/%s/%s/nue_pred_%s", predName, systName, shiftNames[1].c_str(), varName).Data()).release();
83 
84  PredictionExtrap* predsPropMinus = LoadFromFile<PredictionExtrap>(fname, TString::Format("%s/%s/%s/nue_pred_%s", predName, systName, shiftNames[2].c_str(), varName).Data()).release();
85 
86 
87  ComparePredictions (predsPropNom, predsPropPlus, predsPropMinus, predName, systName, varName, varIdx);
88 
89  PredRatioToNom (predsPropNom, predsPropPlus, predsPropMinus, predName, systName, varName, varIdx);
90 
91 
92  } // end of systIdx
93 
94  } // end of varIdx
95 
96  } // end of predtIdx
97 
98 
99 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
void PredRatioToNom(PredictionExtrap *predPropMC, PredictionExtrap *predPropMCPlus, PredictionExtrap *predPropMCMinus, const std::string &predName, const std::string &systName, const std::string &varName, int varIdx)
Definition: NueSystFuncs.h:124
const int kNumPlots
Definition: GetSpectra.h:1
OStream cout
Definition: OStream.cxx:6
std::map< std::string, std::string > systNames
Definition: PlotUnfolding.C:32
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
Take the output of an extrapolation and oscillate it as required.
void plot_nue_filesyst_pred()
void ComparePredictions(IPrediction *pred_no, IPrediction *pred_sh, TString plottitle, TString out_name, TString pidtag, bool printtable=true, bool pidaxis=false)
enum BeamMode string