19 #include "TMultiGraph.h" 21 #include "TLegendEntry.h" 25 #include "TPaveText.h" 29 #include "TAttMarker.h" 41 #include "CAFAna/Core/Binning.h" 62 TLatex*
prelim =
new TLatex(.9, .95,
"NOvA Simulation");
63 prelim->SetTextColor(kGray+1);
65 prelim->SetTextSize(2/30.);
66 prelim->SetTextAlign(32);
67 TGaxis::SetMaxDigits(3);
80 TFile *
f1=
new TFile (
"/nova/app/users/acedeno/tag_releaseS17-09-24/NDAna/ncpi0_Systematics/ResolutionstudyOptimizedProng1_2_cuts_kPi0updated.root",
"READ");
126 auto snd2dplot2prong2cuts=*
Spectrum::LoadFrom(f1->GetDirectory(
"nd2dplot2prong2cuts"));
133 const double myPOT = 8e20;
140 auto hndMC = sndMC.ToTH1(myPOT);
141 auto hndMC3P = sndMC3P.ToTH1(myPOT);
142 auto hndNCNonPi0 = sndNCNonPi0.ToTH1(myPOT);
143 auto hndCCPi0 = sndCCPi0.ToTH1(myPOT);
144 auto hndNCPi0 = sndNCPi0.ToTH1(myPOT);
145 auto hndNCPi0L = sndNCPi0L.ToTH1(myPOT);
146 auto hndCCNonPi0 = sndCCNonPi0.ToTH1(myPOT);
149 auto hndMC1 = sndMC.ToTH1(myPOT);
150 auto hndMC3P1 = sndMC3P.ToTH1(myPOT);
151 auto hndNCNonPi01 = sndNCNonPi0.ToTH1(myPOT);
152 auto hndCCPi01 = sndCCPi0.ToTH1(myPOT);
153 auto hndNCPi01 = sndNCPi0.ToTH1(myPOT);
154 auto hndNCPi0L1 = sndNCPi0L.ToTH1(myPOT);
155 auto hndCCNonPi01 = sndCCNonPi0.ToTH1(myPOT);
159 auto hndMC1Cut = sndMC1Cut.ToTH1(myPOT);
160 auto hndMC3P1Cut = sndMC3P1Cut.ToTH1(myPOT);
161 auto hndNCNonPi01Cut = sndNCNonPi01Cut.ToTH1(myPOT);
162 auto hndCCPi01Cut = sndCCPi01Cut.ToTH1(myPOT);
163 auto hndNCPi01Cut = sndNCPi01Cut.ToTH1(myPOT);
164 auto hndNCPi0L1Cut = sndNCPi0L1Cut.ToTH1(myPOT);
165 auto hndCCNonPi01Cut = sndCCNonPi01Cut.ToTH1(myPOT);
168 auto hndMC1Cut2 = sndMC1Cut2.ToTH1(myPOT);
169 auto hndMC3P1Cut2 = sndMC3P1Cut2.ToTH1(myPOT);
170 auto hndNCNonPi01Cut2 = sndNCNonPi01Cut2.ToTH1(myPOT);
171 auto hndCCPi01Cut2 = sndCCPi01Cut2.ToTH1(myPOT);
172 auto hndNCPi01Cut2 = sndNCPi01Cut2.ToTH1(myPOT);
173 auto hndNCPi0L1Cut2 = sndNCPi0L1Cut2.ToTH1(myPOT);
174 auto hndCCNonPi01Cut2 = sndCCNonPi01Cut2.ToTH1(myPOT);
178 auto hnd2dplot2prong1cut = snd2dplot2prong1cut.ToTH2(myPOT);
179 auto hnd2dplot2prong2cuts = snd2dplot2prong2cuts.ToTH2(myPOT);
182 TString
outDir2 =
"/nova/app/users/acedeno/tag_releaseS17-09-24/NDAna/ncpi0_Systematics/Resolution";
192 {
"/2cuts_resolution_deltaenergy_Stacked"},
193 {
"/2cuts_resolution_deltaenergy_unstacked"},
194 {
"/1cut_resolution_deltaenergy_stacked"},
195 {
"/1cut_resolution_deltaenergy_unstacked"},
196 {
"/1cut_resolution_2DPlot"},
197 {
"/2cut_resolution_2DPlot"},
213 TCanvas *cs2 =
new TCanvas(
"cs2",
"cs2",10,10,855,500);
214 THStack *hs2 =
new THStack(
"hs2",
" ");
226 hndNCPi0L->SetLineColor(kBlack);
227 hndNCPi0L->SetFillColor(
kOrange);
228 hndNCPi0L->SetLineWidth(3);
229 hndNCPi0L->SetMarkerStyle(21);
230 hndNCPi0L->SetMarkerColor(
kOrange);
234 hndCCPi0->SetLineColor(kBlack);
235 hndCCPi0->SetFillColor(kMagenta);
236 hndCCPi0->SetLineWidth(3);
237 hndCCPi0->SetMarkerStyle(21);
238 hndCCPi0->SetMarkerColor(kMagenta);
242 hndCCNonPi0->SetLineColor(kBlack);
243 hndCCNonPi0->SetFillColor(kAzure);
244 hndCCNonPi0->SetLineWidth(3);
245 hndCCNonPi0->SetMarkerStyle(21);
246 hndCCNonPi0->SetMarkerColor(kAzure);
247 hs2->Add(hndCCNonPi0);
250 hndNCNonPi0->SetLineColor(kBlack);
251 hndNCNonPi0->SetFillColor(kCyan);
252 hndNCNonPi0->SetLineWidth(3);
253 hndNCNonPi0->SetMarkerStyle(21);
254 hndNCNonPi0->SetMarkerColor(kCyan);
255 hs2->Add(hndNCNonPi0);
258 hndNCPi0->SetLineColor(kBlack);
259 hndNCPi0->SetFillColor(
kGreen);
260 hndNCPi0->SetLineWidth(3);
261 hndNCPi0->SetMarkerStyle(21);
262 hndNCPi0->SetMarkerColor(
kGreen);
266 TText
T; T.SetTextFont(42); T.SetTextAlign(21);
267 hs2->Draw(
"hist"); T.DrawTextNDC(.5,.95,
"");
268 hs2->GetYaxis()->SetTitle(
"Events/ 8e20 POT");
269 hs2->GetXaxis()->SetTitle(
"(Reco-True) #Delta E [GeV]");
270 hs2->SetMaximum(450);
271 hs2->GetXaxis()->SetRangeUser(-1,1);
275 hndMC3P->SetLineColor(
kRed);
276 hndMC3P->SetLineWidth(3);
277 hndMC3P->Draw(
"same");
278 TLegend * leg2 =
new TLegend(0.62,0.5,0.73,0.82);
280 leg2->SetTextFont(42);
281 leg2->SetTextSize(0.05);
282 leg2->SetFillStyle(0);
283 leg2->AddEntry(hndMC3P,
"Total PreSel",
"kFullDotSmall");
285 leg2->AddEntry(hndCCPi0,
"CCPi0",
"kFullDotSmall");
286 leg2->AddEntry(hndCCNonPi0,
"CCNonPi0",
"kFullDotSmall");
287 leg2->AddEntry(hndNCPi0L,
"NC w/Pi0 < 0.3 E",
"kFullDotSmall");
288 leg2->AddEntry(hndNCPi0,
"NC w/Pi0 > 0.3 E",
"kFullDotSmall");
289 leg2->AddEntry(hndNCNonPi0,
"NCNonPi0",
"kFullDotSmall");
294 cs2->SaveAs(outDir2+CurrentFile[0].
name.c_str()+CurrentDate[0].
date.c_str()+
".pdf");
300 TCanvas *cs13 =
new TCanvas(
"cs13",
"cs13",10,10,855,500);
303 hndMC3P1->SetLineColor(
kRed);
304 hndMC3P1->SetLineWidth(3);
308 hndCCPi01->SetLineColor(kMagenta);
309 hndCCPi01->SetLineWidth(3);
313 hndCCNonPi01->SetLineColor(kAzure);
314 hndCCNonPi01->SetLineWidth(3);
318 hndNCPi0L1->SetLineColor(
kOrange);
319 hndNCPi0L1->SetLineWidth(3);
323 hndNCPi01->SetLineColor(
kGreen);
324 hndNCPi01->SetLineWidth(3);
329 hndNCNonPi01->SetLineColor(kCyan);
330 hndNCNonPi01->SetLineWidth(3);
334 hndMC3P1->Draw(
"hist E1");
335 hndCCPi01->Draw(
"hist E1 same");
336 hndCCNonPi01->Draw(
"hist E1 same");
337 hndNCPi0L1->Draw(
"hist E1 same");
338 hndNCPi01->Draw(
"hist E1 same");
339 hndNCNonPi01->Draw(
"hist E1 same");
340 hndMC3P1->GetYaxis()->SetTitle(
"Events/8e20 POT");
341 hndMC3P1->GetXaxis()->SetRangeUser(-.5,.5);
342 hndMC3P1->SetTitleOffset(0.95,
"Y");
345 TLegend * leg13 =
new TLegend(0.62,0.5,0.73,0.82);
346 leg13->SetTextFont(42);
347 leg13->SetTextSize(0.05);
348 leg13->AddEntry(hndMC3P1,
"Total PreSel",
"l");
349 leg13->AddEntry(hndCCPi01,
"CCPi0",
"l");
350 leg13->AddEntry(hndCCNonPi01,
"CCNonPi0",
"l");
351 leg13->AddEntry(hndNCPi0L1,
"NC w/Pi0 < 0.3 E",
"l");
352 leg13->AddEntry(hndNCPi01,
"NC w/Pi0 > 0.3 E",
"l");
353 leg13->AddEntry(hndNCNonPi01,
"NCNonPi0",
"l");
358 cs13->SaveAs(outDir2+CurrentFile[1].
name.c_str()+CurrentDate[0].
date.c_str()+
".pdf");
365 TCanvas *cs2b =
new TCanvas(
"cs2b",
"cs2b",10,10,855,500);
366 THStack *hs2b =
new THStack(
"hs2b",
" ");
378 hndNCPi0L1Cut->SetLineColor(kBlack);
379 hndNCPi0L1Cut->SetFillColor(
kOrange);
380 hndNCPi0L1Cut->SetLineWidth(3);
381 hndNCPi0L1Cut->SetMarkerStyle(21);
382 hndNCPi0L1Cut->SetMarkerColor(
kOrange);
383 hs2b->Add(hndNCPi0L1Cut);
386 hndCCPi01Cut->SetLineColor(kBlack);
387 hndCCPi01Cut->SetFillColor(kMagenta);
388 hndCCPi01Cut->SetLineWidth(3);
389 hndCCPi01Cut->SetMarkerStyle(21);
390 hndCCPi01Cut->SetMarkerColor(kMagenta);
392 hs2b->Add(hndCCPi01Cut);
394 hndCCNonPi01Cut->SetLineColor(kBlack);
395 hndCCNonPi01Cut->SetFillColor(kAzure);
396 hndCCNonPi01Cut->SetLineWidth(3);
397 hndCCNonPi01Cut->SetMarkerStyle(21);
398 hndCCNonPi01Cut->SetMarkerColor(kAzure);
399 hs2b->Add(hndCCNonPi01Cut);
402 hndNCNonPi01Cut->SetLineColor(kBlack);
403 hndNCNonPi01Cut->SetFillColor(kCyan);
404 hndNCNonPi01Cut->SetLineWidth(3);
405 hndNCNonPi01Cut->SetMarkerStyle(21);
406 hndNCNonPi01Cut->SetMarkerColor(kCyan);
407 hs2b->Add(hndNCNonPi01Cut);
410 hndNCPi01Cut->SetLineColor(kBlack);
411 hndNCPi01Cut->SetFillColor(
kGreen);
412 hndNCPi01Cut->SetLineWidth(3);
413 hndNCPi01Cut->SetMarkerStyle(21);
414 hndNCPi01Cut->SetMarkerColor(
kGreen);
415 hs2b->Add(hndNCPi01Cut);
418 TText T99; T99.SetTextFont(42); T99.SetTextAlign(21);
419 hs2b->Draw(
"hist"); T99.DrawTextNDC(.5,.95,
"");
420 hs2b->GetYaxis()->SetTitle(
"Events/ 8e20 POT");
421 hs2b->GetXaxis()->SetTitle(
"(Reco-True) #Delta E [GeV]");
422 hs2b->SetMaximum(1200);
423 hs2b->GetXaxis()->SetRangeUser(-1,1);
427 hndMC3P1Cut->SetLineColor(
kRed);
428 hndMC3P1Cut->SetLineWidth(3);
429 hndMC3P1Cut->Draw(
"same");
430 TLegend * leg2b =
new TLegend(0.62,0.5,0.73,0.82);
432 leg2b->SetTextFont(42);
433 leg2b->SetTextSize(0.05);
434 leg2b->SetFillStyle(0);
435 leg2b->AddEntry(hndMC3P1Cut,
"Total PreSel",
"kFullDotSmall");
437 leg2b->AddEntry(hndCCPi01Cut,
"CCPi0",
"kFullDotSmall");
438 leg2b->AddEntry(hndCCNonPi01Cut,
"CCNonPi0",
"kFullDotSmall");
439 leg2b->AddEntry(hndNCPi0L1Cut,
"NC w/Pi0 < 0.3 E",
"kFullDotSmall");
440 leg2b->AddEntry(hndNCPi01Cut,
"NC w/Pi0 > 0.3 E",
"kFullDotSmall");
441 leg2b->AddEntry(hndNCNonPi01Cut,
"NCNonPi0",
"kFullDotSmall");
446 cs2b->SaveAs(outDir2+CurrentFile[2].
name.c_str()+CurrentDate[0].
date.c_str()+
".pdf");
453 TCanvas *cs13b =
new TCanvas(
"cs13b",
"cs13b",10,10,855,500);
456 hndMC3P1Cut2->SetLineColor(
kRed);
457 hndMC3P1Cut2->SetLineWidth(3);
461 hndCCPi01Cut2->SetLineColor(kMagenta);
462 hndCCPi01Cut2->SetLineWidth(3);
466 hndCCNonPi01Cut2->SetLineColor(kAzure);
467 hndCCNonPi01Cut2->SetLineWidth(3);
471 hndNCPi0L1Cut2->SetLineColor(
kOrange);
472 hndNCPi0L1Cut2->SetLineWidth(3);
476 hndNCPi01Cut2->SetLineColor(
kGreen);
477 hndNCPi01Cut2->SetLineWidth(3);
482 hndNCNonPi01Cut2->SetLineColor(kCyan);
483 hndNCNonPi01Cut2->SetLineWidth(3);
487 hndMC3P1Cut2->Draw(
"hist E1");
488 hndCCPi01Cut2->Draw(
"hist E1 same");
489 hndCCNonPi01Cut2->Draw(
"hist E1 same");
490 hndNCPi0L1Cut2->Draw(
"hist E1 same");
491 hndNCPi01Cut2->Draw(
"hist E1 same");
492 hndNCNonPi01Cut2->Draw(
"hist E1 same");
493 hndMC3P1Cut2->GetYaxis()->SetTitle(
"Events/8e20 POT");
494 hndMC3P1Cut2->GetXaxis()->SetRangeUser(-.5,.5);
495 hndMC3P1Cut2->SetTitleOffset(0.95,
"Y");
498 TLegend * leg13b =
new TLegend(0.62,0.5,0.73,0.82);
499 leg13b->SetTextFont(42);
500 leg13b->SetTextSize(0.05);
501 leg13b->AddEntry(hndMC3P1Cut2,
"Total PreSel",
"l");
502 leg13b->AddEntry(hndCCPi01Cut2,
"CCPi0",
"l");
503 leg13b->AddEntry(hndCCNonPi01Cut2,
"CCNonPi0",
"l");
504 leg13b->AddEntry(hndNCPi0L1Cut2,
"NC w/Pi0 < 0.3 E",
"l");
505 leg13b->AddEntry(hndNCPi01Cut2,
"NC w/Pi0 > 0.3 E",
"l");
506 leg13b->AddEntry(hndNCNonPi01Cut2,
"NCNonPi0",
"l");
508 leg13b->Draw(
"same");
511 cs13b->SaveAs(outDir2+CurrentFile[3].
name.c_str()+CurrentDate[0].
date.c_str()+
".pdf");
515 TCanvas *cs10 =
new TCanvas(
"cs10",
"cs10",10,10,855,500);
517 hnd2dplot2prong1cut->Draw(
"colz");
518 hnd2dplot2prong1cut->GetXaxis()->SetTitle(
"#pi^{0} Reco Energy [GeV]");
519 hnd2dplot2prong1cut->GetYaxis()->SetTitle(
"(Reco-True) #Delta E [GeV]");
520 hnd2dplot2prong1cut->SetTitleOffset(0.9,
"Y");
524 cs10->SaveAs(outDir2+CurrentFile[4].
name.c_str()+CurrentDate[0].
date.c_str()+
".pdf");
529 TCanvas *cs14 =
new TCanvas(
"cs14",
"cs14",10,10,855,500);
531 hnd2dplot2prong2cuts->Draw(
"colz");
532 hnd2dplot2prong2cuts->GetXaxis()->SetTitle(
"#pi^{0} Reco Energy [GeV]");
533 hnd2dplot2prong2cuts->GetYaxis()->SetTitle(
"(Reco-True) #Delta E [GeV]");
534 hnd2dplot2prong2cuts->SetTitleOffset(0.9,
"Y");
538 cs14->SaveAs(outDir2+CurrentFile[5].
name.c_str()+CurrentDate[0].
date.c_str()+
".pdf");
546 auto h =
histo.ToTH2(myPOT);
547 float datapot = 8.09e20/3.54e21;
550 int nbins = h->GetNbinsX();
551 double xmin = h->GetXaxis()->GetXmin();
553 double xmax = h->GetXaxis()->GetXmax();
555 TH1D *hrms =
new TH1D(
"hrms",
"hrms",nbins,xmin,xmax);
557 TH1D *projection = (TH1D*) h->ProjectionY(
"",
i,
i);
559 double rms = projection->GetMean();
561 double rmserr = projection->GetMeanError();
565 hrms-> SetBinError(
i,rmserr);
567 TCanvas *
c =
new TCanvas();
568 c->SetLeftMargin(0.15);
570 gROOT->SetStyle(
"novaStyle");
573 gStyle->SetTitleX(.39);
574 gStyle->SetTitleY(0.95);
575 hrms->SetLineColor(kBlack);
::xsd::cxx::tree::date< char, simple_type > date
Cuts and Vars for the 2020 FD DiF Study.
std::map< std::string, double > xmax
const DateUp CurrentDate[Date]
const FileUp CurrentFile[File]
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir, const std::string &name)
cout<< "--"<< endl;for(Int_t iP=1;iP<=hyz->GetNbinsX();iP++){for(Int_t iC=1;iC<=hyz->GetNbinsY();iC++){if(hyv->GetBinContent(iP, iC)>-999){goal_hyv-> SetBinContent(iP, iC,-(dy[iP-1][iC-1]))