1 #include "CAFAna/Core/Binning.h" 24 TString
filename =
"test_genieweight_v0.root";
25 TString imgname =
"plot_test_genieweight.png";
31 (
"/nova/prod/mc/S15-05-22/genie/nd/decaf/numu_contain/000108/**/neardet_genie_fhc_nonswap_nogenierw_2000_r000**_s*_c000*");
37 if(sr->
mc.
nnu == 0)
return false;
39 return (sr->
mc.
nu[0].iscc &&
abs(sr->
mc.
nu[0].pdg)==14);
57 TFile *
file =
new TFile (filename,
"recreate");
58 sp_QE_noW.
SaveTo(file,
"sp_QE_noweight");
59 sp_RES_noW.
SaveTo(file,
"sp_RES_noweight");
60 sp_DIS_noW.
SaveTo(file,
"sp_DIS_noweight");
61 sp_Coh_noW.
SaveTo(file,
"sp_Coh_noweight");
63 sp_QE_Wei.
SaveTo(file,
"sp_QE_weight");
64 sp_RES_Wei.
SaveTo(file,
"sp_RES_weight");
65 sp_DIS_Wei.
SaveTo(file,
"sp_DIS_weight");
66 sp_Coh_Wei.
SaveTo(file,
"sp_Coh_weight");
74 auto hQEno = sp_QE_noW.
ToTH1(thePOT);
75 auto hRESno = sp_RES_noW.
ToTH1(thePOT);
76 auto hDISno = sp_DIS_noW.
ToTH1(thePOT);
77 auto hCohno = sp_Coh_noW.
ToTH1(thePOT);
79 hQEno->SetLineColor(kMagenta);
80 hRESno->SetLineColor(
kGreen+2);
81 hDISno->SetLineColor(
kRed);
82 hCohno->SetLineColor(
kBlue);
84 hQEno->SetLineStyle(2);
85 hRESno->SetLineStyle(2);
86 hDISno->SetLineStyle(2);
87 hCohno->SetLineStyle(2);
89 THStack * hsno =
new THStack (
"noW",
"Stacked histograms; E_{had} (GeV); Events/1E20 POT");
90 hsno->Add(hCohno,
"histo");
91 hsno->Add(hQEno,
"histo");
92 hsno->Add(hRESno,
"histo");
93 hsno->Add(hDISno,
"histo");
95 auto hQE = sp_QE_Wei.
ToTH1(thePOT);
96 auto hRES = sp_RES_Wei.
ToTH1(thePOT);
97 auto hDIS = sp_DIS_Wei.
ToTH1(thePOT);
98 auto hCoh = sp_Coh_Wei.
ToTH1(thePOT);
100 hQE->SetMarkerColor(kMagenta);
101 hRES->SetMarkerColor(
kGreen+2);
102 hDIS->SetMarkerColor(
kRed);
103 hCoh->SetMarkerColor(
kBlue);
105 hQE->SetMarkerStyle(29);
106 hRES->SetMarkerStyle(29);
107 hDIS->SetMarkerStyle(29);
108 hCoh->SetMarkerStyle(29);
110 hQE->SetMarkerSize(2);
111 hRES->SetMarkerSize(2);
112 hDIS->SetMarkerSize(2);
113 hCoh->SetMarkerSize(2);
116 THStack * hsW =
new THStack (
"W",
"Stacked histograms; E_{had} (GeV); Events/1E20 POT");
117 hsW->Add(hCoh,
"hist p");
118 hsW->Add(hQE,
"hist p");
119 hsW->Add(hRES,
"hist p");
120 hsW->Add(hDIS,
"hist p");
122 hsno->SetMaximum(
max(hsno->GetMaximum(),hsW->GetMaximum()));
126 TLegend*
leg =
new TLegend(0.6,0.6,0.89,0.89);
127 leg->AddEntry(hDIS,
"DIS (weighed)",
"p");
128 leg->AddEntry(hRES,
"RES (weighed)",
"p");
129 leg->AddEntry(hQE,
" QE (weighed)",
"p");
130 leg->AddEntry(hCoh,
"Coh (weighed)",
"p");
132 gPad->Print(imgname);
Cuts and Vars for the 2020 FD DiF Study.
void SaveTo(const osc::IOscCalc &x, TDirectory *dir, const std::string &name)
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.
Proxy for caf::StandardRecord.
caf::Proxy< std::vector< caf::SRNeutrino > > nu
caf::Proxy< short int > nnu
void SetSpillCut(const SpillCut &cut)
Representation of a spectrum in any variable, with associated POT.
virtual void Go() override
Load all the registered spectra.
void SaveTo(TDirectory *dir, const std::string &name) const
const SystShifts kNoShift
caf::Proxy< caf::SRTruthBranch > mc
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
assert(nhit_max >=nhit_nbins)
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})