4 #include "CAFAna/Core/Binning.h" 5 #include "CAFAna/Core/Cut.h" 6 #include "CAFAna/Core/HistAxis.h" 13 #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);
57 dummy->SetLineColor(kGray+2);
58 dummy->SetMarkerColor(kGray+2);
59 dummy->SetLineColor(1);
60 leg->AddEntry(dummy->Clone(),
"ND #bar{#nu}_{#mu} Total MC",
"l");
62 leg->AddEntry(dummy->Clone(),
"FD signal #bar{#nu}_{e} + WS",
"l");
103 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
104 const char* selName = selNamesND[selIdx].c_str();
105 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
106 const char* varName = defs[varIdx].
name.c_str();
109 predsND[selIdx][varIdx] = LoadFromFile<IPrediction>(fname_ND,
TString::Format(
"%s/pred_%s", selName, varName).Data()).
release();
110 if(selIdx == 0 && varIdx == 0)
118 TFile * file_no =
new TFile (fname_FD.c_str(),
"READ");
120 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
122 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
126 if(varName ==
"recoQ2") {
127 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_trueQ2").c_str());
128 }
else if(varName ==
"CosNumi"){
129 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_CosTheta").c_str());
131 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_"+varName).c_str());
137 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
140 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
145 TCanvas *
c2 =
new TCanvas(
"c2",
"c2",500,400);
148 TPad *padAbs =
new TPad(
"padAbs",
"padAbs", 0, 0.3, 1, 1.0);
149 padAbs -> SetBottomMargin(0);
150 padAbs->SetFillStyle(0);
151 padAbs -> SetLeftMargin(0.15);
156 double legendxlow=0.5;
157 double legendxhigh=0.9;
159 if(varName==
"trueW2"||varName==
"CosNumi"){legendxlow=0.2; legendxhigh=0.5;}
170 TH1* hFD = predFD->PredictComponent(&mycalc,
177 TH1* hND = predND->
Predict(&noosc).
ToTH1(kPOT*hFD->Integral()/hAux->Integral());
179 hND->SetLineColor(1);
184 hND->GetXaxis()->CenterTitle();
185 hND->GetYaxis()->CenterTitle();
186 hND->GetXaxis()->SetDecimals();
187 hND->GetYaxis()->SetDecimals();
188 hND->GetYaxis()->SetTitleOffset(1.0);
189 hND->GetXaxis()->SetLabelSize(.0);
190 hND->GetYaxis()->SetLabelSize(.05);
191 hND->SetMaximum(1.1*hND->GetMaximum());
194 if(varName==
"recoQ2" || varName==
"trueQ2"){
195 hND->GetXaxis()->SetRangeUser(0,2);
198 hND->GetXaxis()->SetNdivisions(405,kFALSE);
199 hND->SetMinimum(.001);
201 hND ->DrawCopy(
"hist");
202 hND->Draw(
"hist same");
203 hFD->Draw(
"hist same");
206 padAbs->RedrawAxis();
210 Legend(legendxlow, .70, legendxhigh, .85);
213 TLatex* selTitle =
new TLatex(.935, .95, (
"nominal "+selName).c_str());
215 selTitle->SetTextSize(2/30.);
216 selTitle->SetTextAlign(32);
222 TPad *padRatio =
new TPad(
"padRatio",
"padRatio", 0, 0.02, 1, 0.33);
223 padRatio -> SetTopMargin(0.1);
224 padRatio -> SetBottomMargin(0.25);
226 padRatio -> SetLeftMargin(0.15);
231 TH1* hRatio = (TH1*)hND ->
Clone(
"hRatio");
234 if(varName==
"trueW2") {b = 2.0;}
235 if(varName==
"trueQ2") {b = 2.0;}
236 if(varName==
"recoQ2") {b = 2.0;}
237 if(varName==
"PtP" || varName==
"CosNumi") {b = 1.0;}
239 TLine* lOne =
new TLine(0,1.0,b,1.0);
244 TH1* hWeight = (TH1*)hFD ->
Clone(
"hWeight");
247 hRatio->GetXaxis()->CenterTitle();
248 hRatio->GetYaxis()->CenterTitle();
249 hRatio->GetYaxis()->SetLabelSize(4.0/30.);
250 hRatio->GetXaxis()->SetLabelSize(4.0/30.);
251 hRatio->GetXaxis()->SetLabelOffset(.04);
252 hRatio->GetXaxis()->SetTickSize(.06);
253 hRatio->GetYaxis()->SetTitleSize(3.5/30.);
254 hRatio->GetXaxis()->SetTitleSize(3.5/30.);
255 hRatio->GetYaxis()->SetRangeUser(0,2.0);
256 hRatio->SetMarkerSize(.1);
257 hRatio->GetXaxis()->SetDecimals();
258 hRatio->GetYaxis()->SetDecimals();
259 hRatio->GetYaxis()->SetTitleOffset(0.4);
260 hRatio->GetXaxis()->SetTitleOffset(1.05);
261 hRatio->GetYaxis()->SetTitle(
"#bar{#nu}_{#mu} ND/Sig.+WS FD");
263 if(varName==
"recoQ2"){
264 hRatio->GetXaxis()->SetTitle(
"ND reco Q^{2} vs. FD true Q^{2} (GeV^{2})");
266 if(varName==
"recoQ2" || varName==
"trueQ2"){
267 hRatio->GetXaxis()->SetRangeUser(0,2);
270 hRatio->GetYaxis()->SetNdivisions(502,kFALSE);
271 hRatio->GetXaxis()->SetNdivisions(405,kFALSE);
273 hRatio ->
Draw(
"hist");
274 lOne ->
Draw(
"same");
275 padRatio -> RedrawAxis();
278 c2->Print((
"plots/FDvsND_"+selName+
"_"+varName+
".png").c_str());
void plot_NDvsFD_weights_RHC(const std::string fname_ND="datamc_ND_numu_kinematics.root", const std::string fname_FD="FDprediction_kinematics.root")
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
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
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
void Legend(double x0, double y0, double x1, double y1)