9 #include "CAFAna/Core/Binning.h" 13 #include "CAFAna/Core/Var.h" 15 #include "CAFAna/Cuts/NumuCuts.h" 18 #include "CAFAna/Vars/NumuVars.h" 32 std::string fd_nonswap =
"/pnfs/nova/persistent/production/concat/R16-03-03-prod2reco.f/epoch*/prod_decaf_R16-03-03-prod2reco.f_fd_genie_nonswap_fhc_nova_v08_epoch*_numu_contain_v1_prod2-snapshot.root";
48 const Cut kTrueEbelow5({
"mc.nnu",
"mc.nu.E"},
51 if (
sr->
mc.
nnu < 1)
return false;
52 else return (
sr->
mc.
nu[0].E <= 5.0);
55 const Cut kHasTrueMuon({
"energy.numusimp.mc.truegoodmuon",
"energy.numusimp.mc.truemuonE"},
58 if (
sr->
energy.numusimp.mc.truegoodmuon < 1)
return false;
59 else return (
sr->
energy.numusimp.mc.truemuonE > 0);
71 std::vector<double> hadronBins;
72 double hadronAxis = 0.0;
73 for(
int i = 0;
i < 116; ++
i){
74 hadronBins.push_back(hadronAxis);
75 if (hadronAxis < 1.0){hadronAxis = hadronAxis + 0.01;}
76 else if (hadronAxis < 1.5){hadronAxis = hadronAxis + 0.05;}
77 else {hadronAxis = hadronAxis + 0.1;}
88 const int kNumPlots2D = 2;
90 Plot2D plots2D[kNumPlots2D] = {
92 {
"MuonE_hist",
"Reco muon track length (m)", kTrackLengthBinning,
kTrkLength,
"True muon energy (GeV)" , kMuonEnergyBinning,
kTrueMuonE, kCut},
99 for(
int i = 0;
i < kNumPlots2D;
i++)
108 TFile
f(
"2DPlotsForFittingFD.root",
"RECREATE");
110 for(
int i = 0;
i < kNumPlots2D;
i++)
114 h->SetName(p.name.c_str());
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
TH2 * ToTH2(double exposure, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Spectrum must be 2D to obtain TH2.
Represent the binning of a Spectrum's x-axis.
Cuts and Vars for the 2020 FD DiF Study.
void Plot2D(TH1 *total, std::map< std::string, TH1 * > systs, std::vector< std::string > to_plot, std::string basename)
void SetSpillCut(const SpillCut &cut)
const Var kTrkLength([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-5.f;return sr->trk.kalman.tracks[0].len/100;})
const Var kHadCalE([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return float(sr->slc.calE);if(sr->vtx.elastic.fuzzyk.nshwlid< 1) return float(sr->slc.calE);return((sr->slc.calE- sr->vtx.elastic.fuzzyk.png[0].shwlid.calE));})
const Binning kHadEnergyBinning
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.
short nnu
Number of neutrinos in nu vector (0 or 1)
static Binning Custom(const std::vector< double > &edges)
std::vector< float > Spectrum
const SystShifts kNoShift
std::vector< double > POT
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.
const Var kTrueMuonE([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return 0.f;if(sr->mc.nu[0].prim.empty()) return 0.f;if(std::abs(sr->mc.nu[0].prim[0].pdg)!=13) return 0.f;return float(sr->mc.nu[0].prim[0].p.E);})
#define SIMPLEVAR(CAFNAME)
For Vars where literally all you need is a single CAF variable.
SRTruthBranch mc
Truth branch for MC: energy, flavor, etc.
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
SREnergyBranch energy
Energy estimator branch.
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...