15 #include "OscLib/func/IOscCalculator.h" 27 TLegend*
leg =
new TLegend(x0, y0, x1, y1);
30 TH1*
dummy =
new TH1F(
"",
"", 1, 0, 1);
31 dummy->SetMarkerStyle(kFullCircle);
33 leg->AddEntry(dummy->Clone(),
"ND data",
"lep");
34 dummy->SetLineColor(kGray+2);
35 dummy->SetMarkerColor(kGray+2);
38 leg->AddEntry(dummy->Clone(),
"Total MC",
"l");
40 leg->AddEntry(dummy->Clone(),
"NC",
"l");
42 leg->AddEntry(dummy->Clone(),
"Beam #nu_{e} CC",
"l");
44 leg->AddEntry(dummy->Clone(),
"#nu_{#mu} CC",
"l");
129 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
130 const char* selName = selNames[selIdx].c_str();
131 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
132 const char* varName = defs[varIdx].
name.c_str();
135 spectsStagger[selIdx][varIdx] = LoadFromFile<Spectrum>(
fname,
TString::Format(
"%s/spect_%s_stagger", selName, varName).Data()).
release();
138 if(selIdx == 0 && varIdx == 0)
140 << spects[selIdx][varIdx]->
POT() <<
" " 144 if(defs[varIdx].
name ==
"confuse" && selIdx == 1){
145 const double pot = spects[selIdx][varIdx]->
POT();
146 TH1*
hd = spects[selIdx][varIdx]->
ToTH1(pot);
147 TH1* hm = preds[selIdx][varIdx]->
Predict(&noosc).
ToTH1(pot);
149 std::cout <<
"DATA: " << hd->GetBinContent(1) <<
" " << hd->GetBinContent(2) <<
" " << hd->GetBinContent(3) <<
" " << hd->GetBinContent(4) <<
" " <<
std::endl;
150 std::cout <<
"MC: " << hm->GetBinContent(1) <<
" " << hm->GetBinContent(2) <<
" " << hm->GetBinContent(3) <<
" " << hm->GetBinContent(4) <<
" " <<
std::endl;
155 for(
int selIdx = 0; selIdx <
kNumSels; ++selIdx){
157 for(
int varIdx = 0; varIdx <
kNumVars; ++varIdx){
162 Spectrum* spect = spects[selIdx][varIdx];
163 Spectrum* spectStagger = spectsStagger[selIdx][varIdx];
167 h->SetTitle(
"NO#nuA Near Detector");
168 h->GetXaxis()->CenterTitle();
169 h->GetYaxis()->CenterTitle();
171 TH1* hstag = spectStagger->
ToTH1(spect->
POT());
172 hstag->SetMarkerStyle(kFullCircle);
173 hstag->SetMarkerColor(kGray+2);
174 hstag->SetLineColor(kGray+2);
177 TH1* horig = spect->
ToTH1(spect->
POT());
178 horig->SetMarkerStyle(kFullCircle);
179 horig->Draw(
"ep same");
184 gPad->Print((
"plots/"+selName+
"_"+varName+
"_lin.eps").c_str());
188 h->SetTitle(
"NO#nuA Near Detector");
189 h->GetXaxis()->CenterTitle();
190 h->GetYaxis()->CenterTitle();
192 hstag->Draw(
"ep same");
193 horig->Draw(
"ep same");
199 gPad->Print((
"plots/"+selName+
"_"+varName+
"_log.eps").c_str());
206 gPad->Print((
"plots/"+selName+
"_"+varName+
"_ratio.eps").c_str());
209 TCanvas*
c =
new TCanvas;
211 TPad*
p1 =
new TPad(
"",
"", 0, 0, 1, 1);
212 TPad*
p2 =
new TPad(
"",
"", 0, 0, 1, 1);
213 p1->SetBottomMargin(.3);
214 p2->SetTopMargin(.7);
222 h->SetTitle(
"NO#nuA Near Detector");
223 h->GetXaxis()->CenterTitle();
224 h->GetYaxis()->CenterTitle();
225 hstag->Draw(
"ep same");
226 horig->Draw(
"ep same");
232 TH1* hratio = ratioStagger.
ToTH1();
233 hratio->SetLineColor(kGray+2);
238 gPad->Print((
"plots/"+selName+
"_"+varName+
"_lin_ratio.eps").c_str());
242 h->SetTitle(
"NO#nuA Near Detector");
243 h->GetXaxis()->CenterTitle();
244 h->GetYaxis()->CenterTitle();
246 horig->Draw(
"ep same");
250 gPad->Print((
"plots/"+selName+
"_"+varName+
"_log_ratio.eps").c_str());
void Legend(double x0, double y0, double x1, double y1)
Pass neutrinos through unchanged.
void DataMCRatio(const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc, double miny, double maxy)
Plot data/MC ratio for the given spectrum. Normalize MC to Data by POT.
Cuts and Vars for the 2020 FD DiF Study.
TH1D * ToTH1(Color_t col=kBlack, Style_t style=kSolid) const
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]
virtual Spectrum PredictUnoscillated() const
const Color_t kNumuBackgroundColor
Representation of a spectrum in any variable, with associated POT.
const Color_t kBeamNueBackgroundColor
const HistDef defs[kNumVars]
osc::NoOscillations noosc
Represent the ratio between two spectra.
TH1 * DataMCComparisonComponents(const Spectrum &data, const IPrediction *mc, osc::IOscCalc *calc)
Plot MC broken down into flavour components, overlayed with data.
void plot_nd_data_mc(std::string fname)
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
const std::string selNames[kNumSels]
const Color_t kNCBackgroundColor