74 const double kPOT = 8.09e20;
109 mycalc.
SetdCP(3*TMath::Pi()/2);
113 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
114 const char* selName = selNamesND[selIdx].c_str();
115 const char* wName = weight_name.c_str();
117 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
118 const char* varName = defs[varIdx].
name.c_str();
122 predsND[selIdx][varIdx] = LoadFromFile<IPrediction>(fname_ND,
TString::Format(
"%s/pred_%s_%s", selName, wName, varName).Data()).
release();
123 predsNDnon[selIdx][varIdx] = LoadFromFile<IPrediction>(fname_NDnon,
TString::Format(
"%s/pred_%s", selName, varName).Data()).
release();
125 if(selIdx == 0 && varIdx == 0)
133 TFile * file_no =
new TFile (fname_FD.c_str(),
"READ");
135 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
137 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
139 if(varName ==
"recoQ2") {
140 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_trueQ2").c_str());
141 }
else if(varName ==
"CosNumi"){
142 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_CosTheta").c_str());
144 dpred_no[selIdx][varIdx] = file_no->GetDirectory((
"prediction/nue_pred_noextrap_"+selName+
"_"+varName).c_str());
149 TH1* hFullNDHists[kNumVars-1];
150 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
152 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
160 TCanvas *
c2 =
new TCanvas(
"c2",
"c2",500,400);
163 TPad *padAbs =
new TPad(
"padAbs",
"padAbs", 0, 0.3, 1, 1.0);
164 padAbs -> SetBottomMargin(0);
165 padAbs->SetFillStyle(0);
166 padAbs -> SetLeftMargin(0.15);
171 double legendxlow=0.45;
172 double legendxhigh=0.85;
174 if(varName==
"trueW2"||varName==
"CosNumi"){legendxlow=0.2; legendxhigh=0.6;}
179 IPrediction* predNDnon = predsNDnon[selIdx][varIdx];
185 TH1* hFD = predFD->PredictComponent(&mycalc,
193 TH1* hND = predND->
Predict(&noosc).
ToTH1(kPOT*hFD->Integral()/hAux->Integral());
194 TH1* hNDnon = predNDnon->
Predict(&noosc).
ToTH1(kPOT*hFD->Integral()/hAuxnon->Integral());
197 hNDnon->SetLineColor(1);
200 hND->Rebin(rebinFactor);
201 hNDnon->Rebin(rebinFactor);
205 hND->GetXaxis()->CenterTitle();
206 hND->GetYaxis()->CenterTitle();
207 hND->GetXaxis()->SetDecimals();
208 hND->GetYaxis()->SetDecimals();
209 hND->GetYaxis()->SetTitleOffset(1.15);
210 hND->GetXaxis()->SetLabelSize(.0);
211 hND->GetYaxis()->SetLabelSize(.05);
212 hND->SetMaximum(1.1*TMath::Max(hND->GetMaximum(), TMath::Max(hNDnon->GetMaximum(), hFD->GetMaximum())));
213 if(varName==
"trueW2"){
214 hND->SetMaximum(1.2*hND->GetMaximum());
219 if(varName==
"recoQ2" || varName==
"trueQ2"){
220 hND->GetXaxis()->SetRangeUser(0,2);
223 if(varName==
"recoE"){
224 hND->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
226 hND->GetXaxis()->SetNdivisions(405,kFALSE);
227 hND->SetMinimum(.001);
229 hND ->DrawCopy(
"hist");
231 hNDnon->Draw(
"hist same");
233 hND->Draw(
"hist same");
234 hFD->Draw(
"hist same");
237 padAbs->RedrawAxis();
241 Legend(legendxlow, .63, legendxhigh, .85);
244 TLatex* selTitle =
new TLatex(.935, .95, wTitle.c_str());
246 selTitle->SetTextSize(2/30.);
247 selTitle->SetTextAlign(32);
251 TPad *padRatio =
new TPad(
"padRatio",
"padRatio", 0, 0.05, 1, 0.3);
252 padRatio -> SetTopMargin(0);
253 padRatio -> SetBottomMargin(0.25);
255 padRatio -> SetLeftMargin(0.15);
260 TH1* hRatio = (TH1*)hND ->
Clone(
"hRatio");
261 TH1* hRationon = (TH1*)hNDnon ->
Clone(
"hRationon");
264 if(varName==
"trueW2") {b = 2.0;}
265 if(varName==
"trueQ2") {b = 2.0;}
266 if(varName==
"recoQ2") {b = 2.0;}
267 if(varName==
"PtP" || varName==
"CosNumi") {b = 1.0;}
269 TLine* lOne =
new TLine(0,1.0,b,1.0);
275 hRatio->GetXaxis()->CenterTitle();
276 hRatio->GetYaxis()->CenterTitle();
277 hRatio->GetYaxis()->SetLabelSize(4.0/30.);
278 hRatio->GetXaxis()->SetLabelSize(4.0/30.);
279 hRatio->GetXaxis()->SetLabelOffset(.04);
280 hRatio->GetXaxis()->SetTickSize(.06);
281 hRatio->GetYaxis()->SetTitleSize(4.5/30.);
282 hRatio->GetXaxis()->SetTitleSize(4.5/30.);
283 hRatio->GetYaxis()->SetRangeUser(0,2);
284 if(varName==
"CosNumi"){
285 hRatio->GetYaxis()->SetRangeUser(0.5,2.5);
287 hRatio->SetMarkerSize(.1);
288 hRatio->GetXaxis()->SetDecimals();
289 hRatio->GetYaxis()->SetDecimals();
290 hRatio->GetYaxis()->SetTitleOffset(0.4);
291 hRatio->GetYaxis()->SetTitle(
"#nu_{#mu} ND/Sig. FD");
293 if(varName==
"recoE"){
294 hRatio->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
296 if(varName==
"recoQ2"){
297 hRatio->GetXaxis()->SetTitle(
"ND reco Q^{2} or FD true Q^{2} (GeV^{2})");
300 if(varName==
"recoQ2" || varName==
"trueQ2"){
301 hRatio->GetXaxis()->SetRangeUser(0,2);
304 hRatio->GetYaxis()->SetNdivisions(502,kFALSE);
305 hRatio->GetXaxis()->SetNdivisions(405,kFALSE);
307 hRatio-> DrawCopy(
"hist");
308 lOne ->
Draw(
"same");
309 hRationon->Draw(
"hist same");
310 hRatio->Draw(
"hist same");
312 c2->Print((
"plots/FDvsND_REW_"+weight_name+
"_"+selName+
"_"+varName+
".png").c_str());
Pass neutrinos through unchanged.
ratio_hxv Divide(hxv, goal_hxv)
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calculator to default assumptions for all parameters.
fvar< T > fabs(const fvar< T > &x)
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
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 SetDmsq32(const T &dmsq32) override
void SetdCP(const T &dCP) override
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)