4 #include "CAFAna/Core/Binning.h" 5 #include "CAFAna/Core/Cut.h" 6 #include "CAFAna/Core/HistAxis.h" 13 #include "CAFAna/Cuts/NueCutsSecondAna.h" 51 TLegend*
leg =
new TLegend(x0, y0, x1, y1);
54 leg->SetHeader(
"#splitline{#bf{Neutrino Beam}}{CORE sample: cos #theta reweighted}");
55 TH1*
dummy =
new TH1F(
"",
"", 1, 0, 1);
56 TH1* dummyFill =
new TH1F(
"",
"", 1, 0, 1);
60 dummy->SetMarkerStyle(kFullCircle);
62 dummy->SetLineColor(kGray+2);
63 dummy->SetMarkerColor(kGray+2);
65 leg->AddEntry(dummy->Clone(),
"ND #nu_{#mu} MC reweighted",
"l");
66 dummy->SetLineColor(1);
67 leg->AddEntry(dummy->Clone(),
"ND #nu_{#mu} MC nominal",
"l");
70 leg->AddEntry(dummy->Clone(),
"FD MC #nu_{e} + WS",
"l");
77 gStyle->SetPadTickX(1);
78 gStyle->SetPadTickY(0);
80 TH1::AddDirectory(kFALSE);
120 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
121 const char* selName = selNamesND[selIdx].c_str();
122 const char* selNameFD = selNamesFD[selIdx].c_str();
123 const char* wName = weight_name.c_str();
125 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
126 const char* varName = defs[varIdx].
name.c_str();
130 predsND[selIdx][varIdx] = LoadFromFile<IPrediction>(fname_ND,
TString::Format(
"%s/pred_%s_%s", selNameFD, wName, varName).Data()).
release();
131 predsNDnon[selIdx][varIdx] = LoadFromFile<IPrediction>(fname_NDnon,
TString::Format(
"%s/pred_noweight_%s", selNameFD, varName).Data()).
release();
133 if(selIdx == 0 && varIdx == 0)
141 TFile * file_no =
new TFile (fname_FD.c_str(),
"READ");
143 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
145 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
147 if(varName ==
"recoQ2") {
148 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_trueQ2").c_str());
149 }
else if(varName ==
"CosNumi"){
150 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_CosTheta").c_str());
152 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_"+varName).c_str());
157 TH1* hFullNDHists[kNumVars-1];
158 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
160 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
167 if(varName==
"PtP") rebinFactor = 5;
170 TCanvas *
c2 =
new TCanvas(
"c2",
"c2",500,400);
172 TPad *padAbs =
new TPad(
"padAbs",
"padAbs", 0, 0.3, 1, 1.0);
173 padAbs -> SetBottomMargin(0);
174 padAbs->SetFillStyle(0);
175 padAbs->SetFillColor(0);
176 padAbs -> SetLeftMargin(0.15);
181 double legendxlow=0.45;
182 double legendxhigh=0.93;
184 if(varName==
"trueW2"||varName==
"CosNumi"){legendxlow=0.17; legendxhigh=0.6;}
189 IPrediction* predNDnon = predsNDnon[selIdx][varIdx];
197 TH1* hFD = predFD->PredictComponent(&mycalc,
205 TH1* hND = predND->
Predict(&noosc).
ToTH1(kPOT*hFD->Integral()/hAux->Integral());
206 TH1* hNDnon = predNDnon->
Predict(&noosc).
ToTH1(kPOT*hFD->Integral()/hAuxnon->Integral());
209 hNDnon->SetLineColor(1);
212 hFD->Rebin(rebinFactor);
213 hND->Rebin(rebinFactor);
214 hNDnon->Rebin(rebinFactor);
218 hND->GetXaxis()->CenterTitle();
219 hND->GetYaxis()->CenterTitle();
220 hND->GetXaxis()->SetDecimals();
221 hND->GetYaxis()->SetDecimals();
222 hND->GetYaxis()->SetTitleOffset(.8);
223 hND->GetXaxis()->SetLabelSize(.0);
224 hND->GetYaxis()->SetLabelSize(.06);
225 hND->GetYaxis()->SetTitleSize(.06);
226 hND->SetMaximum(1.1*TMath::Max(hND->GetMaximum(), TMath::Max(hNDnon->GetMaximum(), hFD->GetMaximum())));
227 if(varName==
"trueW2"){
228 hND->SetMaximum(1.2*hND->GetMaximum());
233 if(varName==
"recoQ2" || varName==
"trueQ2"){
234 hND->GetXaxis()->SetRangeUser(0,2);
237 if(varName==
"recoE"){
238 hND->GetXaxis()->SetTitle(
"Reconstructed Neutrino Energy (GeV)");
241 if(varName==
"CosNumi") hND->GetXaxis()->SetRangeUser(0.5,1.0);
243 hND->GetXaxis()->SetNdivisions(405,kFALSE);
244 hND->SetMinimum(.001);
248 hNDnon->Draw(
"h same");
251 hFD->Draw(
"hist same");
254 padAbs->RedrawAxis();
258 Legend(legendxlow, .45, legendxhigh, .85);
259 std::string wTitle =
"FD FHC CORE sample: Q^{2} reweighted";
261 if(weight_name ==
"Cos") wTitle =
"FD FHC CORE sample: Cos reweighted";
262 if(weight_name ==
"PtP") wTitle =
"FD FHC CORE sample: p_{T}/p reweighted";
263 wTitle =
"NOvA Simulation";
265 TLatex* selTitle =
new TLatex(.935, .95, wTitle.c_str());
267 selTitle->SetTextSize(2/30.);
268 selTitle->SetTextAlign(32);
269 selTitle->SetTextColor(kGray+1);
273 TPad *padRatio =
new TPad(
"padRatio",
"padRatio", 0, 0.0, 1, 0.33);
274 padRatio -> SetTopMargin(0.11);
275 padRatio -> SetBottomMargin(0.33);
277 padRatio -> SetLeftMargin(0.15);
282 TH1* hRatio = (TH1*)hND ->
Clone(
"hRatio");
283 TH1* hRationon = (TH1*)hNDnon ->
Clone(
"hRationon");
287 if(varName==
"trueW2") {b = 2.0;}
288 if(varName==
"trueQ2") {b = 2.0;}
289 if(varName==
"recoQ2") {b = 2.0;}
290 if(varName==
"PtP" || varName==
"CosNumi") {b = 1.0;}
291 if(varName==
"CosNumi") a=0.5;
293 TLine* lOne =
new TLine(a,1.0,b,1.0);
299 hRatio->GetXaxis()->CenterTitle();
300 hRatio->GetYaxis()->CenterTitle();
301 hRatio->GetYaxis()->SetLabelSize(.12);
302 hRatio->GetXaxis()->SetLabelSize(.12);
303 hRatio->GetXaxis()->SetTitleOffset(1.);
304 hRatio->GetXaxis()->SetLabelOffset(0.03);
305 hRatio->GetXaxis()->SetTickSize(.1);
306 hRatio->GetYaxis()->SetTitleSize(.12);
307 hRatio->GetXaxis()->SetTitleSize(.12);
308 hRatio->GetYaxis()->SetRangeUser(0,2);
309 if(varName==
"CosNumi"){
310 hRatio->GetYaxis()->SetRangeUser(0.5,2.5);
312 hRatio->SetMarkerSize(.1);
313 hRatio->GetXaxis()->SetDecimals();
314 hRatio->GetYaxis()->SetDecimals();
315 hRatio->GetYaxis()->SetTitleOffset(0.4);
316 hRatio->GetYaxis()->SetTitle(
"Ratio to FD #nu_{e}");
318 if(varName==
"recoE"){
319 hRatio->GetXaxis()->SetTitle(
"Reconstructed Neutrino Energy (GeV)");
321 if(varName==
"recoQ2"){
322 hRatio->GetXaxis()->SetTitle(
"ND Reconstructed Q^{2} or FD True Q^{2} (GeV^{2})");
324 if(varName==
"CosNumi"){
325 hRatio->GetXaxis()->SetTitle(
"cos #theta");
328 hRatio->GetXaxis()->SetTitle(
"p_{T}/p");
331 if(varName==
"recoQ2" || varName==
"trueQ2"){
332 hRatio->GetXaxis()->SetRangeUser(0,2);
334 if(varName==
"trueW2"){
335 hRatio->GetXaxis()->SetTitle(
"True W^{2} (GeV^{2})");
338 hRatio->GetYaxis()->SetNdivisions(502,kFALSE);
339 hRatio->GetXaxis()->SetNdivisions(405,kFALSE);
342 hRatio-> DrawCopy(
"hist");
343 lOne ->
Draw(
"same");
344 hRationon->Draw(
"hist same");
345 hRatio->Draw(
"hist same");
346 padRatio->RedrawAxis();
350 c2->Print((
"plots/FDvsND_REW_"+weight_name+
"_"+selName+
"_"+varName+
".png").c_str());
351 c2->Print((
"plots/FDvsND_REW_"+weight_name+
"_"+selName+
"_"+varName+
".pdf").c_str());
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]
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
Float_t x1[n_points_granero]
const Color_t kTotalMCErrorBandColor
ntuple SetFillStyle(1001)
const Color_t kNueSignalColor
void Legend(double x0, double y0, double x1, double y1)
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
void plot_3NDvsFD_FHC(const std::string weight_name, const std::string fname_NDnon, const std::string fname_ND, const std::string fname_FD)
Both neutrinos and antineutrinos.
Standard interface to all prediction techniques.
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
const Color_t kTotalMCColor