34 #include "TGraphAsymmErrors.h" 44 const std::vector<std::string>
kOutputExts = {
".png",
".eps",
".pdf",
".root"};
47 const std::map<const ISyst*, std::string>
kSystRename 70 TLatex *
prelim =
new TLatex(.9, .95,
"NOvA Simulation");
71 prelim->SetTextColor(kGray + 1);
73 prelim->SetTextSize(2 / 30.);
74 prelim->SetTextAlign(32);
81 auto beamLabel =
new TLatex(.15, .92, (beam ==
Loaders::kFHC ?
"Neutrino" :
"Antineutrino") + TString(
" beam"));
83 beamLabel->SetTextSize(0.04);
92 TLatex* quart =
new TLatex(.17, .75, Form(
"Quartile %i",q+1));
94 quart->SetTextSize(0.05);
101 TLatex *
text =
new TLatex(0.17,
top ? 0.83 : 0.2, name.c_str());
103 text->SetTextSize(1.5/30.);
109 TH1*
h = (TH1*) h1->Clone(
"h");
112 for(
int k = 1; k <= h1->GetNbinsX(); k++)
114 double val1 = (double) h1->GetBinContent(k);
115 double val2 = (double) h2->GetBinContent(k);
119 h->SetBinContent(k, (val1-val2) * 200./(val1 + val2));
128 return f->GetDirectory(dirName);
147 if (hornCurrStr ==
"FHC")
149 else if (hornCurrStr ==
"RHC")
153 std::cerr <<
"Unrecognized horn current string: '" << hornCurrStr <<
"'. Options are FHC, RHC." <<
std::endl;
156 std::transform(hornCurrStr.begin(), hornCurrStr.end(), hornCurrStr.begin(), ::tolower);
159 std::cout << std::flush;
161 gStyle->SetStatFormat(
"6.3g");
162 gStyle->SetPaintTextFormat(
"6.3g");
163 gStyle->SetFitFormat(
"6.3g");
175 const unsigned int kNumSysts = systs.size();
181 TFile* fPred =
new TFile( predFile.c_str() );
188 nominalPred[
i] = LoadFrom<PredictionNoExtrap>(
GetDir(fPred, Form(
"nominalPred_%i",
i))).
release();
190 for(
unsigned int k = 0; k < kNumSysts; k++)
192 predictionND[2*k][
i] = LoadFrom<PredictionInterp>(
GetDir(fPred, Form( (predNameND+
"_Pos_"+systs[k]->ShortName()+
"_%i").c_str(),
i) )).
release();
194 predictionND[2*k+1][
i] = LoadFrom<PredictionInterp>(
GetDir(fPred, Form( (predNameND+
"_Neg_"+systs[k]->ShortName()+
"_%i").c_str(),
i) )).
release();
198 predictionFD[2*k][
i] = LoadFrom<PredictionNoExtrap>(
GetDir(fPred, Form( (predNameFD+
"_Pos_"+systs[k]->ShortName()+
"_%i").c_str(),
i) )).
release();
200 predictionFD[2*k+1][
i] = LoadFrom<PredictionNoExtrap>(
GetDir(fPred, Form( (predNameFD+
"_Neg_"+systs[k]->ShortName()+
"_%i").c_str(),
i) )).
release();
206 std::cout <<
"Loading went OK. Plotting!" <<
std::endl;
208 for(
unsigned int i = 0;
i < kNumQuantiles +1;
i++)
211 hNominal->Scale(0.1,
"width");
213 hNominal->SetLineColor(kBlack);
214 double ymax = hNominal->GetBinContent(hNominal->GetMaximumBin()) * 2.0;
215 hNominal->GetYaxis()->SetRangeUser(0, 15);
216 hNominal->GetYaxis()->SetTitle(
"Events / (0.1 GeV)");
217 hNominal->GetYaxis()->CenterTitle();
218 hNominal->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
219 hNominal->GetXaxis()->CenterTitle();
221 for (
unsigned int k = 0; k < kNumSysts; k++)
223 std::string fullName = hornCurrStr+
"_ccE_"+systs[k]->ShortName();
225 TCanvas*
c =
new TCanvas(
"c",(fullName).c_str());
227 c->SetBottomMargin(0.15);
228 c->SetLeftMargin(0.15);
231 hShiftND_up->Scale(0.1,
"width");
233 hShiftFD_up->Scale(0.1,
"width");
236 hShiftND_dn->Scale(0.1,
"width");
238 hShiftFD_dn->Scale(0.1,
"width");
240 hShiftND_up->SetLineColor(
kOrange+1);
241 hShiftND_up->SetLineStyle(2);
243 hShiftND_dn->SetLineColor(
kViolet+1);
244 hShiftND_dn->SetLineStyle(2);
246 hShiftFD_up->SetMarkerStyle(20);
247 hShiftFD_up->SetMarkerColor(
kOrange+1);
248 hShiftFD_up->SetLineWidth(0);
249 hShiftFD_up->SetLineColor(0);
250 hShiftFD_dn->SetMarkerStyle(21);
251 hShiftFD_dn->SetMarkerColor(
kViolet+1);
252 hShiftFD_dn->SetLineWidth(0);
253 hShiftFD_dn->SetLineColor(0);
255 hNominal->Draw(
"hist");
256 hShiftND_up->Draw(
"hist same");
257 hShiftND_dn->Draw(
"hist same");
258 hShiftFD_up->Draw(
"EX0 same");
259 hShiftFD_dn->Draw(
"EX0 same");
261 auto leg = std::make_unique<TLegend>(0.55,0.55,0.95,0.8);
262 leg->AddEntry(hNominal,
"Nominal with FD/ND",
"l");
263 leg->AddEntry(hShiftND_up,
"+ 1#sigma in ND",
"l");
264 leg->AddEntry(hShiftFD_up,
"+ 1#sigma in FD",
"p");
265 leg->AddEntry(hShiftND_dn,
"- 1#sigma in ND",
"l");
266 leg->AddEntry(hShiftFD_dn,
"- 1#sigma in FD",
"p");
267 leg->SetFillStyle(0);
282 hShiftND_up->Divide(hNominal);
283 hShiftND_dn->Divide(hNominal);
285 hShiftFD_up->Divide(hNominal);
286 hShiftFD_dn->Divide(hNominal);
288 hShiftND_up->GetYaxis()->SetRangeUser(0.8,1.2);
290 hShiftND_up->GetYaxis()->SetTitle(
"Ratio to nominal MC");
291 hShiftND_up->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
292 hShiftND_up->GetYaxis()->CenterTitle();
293 hShiftND_up->GetXaxis()->CenterTitle();
295 hShiftND_up->SetMarkerColor(
kOrange+1);
296 hShiftND_up->SetLineWidth(2);
297 hShiftND_up->SetLineStyle(1);
298 hShiftND_up->SetLineColor(
kOrange+1);
299 hShiftND_dn->SetMarkerColor(
kOrange+1);
300 hShiftND_dn->SetLineWidth(2);
301 hShiftND_dn->SetLineStyle(1);
302 hShiftND_dn->SetLineColor(
kOrange+1);
304 hShiftFD_up->SetMarkerColor(
kViolet+1);
305 hShiftFD_up->SetLineWidth(2);
306 hShiftFD_up->SetLineStyle(2);
307 hShiftFD_up->SetLineColor(
kViolet+1);
308 hShiftFD_dn->SetMarkerColor(
kViolet+1);
309 hShiftFD_dn->SetLineWidth(2);
310 hShiftFD_dn->SetLineStyle(2);
311 hShiftFD_dn->SetLineColor(
kViolet+1);
313 hShiftND_up->Draw(
"hist");
314 hShiftND_dn->Draw(
"hist same");
315 hShiftFD_up->Draw(
"hist same");
316 hShiftFD_dn->Draw(
"hist same");
319 grShade->SetFillColorAlpha(
kRed-9, 0.35);
320 grShade->SetLineColor(
kRed-9);
324 grShade2->SetFillColorAlpha(
kRed-9, 0.35);
325 grShade2->SetLineColor(
kRed-9);
328 TGraph* g1 =
new TGraph;
329 g1->SetPoint(0, -1, 1);
330 g1->SetPoint(1, 10, 1);
333 g1->SetLineColor(kBlack);
338 leg = std::make_unique<TLegend>(0.4,0.7,0.9,0.88);
339 leg->SetFillStyle(0);
340 leg->AddEntry(hShiftND_up, TString(
"#pm 1#sigma extrap. ND shift"),
"l");
341 leg->AddEntry(hShiftFD_up, TString(
"#pm 1#sigma FD shift"),
"l");
342 leg->SetFillColorAlpha(10,0.);
360 hResup->GetYaxis()->SetTitle(
"Residual difference (%)");
361 hResup->GetYaxis()->SetRangeUser( -10, 10 );
364 hResup->SetLineColor(
kOrange+1);
365 hResdn->SetLineColor(
kViolet+1);
367 hResup->Draw(
"hist");
368 hResdn->Draw(
"hist same");
371 leg->AddEntry(hResup, TString(
"+1 #sigma shift in FD minus ND"),
"l");
372 leg->AddEntry(hResdn, TString(
"-1 #sigma shift in FD minus ND"),
"l");
373 leg->SetFillColorAlpha(10,0.);
376 TGraph* g0 =
new TGraph;
377 g0->SetPoint(0, -1, 0);
378 g0->SetPoint(1, 10, 0);
381 g0->SetLineColor(kBlack);
398 std::cout <<
"All plots finished!" <<
std::endl;
const NOvARwgtSyst kMECShapeSyst2018AntiNu("MECShape2018AntiNu","MEC 2018 (q_{0}, |#vec{q}|) response, antineutrinos", novarwgt::kMECQ0Q3RespSystNubar2018)
Cuts and Vars for the 2020 FD DiF Study.
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calculator to default assumptions for all parameters.
const NOvARwgtSyst kRPACCQEEnhSyst2018("RPAShapeenh2018","RPA shape: higher-Q^{2} enhancement (2018)", novarwgt::kRPACCQEEnhSyst2018)
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
virtual Spectrum Predict(osc::IOscCalc *calc) const =0
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 'reduced' M_A^QE shift. See documentation in NOvARwgt
General interface to oscillation calculators.
const NOvARwgtSyst kMECEnuShapeSyst2018AntiNu("MECEnuShapeAntiNu","MEC E_{#nu} shape, antineutrinos", novarwgt::kMECEnuShapeSyst2017_NubarOnly)
const NOvARwgtSyst kMECShapeSyst2018Nu("MECShape2018Nu","MEC 2018 (q_{0}, |#vec{q}|) response, neutrinos", novarwgt::kMECQ0Q3RespSystNu2018)
const NOvARwgtSyst kMECInitStateNPFracSyst2018AntiNu("MECInitStateNPFracAntiNu","MEC initial state np fraction, antineutrinos", novarwgt::kMECInitStateNPFracSyst2017_NubarOnly)
const NOvARwgtSyst kMECEnuShapeSyst2018Nu("MECEnuShapeNu","MEC E_{#nu} shape, neutrinos", novarwgt::kMECEnuShapeSyst2017_NuOnly)
Encapsulate code to systematically shift a caf::SRProxy.
const double kAna2018RHCPOT
std::vector< const ISyst * > getAllDirectNumuSysts2018()
const NOvARwgtSyst kMECInitStateNPFracSyst2018Nu("MECInitStateNPFracNu","MEC initial state np fraction, neutrinos", novarwgt::kMECInitStateNPFracSyst2017_NuOnly)
TGraph * ShadeBetweenHistograms(TH1 *hmin, TH1 *hmax)
Optimized version of OscCalcPMNS.
void SetTh23(const T &th23) override
std::vector< double > POT
void SetDmsq32(const T &dmsq32) override
virtual const std::string & LatexName() const final
The name used on plots (ROOT's TLatex syntax)
Standard interface to all prediction techniques.
const NOvARwgtSyst kRPACCQESuppSyst2018("RPAShapesupp2018","RPA shape: low-Q^{2} suppression (2018)", novarwgt::kRPACCQESuppSyst2018)
void SaveObj(const TObject *obj, const std::string &filenameStub, const std::string &dirName="", const std::vector< std::string > exts={".png",".eps",".root"}, bool silent=false)
const double kAna2018FHCPOT
std::string to_string(ModuleType mt)
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...
const NOvARwgtSyst kRPARESSyst2018("RPAShapeRES2018","RPA shape: resonance events (2018)", novarwgt::kRPARESSyst2018)