12 #include "CAFAna/Cuts/NueCutsSecondAna.h" 39 #include "TGraphAsymmErrors.h" 43 TLatex*
prelim =
new TLatex(.93, .9,
"NOvA Preliminary");
44 prelim->SetTextColor(
kBlue);
46 prelim->SetTextSize(2/30.);
47 prelim->SetTextAngle(270);
48 prelim->SetTextAlign(12);
52 TCanvas *
MakeMePlot(std::vector<TH1*> Histos, std::vector<TString> Names,
bool isFHC,
string yname =
"none"){
54 TCanvas *
c =
new TCanvas(
"c",
"canvas", 800, 700);
55 TPad*
p1 =
new TPad(
"",
"", 0, 0, 1, 1);
56 TPad*
p2 =
new TPad(
"",
"", 0, 0, 1, 1);
57 p1->SetBottomMargin(.3);
61 p->SetLeftMargin(0.1);
67 auto denom = (TH1*)Histos[0]->
Clone();
68 denom->SetMaximum(denom->GetMaximum()*1.4);
69 if (yname ==
"Selection efficiency") denom->SetMaximum(1.35);
71 denom->GetYaxis()->CenterTitle();
72 denom->GetXaxis()->CenterTitle();
73 denom->GetXaxis()->SetLabelOffset(999);
74 if(yname !=
"none") denom->GetYaxis()->SetTitle(yname.c_str());
76 denom->Draw(
"hist E1");
77 for(
int i=1;
i<Histos.size();
i++){
78 Histos[
i]->Draw(
"hist E1 same");
80 denom->Draw(
"hist E1 same");
85 auto *tt =
new TText(gPad->GetUxmax()*0.7, 1.02*gPad->GetUymax(),
"FHC beam");
86 tt->SetTextColor(
kBlue);
87 tt->SetTextSize(0.05);
90 auto *tt =
new TText(gPad->GetUxmax()*0.7, 1.02*gPad->GetUymax(),
"RHC beam");
91 tt->SetTextColor(
kBlue);
92 tt->SetTextSize(0.05);
95 TLegend *
leg =
new TLegend(0.5,0.76,0.95,0.87);
96 leg->SetTextSize(0.025);
97 for(
int i=0;
i<Histos.size();
i++) leg->AddEntry(Histos[
i], Names[i],
"l");
105 for(
int i=2; i<Histos.size(); i++){
110 temp->GetYaxis()->SetRangeUser(0.8, 1.25);
111 temp->GetYaxis()->SetTitle(
"Ratio");
112 TLine *
l =
new TLine(-0.1,1,4.5,1);
113 l->SetLineColor(kBlack);
125 std::string file_mc =
"mre_pred_nd_cuts_"+mode_tag+
"_mc.root";
136 const Var kHadCalENo1erProng =
kSlcE - kCalE1erProng;
152 {
"caloE_1pr", {
"Calorimetric energy, 1st prong",
Binning::Simple(120,0,12), kCalE1erProng}, 1, 45, 1},
153 {
"calE_no1pr", {
"Calorimetric energy, not 1st prong",
Binning::Simple(120,0,12), kHadCalENo1erProng}, 1, 45, 1},
186 fname_data =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_numi_fhc_full_v1";
187 fname =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1";
188 fname_calibxy_pos =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_calibup_v1 with stride 1";
189 fname_calibxy_neg =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_calibdown_v1 with stride 1";
190 fname_calib =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_calibshape_v1 with stride 1";
191 fname_light_up =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_llup_v1 with stride 1";
192 fname_light_down =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_lldown_v1 with stride 1";
193 fname_ckv =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_cherenkov_v1";
197 fname_data =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_numi_rhc_full_v1";
198 fname =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_v1";
199 fname_calibxy_pos =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_calibup_v1 with stride 1";
200 fname_calibxy_neg =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_calibdown_v1 with stride 1";
201 fname_calib =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_calibshape_v1 with stride 1";
202 fname_light_up =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_llup_v1 with stride 1";
203 fname_light_down =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_lldown_v1 with stride 1";
204 fname_ckv =
"defname: prod_mrecaf_R19-11-18-prod5reco.r_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_cherenkov_v1 with stride 1";
237 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
238 for (
int varIdx=0; varIdx<
kNumVars;varIdx++){
240 spec_data[selIdx][varIdx] =
new Spectrum(loader_data, axis, sels[selIdx],
kNoShift);
256 loader_calibxy_pos.
Go();
257 loader_calibxy_neg.
Go();
259 loader_light_up.
Go();
260 loader_light_down.
Go();
263 TFile*
file =
new TFile(file_mc.c_str(),
"recreate");
265 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
266 TDirectory*
d = file->mkdir(selNames[selIdx].c_str());
267 for (
int varIdx=0; varIdx<
kNumVars;varIdx++){
268 const char*
name = defs[varIdx].
name.c_str();
297 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
298 const char* selName = selNames[selIdx].c_str();
299 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
300 const char* varName = defs[varIdx].
name.c_str();
301 data[selIdx][varIdx] = LoadFromFile<Spectrum>(file_mc,
TString::Format(
"%s/data_%s", selName, varName).Data()).
release();
303 mc_calibxy_pos[selIdx][varIdx] = LoadFromFile<Spectrum>(file_mc,
TString::Format(
"%s/calibxy_pos_%s", selName, varName).Data()).
release();
304 mc_calibxy_neg[selIdx][varIdx] = LoadFromFile<Spectrum>(file_mc,
TString::Format(
"%s/calibxy_neg_%s", selName, varName).Data()).
release();
305 mc_calib[selIdx][varIdx] = LoadFromFile<Spectrum>(file_mc,
TString::Format(
"%s/calib_%s", selName, varName).Data()).
release();
306 mc_light_up[selIdx][varIdx] = LoadFromFile<Spectrum>(file_mc,
TString::Format(
"%s/light_up_%s", selName, varName).Data()).
release();
307 mc_light_down[selIdx][varIdx] = LoadFromFile<Spectrum>(file_mc,
TString::Format(
"%s/light_down_%s", selName, varName).Data()).
release();
308 mc_ckv[selIdx][varIdx] = LoadFromFile<Spectrum>(file_mc,
TString::Format(
"%s/ckv_%s", selName, varName).Data()).
release();
322 double POTmc = data[0][0]->
POT();
325 for(
int selIdx = 0; selIdx < 2; ++selIdx){
326 const char* selName = selNames[selIdx].c_str();
327 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
328 const char* varName = defs[varIdx].
name.c_str();
339 for(
auto &
h:{hData[selIdx][varIdx], hMC[selIdx][varIdx], hMC_calibxy_pos[selIdx][varIdx], hMC_calibxy_neg[selIdx][varIdx], hMC_calib[selIdx][varIdx], hMC_light_up[selIdx][varIdx], hMC_light_down[selIdx][varIdx], hMC_ckv[selIdx][varIdx]}){
341 if(defs[varIdx].rebin>1)
h->Rebin(defs[varIdx].rebin);
342 h->GetXaxis()->SetRange(defs[varIdx].lowedge, defs[varIdx].highedge/defs[varIdx].rebin);
345 double nom_mean = hMC[selIdx][varIdx]->GetMean();
346 double pos_mean = hMC_calibxy_pos[selIdx][varIdx]->GetMean();
347 double neg_mean = hMC_calibxy_neg[selIdx][varIdx]->GetMean();
348 double shape_mean = hMC_calib[selIdx][varIdx]->GetMean();
350 string pos_name =
"Calib XY pos (mean "+
std::to_string(pos_mean)+
")";
351 string neg_name =
"Calib XY neg (mean "+
std::to_string(neg_mean)+
")";
352 string shape_name =
"Calib shape (mean "+
std::to_string(shape_mean)+
")";
354 auto c =
MakeMePlot({hMC[selIdx][varIdx], hMC_calibxy_pos[selIdx][varIdx], hMC_calibxy_neg[selIdx][varIdx], hMC_calib[selIdx][varIdx]}, {nom_name, pos_name, neg_name, shape_name},
isFHC);
355 c->SaveAs((
"blpl/"+mode_tag+
"_plot-calib-"+selName+
"-"+varName+
".pdf").c_str());
358 auto c1 =
MakeMePlot({hMC[selIdx][varIdx], hMC_light_up[selIdx][varIdx], hMC_light_down[selIdx][varIdx], hMC_ckv[selIdx][varIdx]}, {
"Nominal",
"Light up",
"Light down",
"Cherenkov"},
isFHC);
359 c1->SaveAs((
"blpl/"+mode_tag+
"_plot-light-ckv-"+selName+
"-"+varName+
".pdf").c_str());
362 if(selIdx>0 && (selIdx%2!=0)){
364 TH1* hEff_mc = (TH1*)hMC[selIdx][varIdx]->
Clone();
366 TH1* hEff_mc_denom = (TH1*)hMC[selIdx-1][varIdx]->
Clone();
367 TH1* hEff_data = (TH1*)hData[selIdx][varIdx]->
Clone();
368 TH1* hEff_data_denom = (TH1*)hData[selIdx-1][varIdx]->
Clone();
369 TH1* hEff_mc_calibxy_pos = (TH1*)hMC_calibxy_pos[selIdx][varIdx]->
Clone();
370 TH1* hEff_mc_calibxy_pos_denom = (TH1*)hMC_calibxy_pos[selIdx-1][varIdx]->
Clone();
371 TH1* hEff_mc_calibxy_neg = (TH1*)hMC_calibxy_neg[selIdx][varIdx]->
Clone();
372 TH1* hEff_mc_calibxy_neg_denom = (TH1*)hMC_calibxy_neg[selIdx-1][varIdx]->
Clone();
373 TH1* hEff_mc_calib = (TH1*)hMC_calib[selIdx][varIdx]->
Clone();
374 TH1* hEff_mc_calib_denom = (TH1*)hMC_calib[selIdx-1][varIdx]->
Clone();
375 TH1* hEff_mc_light_up = (TH1*)hMC_light_up[selIdx][varIdx]->
Clone();
376 TH1* hEff_mc_light_up_denom = (TH1*)hMC_light_up[selIdx-1][varIdx]->
Clone();
377 TH1* hEff_mc_light_down = (TH1*)hMC_light_down[selIdx][varIdx]->
Clone();
378 TH1* hEff_mc_light_down_denom = (TH1*)hMC_light_down[selIdx-1][varIdx]->
Clone();
379 TH1* hEff_mc_ckv = (TH1*)hMC_ckv[selIdx][varIdx]->
Clone();
380 TH1* hEff_mc_ckv_denom = (TH1*)hMC_ckv[selIdx-1][varIdx]->
Clone();
382 hEff_mc->Divide(hEff_mc_denom);
383 hEff_data->Divide(hEff_data_denom);
384 hEff_mc_calibxy_pos->Divide(hEff_mc_calibxy_pos_denom);
385 hEff_mc_calibxy_neg->Divide(hEff_mc_calibxy_neg_denom);
386 hEff_mc_calib->Divide(hEff_mc_calib_denom);
387 hEff_mc_light_up->Divide(hEff_mc_light_up_denom);
388 hEff_mc_light_down->Divide(hEff_mc_light_down_denom);
389 hEff_mc_ckv->Divide(hEff_mc_ckv_denom);
391 auto c2 =
MakeMePlot({hEff_mc, hEff_mc_calibxy_pos, hEff_mc_calibxy_neg, hEff_mc_calib}, {
"Nominal",
"Calib XY pos",
"Calib XY neg",
"Calib shape"},
isFHC,
"Selection efficiency");
392 c2->SaveAs((
"blpl/"+mode_tag+
"_plot-efficiency-calib-"+selName+
"-"+varName+
".pdf").c_str());
395 auto c3 =
MakeMePlot({hEff_mc, hEff_mc_light_up, hEff_mc_light_down, hEff_mc_ckv}, {
"Nominal",
"Light up",
"Light down",
"Cherenkov"},
isFHC,
"Selection efficiency");
396 c3->SaveAs((
"blpl/"+mode_tag+
"_plot-efficiency-light-"+selName+
"-"+varName+
".pdf").c_str());
399 hEff_mc_light_up->SetLineColor(
kViolet);
400 hEff_mc_light_down->SetLineColor(kPink);
401 hEff_mc_calib->SetLineColor(
kOrange);
402 auto c4 =
MakeMePlot({hEff_mc, hEff_mc_light_up, hEff_mc_light_down, hEff_mc_ckv, hEff_mc_calibxy_pos, hEff_mc_calibxy_neg, hEff_mc_calib}, {
"Nominal",
"Light up",
"Light down",
"Cherenkov",
"Calib XY pos",
"Calib XY neg",
"Calib shape"},
isFHC,
"Selection efficiency");
406 auto tmp =
MakeMePlot({hEff_data, hEff_mc}, {
"Data",
"MC"},
isFHC,
"Selection efficiency");
407 tmp->SaveAs((
"blpl/"+
weight+mode_tag+
"_plot-efficiency-"+selName+
"-"+varName+
".pdf").c_str());
412 TCanvas *c5 =
new TCanvas(
"c5",
"canvas", 1000, 1000);
413 TPad*
p1 =
new TPad(
"",
"", 0, 0, 1, 1);
414 TPad*
p2 =
new TPad(
"",
"", 0, 0, 1, 1);
415 p1->SetBottomMargin(.3);
416 p2->SetTopMargin(.7);
419 p->SetLeftMargin(0.105);
431 Int_t ci = TColor::GetFreeColorIndex();
432 TColor *
color =
new TColor(ci, 216/255.0, 216/255.0, 216/255.0);
434 Int_t
line = kGray+2;
436 if(drawing_options.Contains(
"red")) {
441 hEff_data->SetLineColor(line_data);
442 hEff_mc->SetLineColor(line);
443 hEff_data->SetLineWidth(2);
444 hEff_mc->SetLineWidth(2);
445 hEff_mc->SetMaximum(1.2);
446 hEff_mc->SetMinimum(0);
447 hEff_mc->GetXaxis()->SetRange(0, 45);
448 hEff_mc->GetYaxis()->CenterTitle();
449 hEff_mc->GetXaxis()->CenterTitle();
450 hEff_mc->GetYaxis()->SetTitle(
"Selection efficiency");
451 hEff_mc->Draw(
"hist E1");
452 std::vector<TH1*> syst = {hEff_mc_light_up, hEff_mc_light_down, hEff_mc_ckv, hEff_mc_calibxy_pos, hEff_mc_calibxy_neg, hEff_mc_calib};
453 TGraphAsymmErrors*
g =
new TGraphAsymmErrors;
454 TH1F* hUp = (TH1F*)hEff_mc->Clone();
455 TH1F* hDown = (TH1F*)hEff_mc->Clone();
456 for(
int binIdx = 0; binIdx < hEff_mc->GetNbinsX()+2; ++binIdx){
457 const double y = hEff_mc->GetBinContent(binIdx);
458 g->SetPoint(binIdx, hEff_mc->GetXaxis()->GetBinCenter(binIdx),
y);
459 const double w = hEff_mc->GetXaxis()->GetBinWidth(binIdx);
462 for(
unsigned int systIdx = 0; systIdx < syst.size(); ++systIdx){
463 double shift = syst[systIdx]->GetBinContent(binIdx)-
y;
464 if(shift < 0) errDn += shift*shift;
465 if(shift >= 0) errUp+= shift*shift;
467 g->SetPointError(binIdx, w/2, w/2,
sqrt(errDn),
sqrt(errUp));
468 hUp->SetBinContent(binIdx, hEff_mc->GetBinContent(binIdx)+
sqrt(errUp));
469 hDown->SetBinContent(binIdx, hEff_mc->GetBinContent(binIdx) -
sqrt(errDn));
473 hEff_mc->SetLineWidth(3);
474 hEff_mc->Draw(
"hist E1 same");
475 hEff_data->SetMarkerStyle(8);
476 hEff_data->SetMarkerSize(2);
477 hEff_data->Draw(
"E1 same");
481 double systname_x = 0.05;
483 double leg_x_max = 0.85;
494 auto *tt =
new TText(gPad->GetUxmax()*0.55, 1.05*gPad->GetUymax(),
"Neutrino beam, MRE");
495 tt->SetTextSize(0.04);
497 tt =
new TText(gPad->GetUxmax()*systname_x, 0.9*gPad->GetUymax(),
"Calibration + lightlevel syst.");
498 tt->SetTextSize(0.03);
501 auto *tt =
new TText(gPad->GetUxmax()*0.5, 1.05*gPad->GetUymax(),
"Antineutrino beam, MRE");
502 tt->SetTextSize(0.04);
504 tt =
new TText(gPad->GetUxmax()*systname_x, 0.9*gPad->GetUymax(),
"Calibration + lightlevel syst.");
505 tt->SetTextSize(0.03);
508 TLegend *
leg =
new TLegend(leg_x,0.77,leg_x_max,0.87);
509 leg->SetTextSize(0.033);
510 leg->AddEntry(hEff_data,
"Data",
"p");
511 leg->AddEntry(hEff_mc,
"Monte Carlo",
"l");
512 leg->AddEntry(g,
"1#sigma syst. error",
"f");
520 auto temp = (TH1*)hEff_mc->Clone();
521 temp->Divide(hEff_data);
523 auto temp_up = (TH1*)hUp->Clone();
524 auto temp_down = (TH1*)hDown->Clone();
525 temp_up->Divide(hEff_data);
526 temp_down->Divide(hEff_data);
528 TGraphAsymmErrors* g_ratio =
new TGraphAsymmErrors;
529 for(
int binIdx = 0; binIdx <
temp->GetNbinsX()+2; ++binIdx){
530 const double w =
temp->GetXaxis()->GetBinWidth(binIdx);
531 g_ratio->SetPoint(binIdx,
temp->GetXaxis()->GetBinCenter(binIdx),
temp->GetBinContent(binIdx));
532 g_ratio->SetPointError(binIdx, w/2, w/2,
temp->GetBinContent(binIdx) - temp_down->GetBinContent(binIdx), temp_up->GetBinContent(binIdx) -
temp->GetBinContent(binIdx));
535 g_ratio->SetFillColor(ci);
536 g_ratio->Draw(
"e2 same");
538 TLine *
l =
new TLine(-0.1,1,4.5,1);
539 l->SetLineColor(kBlack);
541 temp->GetYaxis()->SetRangeUser(0.5, 1.5);
542 temp->GetYaxis()->SetTitle(
"MC / Data");
545 c5->SaveAs((
"blpl/"+mode_tag+
"_plot-efficiency-error-band-"+selName+
"-"+varName+
"_"+drawing_options+
".pdf"));
553 cout<<
"Data "<<hData[0][0]->Integral()<<
" "<<hData[1][0]->Integral()<<
" "<<hData[1][0]->Integral()/hData[0][0]->Integral()<<
endl;
554 cout<<
"MC "<<hMC[0][0]->Integral()<<
" "<<hMC[1][0]->Integral()<<
" "<<hMC[1][0]->Integral()/hMC[0][0]->Integral()<<
endl;
555 cout<<
"difference "<<(hMC[1][0]->Integral()/hMC[0][0]->Integral() - hData[1][0]->Integral()/hData[0][0]->Integral())/(hMC[1][0]->
Integral()/hMC[0][0]->Integral())<<endl;
559 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
560 const char* varName = defs[varIdx].
name.c_str();
561 TCanvas *c6 =
new TCanvas(
"c6",
"canvas", 1000, 800);
562 c6->SetLeftMargin(0.105);
564 Int_t ci = TColor::GetFreeColorIndex();
565 TColor *
color =
new TColor(ci, 216/255.0, 216/255.0, 216/255.0);
567 Int_t
line = kGray+2;
569 if(drawing_options.Contains(
"red")) {
575 auto hMC_presel = hMC[0][varIdx];
576 auto hMC_full = hMC[1][varIdx];
577 auto hData_presel = hData[0][varIdx];
578 auto hData_full = hData[1][varIdx];
580 hMC_presel->SetLineStyle(7);
581 hData_presel->SetLineStyle(7);
582 hData_presel->SetLineColor(line);
583 hData_full->SetLineColor(line_data);
584 hMC_presel->SetLineColor(line);
585 hMC_full->SetLineColor(line_data);
586 for (
auto &
h:{hMC_presel, hMC_full, hData_presel, hData_full}){
590 hData_presel->SetMarkerStyle(8);
591 hData_presel->SetMarkerColor(line);
592 hData_presel->SetMarkerSize(2);
593 hData_full->SetMarkerStyle(8);
594 hData_full->SetMarkerSize(2);
595 hData_presel->SetMaximum(hData_presel->GetMaximum()*1.2);
596 hData_presel->SetMinimum(0);
597 hMC_presel->GetXaxis()->SetRange(defs[varIdx].lowedge, defs[varIdx].highedge/defs[varIdx].rebin);;
598 hMC_presel->GetYaxis()->CenterTitle();
599 hMC_presel->GetXaxis()->CenterTitle();
600 hMC_presel->GetYaxis()->SetTitle(
TString::Format(
"10^{4} events / %1.2g #times 10^{20} POT", POTmc/1E20).Data());
602 hMC_presel->Draw(
"hist E1");
603 hData_presel->Draw(
"E1 same");
604 hData_full->Draw(
"E1 same");
605 hMC_full->Draw(
"hist E1 same");
610 auto *tt =
new TText(gPad->GetUxmax()*0.6, 1.05*gPad->GetUymax(),
"Neutrino beam, MRE");
611 tt->SetTextSize(0.04);
615 auto *tt =
new TText(gPad->GetUxmax()*0.55, 1.05*gPad->GetUymax(),
"Antineutrino beam, MRE");
616 tt->SetTextSize(0.04);
620 TLegend *
leg =
new TLegend(0.55, 0.68, 0.85, 0.9);
621 leg->SetTextSize(0.033);
622 leg->AddEntry(hData_presel,
"Data, preselected",
"p");
623 leg->AddEntry(hMC_presel,
"Monte Carlo, preselected",
"l");
624 leg->AddEntry(hData_full,
"Data, fully selected",
"p");
625 leg->AddEntry(hMC_full,
"Monte Carlo, fully selected",
"l");
632 c6->SaveAs((
"blpl/"+
weight+mode_tag+
"_plot-data-mc-presel-and-fullsel-"+varName+
"_"+drawing_options+
".pdf"));
caf::Proxy< size_t > npng
const Cut kNue2017MRParentSliceCut([](const caf::SRProxy *sr){const caf::SRMRCCParentProxy &parent=sr->parent.mrccpar;if(parent.eff< 0.9||parent.pur< 0.9) return false;if(parent.remid< 0.75) return false;if(parent.numuE< 0|| parent.nhit< 20|| parent.contplanes< 5) return false;if(parent.firstplane< 2 || parent.lastplane > 211|| parent.muonstop.Z() > 1275|| parent.muonfwdcell< 5 || parent.muonbkcell< 9 || parent.hadEinmucat > 0.03) return false;return true;})
caf::Proxy< caf::SRFuzzyK > fuzzyk
Cuts and Vars for the 2020 FD DiF Study.
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.
double Integral(const Spectrum &s, const double pot, int cvnregion)
const Var kMREParentNumuE([](const caf::SRProxy *sr){if(std::isnan(1.*sr->parent.mrccpar.numuE)) return-1000.0f;return float(sr->parent.mrccpar.numuE);})
Proxy for caf::StandardRecord.
std::vector< double > Spectrum
void SetSpillCut(const SpillCut &cut)
TCanvas * MakeMePlot(std::vector< TH1 * > Histos, std::vector< TString > Names, bool isFHC, string yname="none")
Representation of a spectrum in any variable, with associated POT.
const XML_Char const XML_Char * data
caf::Proxy< caf::SRElastic > elastic
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
const Cut kNue2020NDPresel
void mre_blessed(bool plot=true, bool isFHC=true, TString drawing_options="red")
virtual void Go() override
Load all the registered spectra.
void SaveTo(TDirectory *dir, const std::string &name) const
const HistDef defs[kNumVars]
const SystShifts kNoShift
const Var kNueEnergy2020([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;if(kIsRHC(sr)) return kNueEnergyRHC2020(sr);else return kNueEnergyFHC2020(sr);})
Nue energy with 3d prong info. only (old version of vars)
caf::Proxy< bool > IsValid
caf::Proxy< caf::SRSlice > slc
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
caf::Proxy< caf::SRVertexBranch > vtx
const std::string selNames[kNumSels]
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
std::string to_string(ModuleType const mt)