21 if(hgen->GetBinContent(hgen->GetMaximumBin()) > hgib->GetBinContent(hgib->GetMaximumBin())){
22 hgen->SetTitle((
"#nu_{#mu} CC on "+elem).c_str());
23 hgen->GetYaxis()->SetTitle(
"Events / 10^{20} POT");
25 hgib->Draw(
"hist same");
28 hgib->SetTitle((
"#nu_{#mu} CC on "+elem).c_str());
29 hgib->GetYaxis()->SetTitle(
"Events / 10^{20} POT");
31 hgen->Draw(
"hist same");
37 SpectrumLoader lgenie(
"/nfs/raid5/bckhouse/gibuu/reprocess/*.orig.caf.root");
38 SpectrumLoader lgibuu(
"/nfs/raid5/bckhouse/gibuu/reprocess/*.gibuu.caf.root");
40 const Cut kPreselAny({
"mc.nnu",
"mc.nu.iscc",
"mc.nu.pdg",
41 "mc.nu.vtx.x",
"mc.nu.vtx.y",
"mc.nu.vtx.z"},
44 if(
sr->
mc.
nnu == 0)
return false;
45 if(!
sr->
mc.
nu[0].iscc || !
sr->
mc.
nu[0].pdg == 14)
return false;
46 if(
sr->
mc.
nu[0].vtx.x < -200 ||
sr->
mc.
nu[0].vtx.x > +200 ||
47 sr->
mc.
nu[0].vtx.y < -200 ||
sr->
mc.
nu[0].vtx.y > +200 ||
48 sr->
mc.
nu[0].vtx.z < -100 ||
sr->
mc.
nu[0].vtx.z > 1600)
return false;
52 const Var kGiBUUWgt({
"mc.nnu",
"mc.nu.mode",
"mc.nu.genweight"},
56 if(
sr->
mc.
nu[0].mode >= 0)
return 1.f;
57 return sr->
mc.
nu[0].genweight;
60 const Var kLogWgt({
"mc.nnu",
"mc.nu.mode",
"mc.nu.genweight"},
63 if(
sr->
mc.
nnu == 0)
return -100.f;
64 if(
sr->
mc.
nu[0].mode >= 0)
return -100.f;
68 const Var kTgtZ({
"mc.nnu",
"mc.nu.tgtZ"},
75 const Var kTrueX({
"mc.nnu",
"mc.nu.x"},
78 if(
sr->
mc.
nnu == 0)
return -1.f;
85 if(
sr->
mc.
nnu == 0)
return -1.f;
92 if(
sr->
mc.
nnu == 0)
return -1.f;
96 const Var kTrueW2({
"mc.nnu",
"mc.nu.W2"},
99 if(
sr->
mc.
nnu == 0)
return -1.f;
108 std::map<int, Spects> ssgen, ssgib;
115 std::map<int, std::string>
names = {{1,
"H"},
121 for(
int Z: {1, 6, 8, 17, 22, 26}){
144 sZgib.
ToTH1(1e20,
kRed)->Draw(
"hist same");
146 TLegend*
leg =
new TLegend(.725, .725, .875, .875);
147 leg->SetFillStyle(0);
148 leg->AddEntry(sZgen.
ToTH1(1e20,
kBlue),
"GENIE",
"l");
149 leg->AddEntry(sZgib.
ToTH1(1e20,
kRed),
"GiBUU",
"l");
152 gPad->Print(
"tgtZ.pdf");
156 sWtgib.
ToTH1(1e20)->Draw(
"hist");
157 gPad->Print(
"genweight.pdf");
159 for(
int Z: {1, 6, 8, 17, 22, 26}){
163 gPad->Print((
"Enu_"+names[Z]+
".pdf").c_str());
166 Compare(ssgen[Z].
x, ssgib[Z].x, names[Z]);
168 gPad->Print((
"x_"+names[Z]+
".pdf").c_str());
171 Compare(ssgen[Z].
y, ssgib[Z].y, names[Z]);
173 gPad->Print((
"y_"+names[Z]+
".pdf").c_str());
176 Compare(ssgen[Z].
q2, ssgib[Z].q2, names[Z]);
178 gPad->Print((
"q2_"+names[Z]+
".pdf").c_str());
182 Compare(ssgen[Z].W2, ssgib[Z].W2, names[Z]);
184 gPad->Print((
"W2_"+names[Z]+
".pdf").c_str());
Cuts and Vars for the 2020 FD DiF Study.
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.
Representation of a spectrum in any variable, with associated POT.
const Var kTrueE([](const caf::SRProxy *sr){assert(sr->mc.nnu==1);return sr->mc.nu[0].E;})
virtual void Go() override
Load all the registered spectra.
void plot_kinematics_cafana()
short nnu
Number of neutrinos in nu vector (0 or 1)
std::vector< float > Spectrum
const SystShifts kNoShift
The StandardRecord is the primary top-level object in the Common Analysis File trees.
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
SRTruthBranch mc
Truth branch for MC: energy, flavor, etc.
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
std::vector< SRNeutrino > nu
implemented as a vector to maintain mc.nu structure, i.e. not a pointer, but with 0 or 1 entries...
void Compare(const Spectrum *gen, const Spectrum *gib, const std::string &elem)