7 #include "CAFAna/Cuts/NueCutsFirstAna.h" 8 #include "CAFAna/Cuts/NueCutsSecondAna.h" 34 TLegend*
leg =
new TLegend(x0, y0, x1, y1);
37 TH1*
dummy =
new TH1F(
"",
"", 1, 0, 1);
38 TH1* dummyFill =
new TH1F(
"",
"", 1, 0, 1);
42 dummy->SetMarkerStyle(kFullCircle);
44 leg->AddEntry(dummy->Clone(),
"ND data",
"lep");
45 dummy->SetLineColor(kGray+2);
46 dummy->SetMarkerColor(kGray+2);
49 leg->AddEntry(dummy->Clone(),
"Total MC",
"l");
52 leg->AddEntry(dummy->Clone(),
"NC",
"l");
54 leg->AddEntry(dummy->Clone(),
"Beam #nu_{e} CC",
"l");
56 leg->AddEntry(dummy->Clone(),
"#nu_{#mu} CC",
"l");
89 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
90 const char* selName = selNames[selIdx].c_str();
91 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
92 const char* varName = defs[varIdx].
name.c_str();
99 if(selIdx == 0 && varIdx == 0)
101 << spects[selIdx][varIdx]->
POT() <<
" " 109 tfile.open(
"plots/TableOut-numuND.tex",
ios::out);
111 tfile <<
"\\begin{tabular}{llllll} \n";
112 tfile <<
"\\multicolumn{6}{c}{numuND} \\\\ \n";
113 tfile <<
"Sample & \\%Data/MC & Data & MC & NC & $\\nu_\\mu$ CC \\\\ \n";
114 tfile <<
"\\hline \n";
117 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
119 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
126 if(varName==
"recoE"){
128 }
else if(varName==
"recoQ2"){
135 TCanvas *
c2 =
new TCanvas(
"c2",
"c2",500,400);
138 TPad *padAbs =
new TPad(
"padAbs",
"padAbs", 0, 0.3, 1, 1.0);
139 padAbs -> SetBottomMargin(0);
140 padAbs->SetFillStyle(0);
141 padAbs -> SetLeftMargin(0.15);
146 double legendxlow=0.6;
147 double legendxhigh=0.95;
148 const double kPOTFD = 8.09e20;
151 Spectrum* spect = spects[selIdx][varIdx];
158 hMC->Rebin(rebinFactor);
165 hNC->Rebin(rebinFactor);
172 hCC->Rebin(rebinFactor);
179 hBeam->Rebin(rebinFactor);
181 TH1* hData = spect->
ToTH1(kPOTFD);
182 hData->SetMarkerStyle(kFullCircle);
183 hData->Rebin(rebinFactor);
185 double intData =
round(100.0*hData->Integral())/100.0;
186 double intMC =
round(100.0*hMC->Integral())/100.0;
187 double intNC =
round(100.0*hNC->Integral())/100.0;
188 double intCC =
round(100.0*hCC->Integral())/100.0;
189 double intBeam =
round(100.0*hBeam->Integral())/100.0;
193 tfile <<
"NOMINAL" <<
" & " << (intData/intMC) <<
" & ";
195 tfile << intData <<
" & ";
197 tfile << intMC <<
" & ";
199 tfile << intNC <<
" & ";
201 tfile << intCC <<
" \\\\ \n";
202 tfile <<
"\\hline \n";
203 tfile <<
"\\end{tabular}";
206 hMC->GetXaxis()->CenterTitle();
207 hMC->GetYaxis()->CenterTitle();
208 hMC->GetXaxis()->SetDecimals();
209 hMC->GetYaxis()->SetDecimals();
210 hMC->GetYaxis()->SetTitleOffset(1.15);
211 hMC->GetXaxis()->SetLabelSize(.0);
212 hMC->GetYaxis()->SetTitle(
TString::Format(
"Events / %.02lf #times 10^{20} POT", kPOTFD/1E20));
214 if(varName==
"recoE"){
215 hMC->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
218 if(varName==
"recoQ2" || varName==
"trueQ2"){
219 hMC->GetXaxis()->SetRangeUser(0,2);
224 if(varName==
"cvne_zoom"||varName==
"shw_len"){
229 hMC->GetXaxis()->SetNdivisions(405,kFALSE);
231 hMC ->SetMinimum(.001);
232 hMC ->SetMaximum(1.1*TMath::Max(hData->GetMaximum(),hMC->GetMaximum()));
234 hMC ->DrawCopy(
"hist");
235 hData->Draw(
"ep same");
237 hNC->Draw(
"hist same");
238 hCC->Draw(
"hist same");
239 hBeam->Draw(
"hist same");
240 hMC->Draw(
"hist same");
241 hData->Draw(
"ep same");
244 padAbs->RedrawAxis();
248 Legend(legendxlow, .5, legendxhigh, .85);
250 TLatex* selTitle =
new TLatex(.935, .95,
"numuND");
252 selTitle->SetTextSize(2/30.);
253 selTitle->SetTextAlign(32);
257 TPad *padRatio =
new TPad(
"padRatio",
"padRatio", 0, 0.05, 1, 0.3);
258 padRatio -> SetTopMargin(0);
259 padRatio -> SetBottomMargin(0.25);
261 padRatio -> SetLeftMargin(0.15);
266 TH1* hRatioMC = (TH1*)hData ->
Clone(
"hRatioMC");
269 if(varName==
"recoQ2"){b=2.0;}
270 if(varName==
"CosNumi" || varName==
"PtP"){b=1.0;}
272 TLine* lOne =
new TLine(0,1.0,b,1.0);
277 TH1* hRatio = (TH1*)hRatioMC ->
Clone(
"hRatio");
279 hRatioMC->GetXaxis()->CenterTitle();
280 hRatioMC->GetYaxis()->CenterTitle();
281 hRatioMC->GetYaxis()->SetLabelSize(3.7/30.);
282 hRatioMC->GetXaxis()->SetLabelSize(3.7/30.);
283 hRatioMC->GetXaxis()->SetLabelOffset(.04);
284 hRatioMC->GetXaxis()->SetTickSize(.06);
285 hRatioMC->GetYaxis()->SetTitleSize(4.5/30.);
286 hRatioMC->GetXaxis()->SetTitleSize(4.5/30.);
287 hRatioMC->GetYaxis()->SetRangeUser(0.5,1.5);
288 hRatioMC->SetMarkerSize(.1);
289 hRatioMC->GetXaxis()->SetDecimals();
290 hRatioMC->GetYaxis()->SetDecimals();
291 hRatioMC->GetYaxis()->SetTitleOffset(0.4);
292 hRatioMC->GetYaxis()->SetTitle(
"Data/MC");
294 if(varName==
"recoQ2" || varName==
"trueQ2"){
295 hRatioMC->GetXaxis()->SetRangeUser(0,2);
298 if(varName==
"recoE"){
299 hRatioMC->GetXaxis()->SetTitle(
"Reconstructed neutrino energy (GeV)");
302 hRatioMC->GetYaxis()->SetNdivisions(502,kFALSE);
303 hRatioMC->GetXaxis()->SetNdivisions(405,kFALSE);
305 hRatioMC ->
Draw(
"ep");
306 lOne ->
Draw(
"same");
308 c2->Print((
"plots/"+selName+
"_"+varName+
".png").c_str());
Pass neutrinos through unchanged.
ratio_hxv Divide(hxv, goal_hxv)
Cuts and Vars for the 2020 FD DiF Study.
virtual Spectrum PredictComponent(osc::IOscCalc *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
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
fvar< T > round(const fvar< T > &x)
ntuple SetFillStyle(1001)
const Color_t kNumuBackgroundColor
Representation of a spectrum in any variable, with associated POT.
Charged-current interactions.
void plot_datamc_ND_numu(std::string fname="datamc_ND_numu_kinematics.root")
const Color_t kBeamNueBackgroundColor
const HistDef defs[kNumVars]
osc::NoOscillations noosc
Neutral-current interactions.
Both neutrinos and antineutrinos.
Standard interface to all prediction techniques.
void Legend(double x0, double y0, double x1, double y1)
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]
const Color_t kNCBackgroundColor