3 #include "CAFAna/Core/Binning.h" 4 #include "CAFAna/Core/Cut.h" 5 #include "CAFAna/Core/HistAxis.h" 12 #include "CAFAna/Cuts/NueCutsSecondAna.h" 49 TLegend*
leg =
new TLegend(x0, y0, x1, y1);
52 TH1*
dummy =
new TH1F(
"",
"", 1, 0, 1);
53 TH1* dummyFill =
new TH1F(
"",
"", 1, 0, 1);
57 dummy->SetMarkerStyle(kFullCircle);
59 dummy->SetLineColor(kGray+2);
60 dummy->SetMarkerColor(kGray+2);
62 leg->AddEntry(dummy->Clone(),
"ND #nu_{#mu} Total MC",
"l");
65 leg->AddEntry(dummy->Clone(),
"FD signal #nu_{e}",
"l");
72 const double kPOT = 8.09e20;
106 mycalc.
SetdCP(3*TMath::Pi()/2);
110 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
111 const char* selName = selNamesND[selIdx].c_str();
112 const char* wName = weight_name.c_str();
114 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
115 const char* varName = defs[varIdx].
name.c_str();
119 predsND[selIdx][varIdx] = LoadFromFile<IPrediction>(fname_ND,
TString::Format(
"%s/pred_%s_%s", selName, wName, varName).Data()).
release();
121 if(selIdx == 0 && varIdx == 0)
129 TFile * file_no =
new TFile (fname_FD.c_str(),
"READ");
131 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
133 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
135 if(varName ==
"recoQ2") {
136 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_trueQ2").c_str());
137 }
else if(varName ==
"CosNumi"){
138 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_CosTheta").c_str());
140 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_"+varName).c_str());
145 TH1* hFullNDHists[kNumVars-1];
146 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
148 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
156 TCanvas *
c2 =
new TCanvas(
"c2",
"c2",500,400);
159 TPad *padAbs =
new TPad(
"padAbs",
"padAbs", 0, 0.3, 1, 1.0);
160 padAbs -> SetBottomMargin(0);
161 padAbs->SetFillStyle(0);
162 padAbs -> SetLeftMargin(0.15);
167 double legendxlow=0.55;
168 double legendxhigh=0.95;
170 if(varName==
"trueW2"||varName==
"CosNumi"){legendxlow=0.2; legendxhigh=0.5;}
179 TH1* hFD = predFD->PredictComponent(&mycalc,
186 TH1* hND = predND->
Predict(&noosc).
ToTH1(kPOT*hFD->Integral()/hAux->Integral());
191 hND->Rebin(rebinFactor);
195 hND->GetXaxis()->CenterTitle();
196 hND->GetYaxis()->CenterTitle();
197 hND->GetXaxis()->SetDecimals();
198 hND->GetYaxis()->SetDecimals();
199 hND->GetYaxis()->SetTitleOffset(1.15);
200 hND->GetXaxis()->SetLabelSize(.0);
201 hND->GetYaxis()->SetLabelSize(.05);
202 hND->SetMaximum(1.1*TMath::Max(hND->GetMaximum(), hFD->GetMaximum()));
205 if(varName==
"recoQ2" || varName==
"trueQ2"){
206 hND->GetXaxis()->SetRangeUser(0,2);
209 if(varName==
"recoE"){
210 hND->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
212 hND->GetXaxis()->SetNdivisions(405,kFALSE);
213 hND->SetMinimum(.001);
215 hND ->DrawCopy(
"hist");
217 hND->Draw(
"hist same");
218 hFD->Draw(
"hist same");
221 padAbs->RedrawAxis();
225 Legend(legendxlow, .70, legendxhigh, .85);
228 TLatex* selTitle =
new TLatex(.935, .95, wTitle.c_str());
230 selTitle->SetTextSize(2/30.);
231 selTitle->SetTextAlign(32);
235 TPad *padRatio =
new TPad(
"padRatio",
"padRatio", 0, 0.05, 1, 0.3);
236 padRatio -> SetTopMargin(0);
237 padRatio -> SetBottomMargin(0.25);
239 padRatio -> SetLeftMargin(0.15);
244 TH1* hRatio = (TH1*)hFD ->
Clone(
"hRatio");
247 if(varName==
"trueW2") {b = 2.0;}
248 if(varName==
"trueQ2") {b = 2.0;}
249 if(varName==
"recoQ2") {b = 2.0;}
250 if(varName==
"PtP" || varName==
"CosNumi") {b = 1.0;}
252 TLine* lOne =
new TLine(0,1.0,b,1.0);
257 hRatio->GetXaxis()->CenterTitle();
258 hRatio->GetYaxis()->CenterTitle();
259 hRatio->GetYaxis()->SetLabelSize(4.0/30.);
260 hRatio->GetXaxis()->SetLabelSize(4.0/30.);
261 hRatio->GetXaxis()->SetLabelOffset(.04);
262 hRatio->GetXaxis()->SetTickSize(.06);
263 hRatio->GetYaxis()->SetTitleSize(4.5/30.);
264 hRatio->GetXaxis()->SetTitleSize(4.5/30.);
265 hRatio->GetYaxis()->SetRangeUser(0.5,1.5);
266 hRatio->SetMarkerSize(.1);
267 hRatio->GetXaxis()->SetDecimals();
268 hRatio->GetYaxis()->SetDecimals();
269 hRatio->GetYaxis()->SetTitleOffset(0.4);
270 hRatio->GetYaxis()->SetTitle(
"Sig. FD/#nu_{#mu} ND");
272 if(varName==
"recoE"){
273 hRatio->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
275 if(varName==
"recoQ2"){
276 hRatio->GetXaxis()->SetTitle(
"ND reco Q^{2} vs. FD true Q^{2} (GeV^{2})");
279 if(varName==
"recoQ2" || varName==
"trueQ2"){
280 hRatio->GetXaxis()->SetRangeUser(0,2);
283 hRatio->GetYaxis()->SetNdivisions(502,kFALSE);
284 hRatio->GetXaxis()->SetNdivisions(405,kFALSE);
286 hRatio->
Draw(
"hist");
287 lOne ->
Draw(
"same");
289 c2->Print((
"plots/FDvsND_REW_"+weight_name+
"_"+selName+
"_"+varName+
".png").c_str());
Pass neutrinos through unchanged.
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]
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
void plot_NDvsFD_REW(const std::string weight_name, const std::string fname_ND, const std::string fname_FD)
Float_t x1[n_points_granero]
const Color_t kTotalMCErrorBandColor
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)
osc::NoOscillations noosc
void Legend(double x0, double y0, double x1, double y1)
void SetDmsq32(const T &dmsq32) override
void SetdCP(const T &dCP) override
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