13 std::map<std::string, rwgt::ReweightLabel_t> shiftlabels;
15 shiftlabels[
"ReweightMaNCEL"] = rwgt::fReweightMaNCEL;
16 shiftlabels[
"ReweightEtaNCEL"] = rwgt::fReweightEtaNCEL;
18 shiftlabels[
"ReweightMaCCQEshape"] = rwgt::fReweightMaCCQEshape;
19 shiftlabels[
"ReweightNormCCQE"] = rwgt::fReweightNormCCQE;
21 shiftlabels[
"ReweightCCQEPauliSupViaKF"] = rwgt::fReweightCCQEPauliSupViaKF;
22 shiftlabels[
"ReweightVecCCQEshape"] = rwgt::fReweightVecCCQEshape;
23 shiftlabels[
"ReweightCCQEMomDistroFGtoSF"] = rwgt::fReweightCCQEMomDistroFGtoSF;
30 shiftlabels[
"ReweightMaCCRES"] = rwgt::fReweightMaCCRES;
31 shiftlabels[
"ReweightMvCCRES"] = rwgt::fReweightMvCCRES;
32 shiftlabels[
"ReweightMaNCRES"] = rwgt::fReweightMaNCRES;
33 shiftlabels[
"ReweightMvNCRES"] = rwgt::fReweightMvNCRES;
34 shiftlabels[
"ReweightMaCOHpi"] = rwgt::fReweightMaCOHpi;
35 shiftlabels[
"ReweightR0COHpi"] = rwgt::fReweightR0COHpi;
36 shiftlabels[
"ReweightRvpCC1pi"] = rwgt::fReweightRvpCC1pi;
37 shiftlabels[
"ReweightRvpCC2pi"] = rwgt::fReweightRvpCC2pi;
38 shiftlabels[
"ReweightRvnCC1pi"] = rwgt::fReweightRvnCC1pi;
39 shiftlabels[
"ReweightRvnCC2pi"] = rwgt::fReweightRvnCC2pi;
40 shiftlabels[
"ReweightRvpNC1pi"] = rwgt::fReweightRvpNC1pi;
41 shiftlabels[
"ReweightRvpNC2pi"] = rwgt::fReweightRvpNC2pi;
42 shiftlabels[
"ReweightRvnNC1pi"] = rwgt::fReweightRvnNC1pi;
43 shiftlabels[
"ReweightRvnNC2pi"] = rwgt::fReweightRvnNC2pi;
44 shiftlabels[
"ReweightRvbarpCC1pi"] = rwgt::fReweightRvbarpCC1pi;
45 shiftlabels[
"ReweightRvbarpCC2pi"] = rwgt::fReweightRvbarpCC2pi;
46 shiftlabels[
"ReweightRvbarnCC1pi"] = rwgt::fReweightRvbarnCC1pi;
47 shiftlabels[
"ReweightRvbarnCC2pi"] = rwgt::fReweightRvbarnCC2pi;
48 shiftlabels[
"ReweightRvbarpNC1pi"] = rwgt::fReweightRvbarpNC1pi;
49 shiftlabels[
"ReweightRvbarpNC2pi"] = rwgt::fReweightRvbarpNC2pi;
50 shiftlabels[
"ReweightRvbarnNC1pi"] = rwgt::fReweightRvbarnNC1pi;
51 shiftlabels[
"ReweightRvbarnNC2pi"] = rwgt::fReweightRvbarnNC2pi;
52 shiftlabels[
"ReweightAhtBY"] = rwgt::fReweightAhtBY;
53 shiftlabels[
"ReweightBhtBY"] = rwgt::fReweightBhtBY;
54 shiftlabels[
"ReweightCV1uBY"] = rwgt::fReweightCV1uBY;
55 shiftlabels[
"ReweightCV2uBY"] = rwgt::fReweightCV2uBY;
60 shiftlabels[
"ReweightNormDISCC"] = rwgt::fReweightNormDISCC;
61 shiftlabels[
"ReweightRnubarnuCC"] = rwgt::fReweightRnubarnuCC;
62 shiftlabels[
"ReweightDISNuclMod"] = rwgt::fReweightDISNuclMod;
63 shiftlabels[
"ReweightAGKY_xF1pi"] = rwgt::fReweightAGKY_xF1pi;
64 shiftlabels[
"ReweightAGKY_pT1pi"] = rwgt::fReweightAGKY_pT1pi;
65 shiftlabels[
"ReweightFormZone"] = rwgt::fReweightFormZone;
66 shiftlabels[
"ReweightTheta_Delta2Npi"] = rwgt::fReweightTheta_Delta2Npi;
67 shiftlabels[
"ReweightBR1gamma"] = rwgt::fReweightBR1gamma;
68 shiftlabels[
"ReweightBR1eta"] = rwgt::fReweightBR1eta;
69 shiftlabels[
"ReweightMFP_N"] = rwgt::fReweightMFP_N;
70 shiftlabels[
"ReweightFrCEx_N"] = rwgt::fReweightFrCEx_N;
71 shiftlabels[
"ReweightFrElas_N"] = rwgt::fReweightFrElas_N;
72 shiftlabels[
"ReweightFrInel_N"] = rwgt::fReweightFrInel_N;
73 shiftlabels[
"ReweightFrAbs_N"] = rwgt::fReweightFrAbs_N;
74 shiftlabels[
"ReweightFrPiProd_N"] = rwgt::fReweightFrPiProd_N;
75 shiftlabels[
"ReweightMFP_pi"] = rwgt::fReweightMFP_pi;
76 shiftlabels[
"ReweightFrCEx_pi"] = rwgt::fReweightFrCEx_pi;
77 shiftlabels[
"ReweightFrElas_pi"] = rwgt::fReweightFrElas_pi;
78 shiftlabels[
"ReweightFrInel_pi"] = rwgt::fReweightFrInel_pi;
79 shiftlabels[
"ReweightFrAbs_pi"] = rwgt::fReweightFrAbs_pi;
80 shiftlabels[
"ReweightFrPiProd_pi"] = rwgt::fReweightFrPiProd_pi;
84 shiftlabels[
"mecScale"] = rwgt::kReweightNull;
85 shiftlabels[
"RPA"] = rwgt::kReweightNull;
87 std::string labelRecoE =
"Calorimetric Energy (GeV)";
88 std::vector<std::string> cut_samples;
89 cut_samples.push_back(
"Ana01");
94 std::map<std::string, IDecomp*> decomps_nominal;
95 std::map<std::string, std::map<std::string, std::map<int, IDecomp*> > > decomps_shifted;
96 std::map<std::string, PredictionNoExtrap*> predsNE_nominal;
97 std::map<std::string, std::map<std::string, std::map<int, PredictionNoExtrap*> > > predsNE_shifted;
98 std::map<std::string, PredictionSterile*> predsSt_nominal;
99 std::map<std::string, std::map<std::string, std::map<int, PredictionSterile*> > > predsSt_shifted;
104 std::string loadLocation = folder + filenm +
".root";
105 std::string saveLocation = folder + filenm +
"Ana.root";
106 std::string textLocation = folder + filenm +
"Ana.txt";
108 TFile* rootL =
new TFile(loadLocation.c_str(),
"READ");
109 LoadMaps(rootL, &decomps_nominal, &decomps_shifted);
110 LoadMaps(rootL, &predsNE_nominal, &predsNE_shifted);
111 LoadMaps(rootL, &predsSt_nominal, &predsSt_shifted);
114 TFile* rootF =
new TFile(saveLocation.c_str(),
"RECREATE");
116 textF = fopen(textLocation.c_str(),
"w");
118 for(
const auto& sample : cut_samples) {
129 TH1* hNomNC_decomp =
GetNC(decomps_nominal[sample],
NCSCALE);
130 TH1* hNomBG_decomp =
GetBG(decomps_nominal[sample],
NCSCALE);
132 TH1* hNomNC_predNE =
GetNC(predsNE_nominal[sample],
NCSCALE);
133 TH1* hNomBG_predNE =
GetBG(predsNE_nominal[sample],
NCSCALE);
135 TH1* hNomNC_predSt =
GetNC(predsSt_nominal[sample],
NCSCALE);
136 TH1* hNomBG_predSt =
GetBG(predsSt_nominal[sample],
NCSCALE);
138 for(
const auto& shifts : shiftlabels) {
139 if(shifts.first.compare(
"RPA") != 0 &&
140 shifts.first.compare(
"mecScale") != 0) {
141 ISyst*
temp =
new GenieRwgtTableSyst(shifts.second);
146 if(shifts.first.compare(
"RPA") == 0) {
148 strs.
fSystL =
"RPA Weight";
152 strs.
fSystL =
"MEC Scale";
159 decomps_shifted[sample][shifts.first],
160 rootF, textF, strs,
NCSCALE,
true,
false);
164 decomps_shifted[sample][shifts.first],
165 rootF, textF, strs,
NCSCALE,
false,
false);
170 predsNE_shifted[sample][shifts.first],
171 rootF, textF, strs,
NCSCALE,
true,
false);
175 predsNE_shifted[sample][shifts.first],
176 rootF, textF, strs,
NCSCALE,
false,
false);
181 predsSt_shifted[sample][shifts.first],
182 rootF, textF, strs,
NCSCALE,
true,
false);
186 predsSt_shifted[sample][shifts.first],
187 rootF, textF, strs,
NCSCALE,
false,
false);
215 std::cout <<
"Finished. Ctrl+Z should be safe if the macro didn't quit." <<
std::endl;
Cuts and Vars for the 2020 FD DiF Study.
virtual const std::string & ShortName() const final
The name printed out to the screen.
void PlotSyst(TH1 *h, TH1 *hp1, TH1 *hm1, TH1 *hp2, TH1 *hm2, TDirectory *out, FILE *text, strings strs)
Encapsulate code to systematically shift a caf::SRProxy.
TH1 * GetNC(IDecomp *specs, double POT)
void InitializeSystText(FILE *text, strings strs)
Print some initial text about a systematic – the systematic type and sample.
void PlotSystBand(TH1 *h, TDirectory *out, FILE *text, strings strs)
virtual const std::string & LatexName() const final
The name used on plots (ROOT's TLatex syntax)
void LoadMaps(TDirectory *dir, std::map< std::string, IDecomp * > *nominal, std::map< std::string, std::map< std::string, std::map< int, IDecomp * > > > *shifted)
TH1 * GetBG(IDecomp *specs, double POT)
std::string StringFromDouble(double pot)
A helper structure to contain a group of string for plotting.