7 #include "CAFAna/Core/Binning.h" 8 #include "CAFAna/Core/Cut.h" 9 #include "CAFAna/Core/HistAxis.h" 17 #include "CAFAna/Cuts/NueCutsSecondAna.h" 55 TLegend*
leg =
new TLegend(x0, y0, x1, y1);
57 leg->SetTextSize(2/30.);
59 leg->SetHeader(
"#splitline{#bf{Neutrino Beam}}{#splitline{FD prediction}{#nu_{e} signal+WS}}");
60 TH1*
dummy =
new TH1F(
"",
"", 1, 0, 1);
61 TH1* dummyFill =
new TH1F(
"",
"", 1, 0, 1);
62 leg->AddEntry(dummy->Clone(),
"",
"");
67 leg->AddEntry(dummy->Clone(),
"Nominal",
"l");
68 dummy->SetLineStyle(3);
69 dummy->SetLineColor(kGray+2);
71 dummy->SetLineStyle(8);
72 dummy->SetLineColor(kGray+2);
74 dummy->SetLineStyle(9);
76 leg->AddEntry(dummy->Clone(),
"cos #theta reweighted",
"l");
83 TH1* coreperiTH1 = (TH1*)coreTH1->Clone(
"coreperi");
84 for(
int i = 18;
i < 28; ++
i){
85 coreperiTH1->SetBinContent(
i, periTH1->GetBinContent(
i));
94 gStyle->SetPadTickX(1);
95 gStyle->SetPadTickY(0);
97 TH1::AddDirectory(kFALSE);
111 TFile * file_no =
new TFile (filename_no.c_str(),
"READ");
112 if(file_no->IsZombie()){
std::cerr <<
"Can't find " << filename_no.c_str() <<
std::endl;
return;}
113 TFile * file_re_core =
new TFile (filename_re_core.c_str(),
"READ");
114 if(file_re_core->IsZombie()){
std::cerr <<
"Can't find " << filename_re_core.c_str() <<
std::endl;
return;}
115 TFile * file_re_peri =
new TFile (filename_re_peri.c_str(),
"READ");
116 if(file_re_peri->IsZombie()){
std::cerr <<
"Can't find " << filename_re_peri.c_str() <<
std::endl;
return;}
123 tfile.open(
"plots/FDextrap-TableOut.tex",
ios::out);
125 tfile <<
"\\begin{tabular}{lllllllll} \n";
126 tfile <<
"\\multicolumn{9}{c}{prop FD $\nu_e$ signal + WS} \\\\ \n";
127 tfile <<
"Sample & Sig.+WS+Unosc. Bkg. & /NOMINAL & Signal+WS & /NOMINAL & WS & /NOMINAL & Signal & /NOMINAL \\\\ \n";
128 tfile <<
"\\hline \n";
131 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
132 TFile *
file =
new TFile(
"FD_KinematicsCorrection_FHC.root",
"RECREATE");
133 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
134 bool pidaxes = varIdx;
136 TDirectory * dpred_no = file_no->GetDirectory(
"prediction/nue_pred_ALL_cvn2d");
137 TDirectory * dpred_noextrap = file_no->GetDirectory(
"prediction/nue_pred_noextrap_ALL_cvn2d");
138 TDirectory * dpred_re_core = file_re_core->GetDirectory(
"CORE_CORE/nue_pred_trueQ2_CORE_cvn2d");
139 TDirectory * dpred_re_core_PtP = file_re_core->GetDirectory(
"CORE_CORE/nue_pred_PtP_CORE_cvn2d");
140 TDirectory * dpred_re_core_Cos = file_re_core->GetDirectory(
"CORE_CORE/nue_pred_Cos_CORE_cvn2d");
141 TDirectory * dpred_re_peri = file_re_peri->GetDirectory(
"PERI_PERI/nue_pred_trueQ2_PERI_cvn2d");
142 TDirectory * dpred_re_peri_PtP = file_re_peri->GetDirectory(
"PERI_PERI/nue_pred_PtP_PERI_cvn2d");
143 TDirectory * dpred_re_peri_Cos = file_re_peri->GetDirectory(
"PERI_PERI/nue_pred_Cos_PERI_cvn2d");
148 auto pred_re_core = ana::LoadFrom<PredictionExtendToPeripheral> (dpred_re_core);
149 auto pred_re_core_PtP = ana::LoadFrom<PredictionExtendToPeripheral> (dpred_re_core_PtP);
150 auto pred_re_core_Cos = ana::LoadFrom<PredictionExtendToPeripheral> (dpred_re_core_Cos);
151 auto pred_re_peri = ana::LoadFrom<PredictionExtendToPeripheral> (dpred_re_peri);
152 auto pred_re_peri_PtP = ana::LoadFrom<PredictionExtendToPeripheral> (dpred_re_peri_PtP);
153 auto pred_re_peri_Cos = ana::LoadFrom<PredictionExtendToPeripheral> (dpred_re_peri_Cos);
155 if(selIdx == 0 && varIdx == 0)
157 << pred_no->Predict(&mycalc).POT() <<
std::endl;
160 TCanvas *
c2 =
new TCanvas(
"c2",
"c2",500,400);
162 TPad *padAbs =
new TPad(
"padAbs",
"padAbs", 0, 0.3, 1, 1.0);
163 padAbs -> SetBottomMargin(0);
164 padAbs->SetFillStyle(0);
165 padAbs -> SetLeftMargin(0.15);
175 TH1* hNC = pred_no.get()->PredictComponent(&mycalc,
180 TH1* hCC = pred_no.get()->PredictComponent(&mycalc,
185 TH1* hBeam = pred_no.get()->PredictComponent(&mycalc,
190 TH1* hUnoscBkg = (TH1*)hNC->Clone(
UniqueName().c_str());
192 hUnoscBkg->Add(hBeam);
195 TH1* hSig_no = pred_no.get()->PredictComponent(&mycalc,
201 TH1* hWS_no = pred_no.get()->PredictComponent(&mycalc,
207 TH1* hAll_no = (TH1*)hSig_no->Clone(
"hAll_no");
208 hAll_no->Add(hWS_no);
211 TH1* hSig_re_core = pred_re_core.get()->PredictComponent(&mycalc,
215 TH1* hWS_re_core = pred_re_core.get()->PredictComponent(&mycalc,
220 TH1* hSig_re_peri = pred_re_peri.get()->PredictComponent(&mycalc,
224 TH1* hWS_re_peri = pred_re_peri.get()->PredictComponent(&mycalc,
232 TH1* hSig_re = (TH1*)hSig_re_core->Clone(
"hSig_re");
233 TH1* hWS_re = (TH1*)hWS_re_core->Clone(
"hWS_re");
235 TH1* hAll_re = (TH1*)hSig_re->Clone(
"hAll_re");
236 hAll_re->Add(hWS_re);
238 hSig_re->SetLineColor(kGray+2);
239 hSig_re->SetLineStyle(3);
240 hSig_re->SetLineWidth(1);
241 hWS_re->SetLineColor(kGray+2);
242 hWS_re->SetLineStyle(3);
243 hWS_re->SetLineWidth(1);
244 hAll_re->SetLineColor(kGray+2);
245 hAll_re->SetLineStyle(3);
246 hAll_re->SetLineWidth(1);
249 TH1* hSig_re_core_PtP = pred_re_core_PtP.get()->PredictComponent(&mycalc,
253 TH1* hWS_re_core_PtP = pred_re_core_PtP.get()->PredictComponent(&mycalc,
258 TH1* hSig_re_peri_PtP = pred_re_peri_PtP.get()->PredictComponent(&mycalc,
262 TH1* hWS_re_peri_PtP = pred_re_peri_PtP.get()->PredictComponent(&mycalc,
270 TH1* hAll_re_PtP = (TH1*)hSig_re_PtP->Clone(
"hAll_re_PtP");
271 hAll_re_PtP->Add(hWS_re_PtP);
273 hSig_re_PtP->SetLineColor(kGray+2);
274 hSig_re_PtP->SetLineStyle(8);
275 hSig_re_PtP->SetLineWidth(1);
276 hWS_re_PtP->SetLineColor(kGray+2);
277 hWS_re_PtP->SetLineStyle(8);
278 hWS_re_PtP->SetLineWidth(1);
279 hAll_re_PtP->SetLineColor(kGray+2);
280 hAll_re_PtP->SetLineStyle(8);
281 hAll_re_PtP->SetLineWidth(1);
283 TH1* hSig_re_core_Cos = pred_re_core_Cos.get()->PredictComponent(&mycalc,
287 TH1* hWS_re_core_Cos = pred_re_core_Cos.get()->PredictComponent(&mycalc,
292 TH1* hSig_re_peri_Cos = pred_re_peri_Cos.get()->PredictComponent(&mycalc,
296 TH1* hWS_re_peri_Cos = pred_re_peri_Cos.get()->PredictComponent(&mycalc,
304 TH1* hAll_re_Cos = (TH1*)hSig_re_Cos->Clone(
"hAll_re_Cos");
305 hAll_re_Cos->Add(hWS_re_Cos);
307 hSig_re_Cos->SetLineColor(
kOrange+1);
308 hSig_re_Cos->SetLineStyle(9);
309 hWS_re_Cos->SetLineColor(
kOrange+1);
310 hWS_re_Cos->SetLineStyle(9);
311 hAll_re_Cos->SetLineColor(
kOrange+1);
312 hAll_re_Cos->SetLineStyle(9);
314 double intUnoscBkg = hUnoscBkg->Integral();
315 double intSig_no = hSig_no->Integral();
316 double intSig_re = hSig_re->Integral();
317 double intSig_re_PtP = hSig_re_PtP->Integral();
318 double intSig_re_Cos = hSig_re_Cos->Integral();
319 double intWS_no = hWS_no->Integral();
320 double intWS_re = hWS_re->Integral();
321 double intWS_re_PtP = hWS_re_PtP->Integral();
322 double intWS_re_Cos = hWS_re_Cos->Integral();
323 double intAll_no = hAll_no->Integral();
324 double intAll_re = hAll_re->Integral();
325 double intAll_re_PtP = hAll_re_PtP->Integral();
326 double intAll_re_Cos = hAll_re_Cos->Integral();
330 tfile <<
"NOMINAL" <<
" & " <<
round(100.0*(intAll_no+intUnoscBkg))/100.0 <<
" & & ";
331 tfile <<
round(100.0*intAll_no)/100.0 <<
" & & " <<
round(100.0*intWS_no)/100.0 <<
" & & " <<
round(100.0*intSig_no)/100.0 <<
" & \\\\ \n";
332 tfile <<
"trueQ2 REW." <<
" & " <<
round(100.0*(intAll_re+intUnoscBkg))/100.0 <<
" & " <<
round(1000.0*((intAll_re+intUnoscBkg)/(intAll_no+intUnoscBkg)-1.0))/10.0 <<
" \\% & ";
333 tfile <<
round(100.0*intAll_re)/100.0 <<
" & " <<
round(1000.0*((intAll_re/intAll_no)-1.0))/10.0 <<
" \\% & ";
334 tfile <<
round(100.0*intWS_re)/100.0 <<
" & " <<
round (1000.0*((intWS_re/intWS_no)-1.0))/10.0 <<
" \\% & ";
335 tfile <<
round(100.0*intSig_re)/100.0 <<
" & "<<
round(1000.0*((intSig_re/intSig_no)-1.0))/10.0 <<
" \\% \\\\ \n";
336 tfile <<
"PtP REW." <<
" & " <<
round(100.0*(intAll_re_PtP+intUnoscBkg))/100.0 <<
" & " <<
round(1000.0*((intAll_re_PtP+intUnoscBkg)/(intAll_no+intUnoscBkg)-1.0))/10.0 <<
" \\% & ";
337 tfile <<
round(100.0*intAll_re_PtP)/100.0 <<
" & " <<
round(1000.0*((intAll_re_PtP/intAll_no)-1.0))/10.0 <<
" \\% & ";
338 tfile <<
round(100.0*intWS_re_PtP)/100.0 <<
" & " <<
round (1000.0*((intWS_re_PtP/intWS_no)-1.0))/10.0 <<
" \\% & ";
339 tfile <<
round(100.0*intSig_re_PtP)/100.0 <<
" & "<<
round(1000.0*((intSig_re_PtP/intSig_no)-1.0))/10.0 <<
" \\% \\\\ \n";
340 tfile <<
"Cos REW." <<
" & " <<
round(100.0*(intAll_re_Cos+intUnoscBkg))/100.0 <<
" & " <<
round(1000.0*((intAll_re_Cos+intUnoscBkg)/(intAll_no+intUnoscBkg)-1.0))/10.0 <<
" \\% & ";
341 tfile <<
round(100.0*intAll_re_Cos)/100.0 <<
" & " <<
round(1000.0*((intAll_re_Cos/intAll_no)-1.0))/10.0 <<
" \\% & ";
342 tfile <<
round(100.0*intWS_re_Cos)/100.0 <<
" & " <<
round (1000.0*((intWS_re_Cos/intWS_no)-1.0))/10.0 <<
" \\% & ";
343 tfile <<
round(100.0*intSig_re_Cos)/100.0 <<
" & "<<
round(1000.0*((intSig_re_Cos/intSig_no)-1.0))/10.0 <<
" \\% \\\\ \n";
344 tfile <<
"\\hline \n";
345 tfile <<
"\\end{tabular}";
348 hAll_re->GetXaxis()->CenterTitle();
349 hAll_re->GetYaxis()->CenterTitle();
350 hAll_re->GetXaxis()->SetDecimals();
351 hAll_re->GetYaxis()->SetDecimals();
352 hAll_re->GetYaxis()->SetTitleOffset(.8);
353 hAll_re->GetYaxis()->SetTitleSize(.06);
354 hAll_re->GetYaxis()->SetLabelSize(.06);
355 hAll_re->GetXaxis()->SetLabelSize(.0);
356 hAll_re->SetMaximum(1.1*TMath::Max(hSig_re->GetMaximum(),hSig_no->GetMaximum()));
357 hAll_re->GetYaxis()->SetTitle(
TString::Format(
"Events / %.02lf #times 10^{20} POT", kPOTFD/1E20));
359 hAll_re->SetLineColor(kWhite);
360 hAll_re->Draw(
"hist");
362 hAll_re_Cos->Draw(
"same hist");
363 hAll_no->Draw(
"same hist");
364 hAll_re_Cos->Draw(
"hist same");
366 hAll_re->GetYaxis()->SetRangeUser(.001,12.5);
369 padAbs->RedrawAxis();
372 double legendxlow=0.55;
373 double legendxhigh=0.95;
375 Legend(legendxlow, .45, legendxhigh, .85);
377 TLatex* selTitle =
new TLatex(.9, .95,
"NOvA Simulation");
379 selTitle->SetTextColor(kGray+1);
380 selTitle->SetTextSize(2/30.);
381 selTitle->SetTextAlign(32);
385 TPad *padRatio =
new TPad(
"padRatio",
"padRatio", 0, 0.0, 1, 0.33);
386 padRatio -> SetTopMargin(0.11);
387 padRatio -> SetBottomMargin(0.33);
389 padRatio -> SetLeftMargin(0.15);
394 TH1* hRatio = (TH1*)hAll_re ->
Clone(
"hRatio");
395 TH1* hRatio_PtP = (TH1*)hAll_re_PtP ->
Clone(
"hRatio_PtP");
396 TH1* hRatio_Cos = (TH1*)hAll_re_Cos ->
Clone(
"hRatio_Cos");
397 TLine* lOne =
new TLine(0,1.0,27.0,1.0);
400 hRatio ->
Divide(hAll_no);
401 hRatio_PtP ->
Divide(hAll_no);
402 hRatio_Cos ->
Divide(hAll_no);
404 hRatio->GetXaxis()->CenterTitle();
405 hRatio->GetYaxis()->CenterTitle();
406 hRatio->GetYaxis()->SetLabelSize(.12);
407 hRatio->GetXaxis()->SetLabelSize(.12);
408 hRatio->GetXaxis()->SetTitleOffset(1.0);
409 hRatio->GetXaxis()->SetTickSize(.1);
410 hRatio->GetYaxis()->SetTitleSize(.12);
411 hRatio->GetXaxis()->SetTitleSize(.12);
412 hRatio->SetMarkerSize(.1);
413 hRatio->GetXaxis()->SetDecimals();
414 hRatio->GetYaxis()->SetDecimals();
415 hRatio->GetYaxis()->SetTitleOffset(0.4);
416 hRatio->GetYaxis()->SetTitle(
"#splitline{Ratio to}{nominal}");
418 hRatio->GetYaxis()->SetNdivisions(502,kFALSE);
419 hRatio->SetLineColor(kWhite);
420 hRatio ->
Draw(
"hist");
422 hRatio_Cos ->
Draw(
"same hist");
423 lOne ->
Draw(
"same");
424 hRatio_Cos ->
Draw(
"hist same");
427 hRatio->GetYaxis()->SetRangeUser(0.8,1.2);
429 c2->Print((
"plots/FDnue_pred_recoE_abs.png"));
430 c2->SaveAs(
"plots/FDnue_pred_recoE_abs.pdf",
"pdf");
TH1 * create_coreperi_TH1(const TH1 *coreTH1, const TH1 *periTH1)
void Nue2018ThreeBinAxis(THStack *axes, bool drawLabels, bool merged, bool coreOnly)
Pass neutrinos through unchanged.
ratio_hxv Divide(hxv, goal_hxv)
Cuts and Vars for the 2020 FD DiF Study.
Float_t y1[n_points_granero]
Float_t x1[n_points_granero]
const Color_t kNueSignalWSColor
void plot_nueFD_Signal_REWvsNOM_FHC(const std::string filename_no, const std::string filename_re_core, const std::string filename_re_peri)
const Color_t kTotalMCErrorBandColor
void Legend(double x0, double y0, double x1, double y1)
fvar< T > round(const fvar< T > &x)
ntuple SetFillStyle(1001)
const Color_t kNueSignalColor
Charged-current interactions.
Simple oscillation probability calculator that has no solar term or mass hierarchy or delta so it's s...
const HistDef defs[kNumVars]
std::unique_ptr< IPrediction > LoadFrom< IPrediction >(TDirectory *dir, const std::string &label)
osc::NoOscillations noosc
Neutral-current interactions.
Both neutrinos and antineutrinos.
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
const Color_t kTotalMCColor
const double kAna2018FHCPOT
All neutrinos, any flavor.
std::string UniqueName()
Return a different string each time, for creating histograms.