5 #include "CAFAna/Core/Binning.h" 6 #include "CAFAna/Core/Cut.h" 7 #include "CAFAna/Core/HistAxis.h" 14 #include "CAFAna/Cuts/NueCutsSecondAna.h" 50 TLegend*
leg =
new TLegend(x0, y0, x1, y1);
53 TH1*
dummy =
new TH1F(
"",
"", 1, 0, 1);
54 TH1* dummyFill =
new TH1F(
"",
"", 1, 0, 1);
59 leg->AddEntry(dummy->Clone(),
"#nu_{e} signal NOM.",
"l");
60 dummy->SetLineStyle(3);
61 leg->AddEntry(dummy->Clone(),
"trueQ2 REW.",
"l");
62 dummy->SetLineStyle(8);
63 leg->AddEntry(dummy->Clone(),
"PtP REW.",
"l");
64 dummy->SetLineStyle(9);
65 leg->AddEntry(dummy->Clone(),
"CosTheta REW.",
"l");
90 TFile * file_no =
new TFile (filename_no.c_str(),
"READ");
91 if(file_no->IsZombie()){
std::cerr <<
"Can't find " << filename_no.c_str() <<
std::endl;
return;}
92 TFile * file_re =
new TFile (filename_re.c_str(),
"READ");
93 if(file_re->IsZombie()){
std::cerr <<
"Can't find " << filename_re.c_str() <<
std::endl;
return;}
99 mycalc.
SetdCP(3*TMath::Pi()/2);
103 const int kNumTabs = 1;
109 tfile.open(
"plots/FDextrap-TableOut.tex",
ios::out);
111 tfile <<
"\\begin{tabular}{lllll} \n";
112 tfile <<
"\\multicolumn{5}{c}{prop FD $\nu_e$ signal ALL SAMPLES} \\\\ \n";
113 tfile <<
"Sample & Sig.+Bkg. & /NOMINAL & Signal & /NOMINAL \\\\ \n";
114 tfile <<
"\\hline \n";
116 double intTotalFull, intAllFull, intSigFull, intNCFull, intCCFull, intBeamFull, intTauFull;
118 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
120 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
121 bool pidaxes = varIdx;
123 TDirectory * dpred_no = file_no->GetDirectory(
"prediction/nue_pred_AllSamples_recoE");
124 TDirectory * dpred_re = file_re->GetDirectory(
"prediction/nue_pred_trueQ2_AllSamples_recoE");
125 TDirectory * dpred_re_PtP = file_re->GetDirectory(
"prediction/nue_pred_PtP_AllSamples_recoE");
126 TDirectory * dpred_re_Cos = file_re->GetDirectory(
"prediction/nue_pred_Cos_AllSamples_recoE");
136 if(selIdx == 0 && varIdx == 0)
138 << pred_no->Predict(&mycalc).POT() <<
std::endl;
144 TCanvas *
c2 =
new TCanvas(
"c2",
"c2",500,400);
146 TPad *padAbs =
new TPad(
"padAbs",
"padAbs", 0, 0.3, 1, 1.0);
147 padAbs -> SetBottomMargin(0);
148 padAbs->SetFillStyle(0);
149 padAbs -> SetLeftMargin(0.15);
155 const double kPOTFD = 8.09e20;
158 TH1* hNC = pred_no.get()->PredictComponent(&mycalc,
163 TH1* hCC = pred_no.get()->PredictComponent(&mycalc,
168 TH1* hBeam = pred_no.get()->PredictComponent(&mycalc,
173 TH1* hAll = (TH1*)hNC->Clone(
UniqueName().c_str());
178 TH1* hSig_no = pred_no.get()->PredictComponent(&mycalc,
183 hSig_no->Rebin(rebinFactor);
185 TH1* hSig_re = pred_re.get()->PredictComponent(&mycalc,
190 hSig_re->SetLineStyle(3);
191 hSig_re->Rebin(rebinFactor);
193 TH1* hSig_re_PtP = pred_re_PtP.get()->PredictComponent(&mycalc,
198 hSig_re_PtP->SetLineStyle(8);
199 hSig_re_PtP->Rebin(rebinFactor);
201 TH1* hSig_re_Cos = pred_re_Cos.get()->PredictComponent(&mycalc,
206 hSig_re_Cos->SetLineStyle(9);
207 hSig_re_Cos->Rebin(rebinFactor);
209 double intAll = hAll->Integral();
210 double intSig_no = hSig_no->Integral();
211 double intSig_re = hSig_re->Integral();
212 double intSig_re_PtP = hSig_re_PtP->Integral();
213 double intSig_re_Cos = hSig_re_Cos->Integral();
217 tfile <<
"NOMINAL" <<
" & " <<
round(100.0*(intSig_no+intAll))/100.0 <<
" & 0.00 & ";
218 tfile <<
round(100.0*intSig_no)/100.0 <<
" & 0.00 \\\\ \n";
219 tfile <<
"trueQ2 REW." <<
" & " <<
round(100.0*(intSig_re+intAll))/100.0 <<
" & " <<
round(1000.0*((intSig_re+intAll)/(intSig_no+intAll)-1.0))/10.0 <<
" \\% & ";
220 tfile <<
round(100.0*intSig_re)/100.0 <<
" & "<<
round(1000.0*((intSig_re/intSig_no)-1.0))/10.0 <<
" \\% \\\\ \n";
221 tfile <<
"PtP REW." <<
" & " <<
round(100.0*(intSig_re_PtP+intAll))/100.0 <<
" & " <<
round(1000.0*((intSig_re_PtP+intAll)/(intSig_no+intAll)-1.0))/10.0 <<
" \\% & ";
222 tfile <<
round(100.0*intSig_re_PtP)/100.0 <<
" & " <<
round(1000.0*((intSig_re_PtP/intSig_no)-1.0))/10.0 <<
" \\% \\\\ \n";
223 tfile <<
"Cos REW." <<
" & " <<
round(100.0*(intSig_re_Cos+intAll))/100.0 <<
" & " <<
round(1000.0*((intSig_re_Cos+intAll)/(intSig_no+intAll)-1.0))/10.0 <<
" \\% & ";
224 tfile <<
round(100.0*intSig_re_Cos)/100.0 <<
" & " <<
round(1000.0*((intSig_re_Cos/intSig_no))-1.0)/10.0 <<
" \\% \\\\ \n";
225 tfile <<
"\\hline \n";
226 tfile <<
"\\end{tabular}";
229 hSig_re->GetXaxis()->CenterTitle();
230 hSig_re->GetYaxis()->CenterTitle();
231 hSig_re->GetXaxis()->SetDecimals();
232 hSig_re->GetYaxis()->SetDecimals();
233 hSig_re->GetYaxis()->SetTitleOffset(1.15);
234 hSig_re->GetYaxis()->SetRangeUser(.001,1.005*TMath::Max(hSig_re->GetMaximum(),hSig_no->GetMaximum()));
235 hSig_re->GetYaxis()->SetLabelSize(3.7/70.);
236 hSig_re->GetXaxis()->SetLabelSize(.0);
237 hSig_re->SetMaximum(1.1*TMath::Max(hSig_re->GetMaximum(),hSig_no->GetMaximum()));
238 hSig_re->GetYaxis()->SetTitle(
TString::Format(
"Events / %.02lf #times 10^{20} POT", kPOTFD/1E20));
240 if(varName==
"recoE"){
241 hSig_re->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
244 hSig_re->GetXaxis()->SetNdivisions(405,kFALSE);
246 hSig_re->DrawCopy(
"hist");
247 hSig_no->Draw(
"same hist");
248 hSig_re_PtP->Draw(
"same hist");
249 hSig_re_Cos->Draw(
"same hist");
252 padAbs->RedrawAxis();
255 double legendxlow=0.5;
256 double legendxhigh=0.95;
258 Legend(legendxlow, .55, legendxhigh, .85);
260 TLatex* selTitle =
new TLatex(.935, .95,
"FD #nu_{e} signal reweighted");
262 selTitle->SetTextSize(2/30.);
263 selTitle->SetTextAlign(32);
267 TPad *padRatio =
new TPad(
"padRatio",
"padRatio", 0, 0.05, 1, 0.3);
268 padRatio -> SetTopMargin(0);
269 padRatio -> SetBottomMargin(0.25);
271 padRatio -> SetLeftMargin(0.15);
276 TH1* hRatio = (TH1*)hSig_re ->
Clone(
"hRatio");
277 TH1* hRatio_PtP = (TH1*)hSig_re_PtP ->
Clone(
"hRatio_PtP");
278 TH1* hRatio_Cos = (TH1*)hSig_re_Cos ->
Clone(
"hRatio_Cos");
279 TLine* lOne =
new TLine(0,1.0,5.0,1.0);
282 hRatio ->
Divide(hSig_no);
283 hRatio_PtP ->
Divide(hSig_no);
284 hRatio_Cos ->
Divide(hSig_no);
286 hRatio->GetXaxis()->CenterTitle();
287 hRatio->GetYaxis()->CenterTitle();
288 hRatio->GetYaxis()->SetLabelSize(3.7/30.);
289 hRatio->GetXaxis()->SetLabelSize(3.7/30.);
290 hRatio->GetXaxis()->SetLabelOffset(.04);
291 hRatio->GetXaxis()->SetTickSize(.06);
292 hRatio->GetYaxis()->SetTitleSize(4.5/30.);
293 hRatio->GetXaxis()->SetTitleSize(4.5/30.);
294 hRatio->GetYaxis()->SetRangeUser(0.7,1.3);
295 hRatio->SetMarkerSize(.1);
296 hRatio->GetXaxis()->SetDecimals();
297 hRatio->GetYaxis()->SetDecimals();
298 hRatio->GetYaxis()->SetTitleOffset(0.4);
299 hRatio->GetYaxis()->SetTitle(
"REW./NOM.");
301 if(varName==
"recoE"){
302 hRatio->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
305 hRatio->GetYaxis()->SetNdivisions(502,kFALSE);
306 hRatio->GetXaxis()->SetNdivisions(405,kFALSE);
308 hRatio ->
Draw(
"hist");
309 hRatio_PtP ->
Draw(
"hist same");
310 hRatio_Cos ->
Draw(
"hist same");
311 lOne ->
Draw(
"same");
313 c2->Print((
"plots/FDnue_pred_recoE_abs.png"));
ratio_hxv Divide(hxv, goal_hxv)
Cuts and Vars for the 2020 FD DiF Study.
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calculator to default assumptions for all parameters.
fvar< T > fabs(const fvar< T > &x)
Float_t y1[n_points_granero]
Float_t x1[n_points_granero]
const Color_t kTotalMCErrorBandColor
fvar< T > round(const fvar< T > &x)
ntuple SetFillStyle(1001)
const Color_t kNueSignalColor
Charged-current interactions.
Optimized version of OscCalcPMNS.
const HistDef defs[kNumVars]
void SetTh23(const T &th23) override
virtual T GetDmsq32() const
std::unique_ptr< IPrediction > LoadFrom< IPrediction >(TDirectory *dir, const std::string &label)
void SetDmsq32(const T &dmsq32) override
void SetdCP(const T &dCP) override
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
All neutrinos, any flavor.
const std::string selNames[kNumSels]
void Legend(double x0, double y0, double x1, double y1)
std::string UniqueName()
Return a different string each time, for creating histograms.
void plot_nueFD_Signal_REWvsNOM(const std::string filename_no, const std::string filename_re)