15 std::vector<TH1*>
hists,
16 std::vector<TString>
labels,
21 TLegend *
leg =
new TLegend();
22 TCanvas *
c =
new TCanvas();
23 c->Print(outfile+
"[");
26 for(
int i = 0;
i < (
int) hists.size();
i++) {
27 hists[
i]->GetXaxis()->CenterTitle();
28 hists[
i]->GetYaxis()->CenterTitle();
29 if(hists[
i]->
GetMaximum() > maxy) maxy = hists[
i]->GetMaximum();
38 hists[0]->GetYaxis()->SetRangeUser(0, maxy);
39 hists[0]->Draw(draw_option);
40 leg->AddEntry(hists[0], labels[0]);
41 for(
int i = 1;
i < (
int) hists.size();
i++) {
42 hists[
i]->Draw(draw_option +
"same");
43 leg->AddEntry(hists[
i], labels[i]);
46 if(
logx) c->SetLogx();
49 for(
int i = 0;
i < (
int) hists.size();
i++) {
53 hists[
i]->GetYaxis()->SetRangeUser(0, maxy);
54 hists[
i]->Draw(draw_option);
55 if(
logx) c->SetLogx();
58 c->Print(outfile+
"]");
63 std::vector<XSecSysts::Syst_t>
systs,
64 std::vector<TString> systs_labels,
65 std::vector<TString> bkgd_labels,
66 std::vector<Int_t> bkgd_colors)
68 TCanvas *
c =
new TCanvas();
69 c->Print(outfile+
"[");
71 for(
int isyst = 0; isyst < (
int) systs.size(); isyst++) {
73 std::vector<TH1*> bkgds(ncomponents);
74 TLegend *
leg =
new TLegend();
77 selected->SetTitle(
"Selection decomposition: " + systs_labels[isyst]);
78 selected->Draw(
"hist");
79 leg->AddEntry(selected,
"Selected",
"l");
80 for(
int ibkgd = 0; ibkgd < ncomponents; ibkgd++) {
82 bkgds[ibkgd]->SetLineColor(bkgd_colors[ibkgd]);
83 bkgds[ibkgd]->Draw(
"hist same");
84 leg->AddEntry(bkgds[ibkgd], bkgd_labels[ibkgd],
"l");
89 c->Print(outfile+
"]");
95 std::vector<XSecSysts::Syst_t>
systs,
96 std::vector<TString>
labels,
99 std::vector<TH1*>
eff;
100 for(
int isyst = 0; isyst < (
int) systs.size(); isyst++) {
101 eff.push_back((TH1*) xsec_ana->
Efficiency(systs[isyst])->Clone());
102 eff.back()->SetLineColor(colors[isyst]);
103 eff.back()->GetYaxis()->SetTitle(
"#epsilon");
104 eff.back()->GetYaxis()->CenterTitle();
117 std::vector<XSecSysts::Syst_t>
systs,
118 std::vector<TString>
labels,
119 std::vector<Int_t>
colors)
121 std::vector<TH1*>
flux;
122 for(
int isyst = 0; isyst < (
int) systs.size(); isyst++) {
123 flux.push_back(xsec_ana->
Flux(systs[isyst]));
124 flux.back()->SetLineColor(colors[isyst]);
137 std::vector<XSecSysts::Syst_t>
systs,
138 std::vector<TString>
labels)
141 std::vector<TH1*> recotrue;
142 for(
int isyst = 0; isyst< (
int) systs.size(); isyst++) {
158 std::vector<XSecSysts::Syst_t>
systs,
159 std::vector<TString>
labels,
160 std::vector<Int_t>
colors)
162 std::vector<TH1*> signalest;
163 for(
int isyst = 0; isyst < (
int) systs.size(); isyst++) {
166 signalest.back()->SetLineColor(colors[isyst]);
168 labels[isyst].Data()));
182 std::vector<XSecSysts::Syst_t>
systs,
183 std::vector<TString>
labels,
184 std::vector<Int_t>
colors)
186 std::vector<TH1*> signal;
187 for(
int isyst = 0; isyst < (
int) systs.size(); isyst++) {
188 signal.push_back((TH1*) xsec_ana->
UnfoldedSignal(systs[isyst])->Clone());
189 signal.back()->SetLineColor(colors[isyst]);
203 std::vector<XSecSysts::Syst_t>
systs,
204 std::vector<TString>
labels,
205 std::vector<Int_t>
colors)
208 for(
int isyst = 0; isyst < (
int) systs.size(); isyst++) {
209 purity.push_back((TH1*) xsec_ana->
Purity(systs[isyst])->Clone());
210 purity.back()->SetLineColor(colors[isyst]);
224 std::vector<XSecSysts::Syst_t>
systs,
225 std::vector<TString> syst_labels,
226 std::vector<Int_t>
colors,
229 std::vector<TH1*> xsec_over_e;
230 for(
int isyst = 0; isyst < (
int) systs.size(); isyst++) {
231 xsec_over_e.push_back((TH1*) xsec_ana->
GetCrossSection(systs[isyst])->Clone());
232 xsec_over_e.back()->SetLineColor(colors[isyst]);
233 xsec_over_e.back()->GetXaxis()->SetTitle(
"Neutrino Energy (GeV)");
234 xsec_over_e.back()->GetYaxis()->SetTitle(
"#sigma / E_{#nu} (10^{-38} cm^{2} / GeV)");
235 xsec_over_e.back()->GetXaxis()->CenterTitle();
236 xsec_over_e.back()->GetYaxis()->CenterTitle();
237 for(
int ibin = 1;
ibin <= xsec_over_e.back()->GetNbinsX();
ibin++) {
238 double e = xsec_over_e.back()->GetBinCenter(
ibin);
239 double xsec = xsec_over_e.back()->GetBinContent(
ibin);
240 xsec_over_e.back()->SetBinContent(
ibin, xsec / e);
242 xsec_over_e.back()->Scale(1/1
e-38);
258 std::vector<XSecSysts::Syst_t>
systs,
259 std::vector<TString> syst_labels,
260 std::vector<Int_t>
colors,
264 for(
int isyst = 0; isyst < (
int) systs.size(); isyst++) {
265 result.push_back((TH1*) xsec_ana->
GetCrossSection(systs[isyst])->Clone());
266 result.back()->SetLineColor(colors[isyst]);
267 if(
scale > 0) result.back()->Scale(1 /
scale);
268 result.back()->GetXaxis()->SetTitle(xtitle.Data());
269 result.back()->GetYaxis()->SetTitle(ytitle.Data());
272 "Cross Section Result",
281 TGraphAsymmErrors *
g =
new TGraphAsymmErrors();
283 double y = hnom->GetBinContent(
ibin);
284 double x = hnom->GetBinCenter(
ibin);
285 double w = hnom->GetBinWidth(
ibin);
286 double err_up = hup->GetBinContent(
ibin);
287 double err_down = hdown->GetBinContent(
ibin);
288 g->SetPoint(
ibin, x, y);
289 g->SetPointError(
ibin, w/2, w/2, err_up, err_down);
void PlotAllSignalEstimates(TString outfile, ICrossSectionAnalysis *xsec_ana, std::vector< XSecSysts::Syst_t > systs, std::vector< TString > labels, std::vector< Int_t > colors)
Plot all of the signal estimates in a ICrossSectionAnalysis object.
virtual TH1 * Flux(XSecSysts::Syst_t)=0
TH1 * GetCrossSection(XSecSysts::Syst_t)
Cuts and Vars for the 2020 FD DiF Study.
TGraphAsymmErrors * GetAsymmErrorBars(TH1D *hnom, TH1D *hup, TH1D *hdown)
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.
const Spectrum * GetSelectedAllRecoSpace() const
const ISignalEstimator * GetSignalEstimator() const
void PlotAllSelectionDecomposition(TString outfile, ICrossSectionAnalysis *xsec_ana, std::vector< XSecSysts::Syst_t > systs, std::vector< TString > systs_labels, std::vector< TString > bkgd_labels, std::vector< Int_t > bkgd_colors)
void PlotAllPurity(TString outfile, ICrossSectionAnalysis *xsec_ana, std::vector< XSecSysts::Syst_t > systs, std::vector< TString > labels, std::vector< Int_t > colors)
Plot all purity distributions in an ICrossSectionAnalysis object.
void PlotAllRecoTrue(TString outfile, ICrossSectionAnalysis *xsec_ana, std::vector< XSecSysts::Syst_t > systs, std::vector< TString > labels)
Plot all reco to true matrices.
const TH1 * UnfoldedSignal(XSecSysts::Syst_t)
void PlotAllCrossSectionOverENu(TString outfile, ICrossSectionAnalysis *xsec_ana, std::vector< XSecSysts::Syst_t > systs, std::vector< TString > syst_labels, std::vector< Int_t > colors, bool logx=true)
Plot cross section over Enu for each systematic shift.
virtual TH1 * Efficiency(XSecSysts::Syst_t)=0
void PlotAllEfficiency(TString outfile, ICrossSectionAnalysis *xsec_ana, std::vector< XSecSysts::Syst_t > systs, std::vector< TString > labels, std::vector< Int_t > colors)
Plot all efficiencies.
virtual TH1 * Purity(XSecSysts::Syst_t)=0
void PlotAllCrossSectionResult(TString outfile, TString xtitle, TString ytitle, ICrossSectionAnalysis *xsec_ana, std::vector< XSecSysts::Syst_t > systs, std::vector< TString > syst_labels, std::vector< Int_t > colors, double scale=1e-38)
Plot cross section result of each systematic shift.
void PlotAllFlux(TString outfile, ICrossSectionAnalysis *xsec_ana, std::vector< XSecSysts::Syst_t > systs, std::vector< TString > labels, std::vector< Int_t > colors)
Plot all flux spectra.
std::vector< double > POT
const ReweightableSpectrum * GetRecoTrue() const
void PlotAllUnfoldedSignalEstimates(TString outfile, ICrossSectionAnalysis *xsec_ana, std::vector< XSecSysts::Syst_t > systs, std::vector< TString > labels, std::vector< Int_t > colors)
Plot all unfolded signal estimates in an ICrossSectionAnalysis object.
virtual int GetNBkgdComponents() const =0
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
virtual const Spectrum * BackgroundComponent(int) const =0
const CrossSectionSpectra * GetCrossSectionSpectra(XSecSysts::Syst_t)
const Spectrum * SignalEstimate(XSecSysts::Syst_t)
void PlotAll(TString outfile, TString title, std::vector< TH1 * > hists, std::vector< TString > labels, TString draw_option, bool overlay, bool logx=false)
TH2D * ToTH2(double pot) const