22 #include "NDAna/muonid/NDXSecMuonPID.h" 29 const int ret = gSystem->Load(
"libNDAnamuonid");
39 std::map<TString, SpectrumLoader *>
loaders;
49 std::vector<std::string> opti_labels = {
"fiducial_vtx_x",
"fiducial_vtx_y",
"fiducial_vtx_z"};
51 std::vector<const HistAxis *> opti_axes = {
new HistAxis(
"Vertex in X Direction (cm)",
52 Binning::Simple(40, -200, 200),
54 new HistAxis(
"Vertex in Y Direction (cm)",
55 Binning::Simple(40, -200, 200),
57 new HistAxis(
"Vertex in Z Direction (cm)",
58 Binning::Simple(80, 0, 1200),
87 loaders[
"kLightUpCalibDown"],
88 loaders[
"kLightDownCalibUp"],
99 loaders[
"kCalibShape"],
104 loaders[
"kCherenkov"],
111 std::vector<SystShifts> genie_shifts = genie_multiverse.
GetSystShifts();
138 TFile *
output =
new TFile((
"fiducial_optimization_" + opti_labels[axis] +
".root").c_str(),
"recreate");
139 optimizer->
SaveTo(output, opti_labels[axis].c_str());
const ana::Cut kCVNNueIDCut
const ana::NuTruthCut kNuebarCCST([](const caf::SRNeutrinoProxy *truth){return(truth->iscc && truth->pdg==-12 && truth->pdgorig==-12);})
_HistAxis< Var > HistAxis
Cuts and Vars for the 2020 FD DiF Study.
const ana::Var kNHits([](const caf::SRProxy *sr){return sr->slc.nhit;})
const ana::Cut kFrontPlanes
const std::string PROD5_MC_RHC_LIGHT_UP
const ana::NuTruthCut kTrueDetectorST([](const caf::SRNeutrinoProxy *sr){return(sr->vtx.X()< tvtxmax.X()&&sr->vtx.X() > tvtxmin.X()&&sr->vtx.Y() > tvtxmin.Y()&&sr->vtx.Y()< tvtxmax.Y()&&sr->vtx.Z() > tvtxmin.Z()&&sr->vtx.Z()< tvtxmax.Z());})
const ana::NuTruthCut kNueCCST([](const caf::SRNeutrinoProxy *truth){return(truth->iscc && truth->pdg==12 && truth->pdgorig==12);})
const std::string PROD5_MC_RHC_CALIB_DOWN
GenericSystematicDef< caf::SRProxy > SystematicDef
const std::string PROD5_MC_RHC_LIGHT_DOWN
void DefineNominal(SystematicDef *nominal)
_Var< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
std::vector< const ISyst * > getAllXsecSysts_2020()
const ana::Cut kNuebarCCIncContainmentLoose([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;if(sr->vtx.elastic.fuzzyk.nshwlid< 1) return false;TVector3 start=sr->vtx.elastic.fuzzyk.png[0].shwlid.start;TVector3 stop=sr->vtx.elastic.fuzzyk.png[0].shwlid.stop;for(uint ix=0;ix< sr->vtx.elastic.fuzzyk.nshwlid;ix++){TVector3 start_muoncatcher=sr->vtx.elastic.fuzzyk.png[ix].shwlid.start;TVector3 stop_muoncatcher=sr->vtx.elastic.fuzzyk.png[ix].shwlid.stop;if(std::max(start_muoncatcher.Z(), stop_muoncatcher.Z()) > 1250.0) return false;}if(sr->sel.nuecosrej.distallpngtop< 30) return false;if(sr->sel.nuecosrej.distallpngbottom< 10) return false;if(sr->sel.nuecosrej.distallpngeast< 30) return false;if(sr->sel.nuecosrej.distallpngwest< 10) return false;if(sr->sel.nuecosrej.distallpngfront< 100) return false;return true;})
const std::string PROD5_MC_RHC_NOMINAL
void SaveTo(TDirectory *dir, const std::string &name) const
void DefineMultiverseSystematic(SystematicDef *syst, std::vector< Var > mv_weights)
const std::string PROD5_MC_RHC_CALIB_UP
const std::string PROD5_MC_RHC_CALIB_SHAPE
void SetSpillCuts(const SpillCut &)
void fiducial_optimization(int axis=0)
const std::string PROD5_MC_RHC_CHERENKOV
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
void DefineSystematic(SystematicDef *syst)
std::vector< SystShifts > GetSystShifts()
const ana::Cut kDQ([](const caf::SRProxy *sr){if(sr->sel.nuecosrej.hitsperplane >=8) return false;if(!sr->vtx.elastic.IsValid) return false;if(sr->vtx.elastic.fuzzyk.npng==0) return false;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx<=5||sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity<=5) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.gap > 100) return false; if(sr->vtx.elastic.fuzzyk.nshwlid >=2){if((sr->vtx.elastic.fuzzyk.png[0].shwlid.dir). Dot(sr->vtx.elastic.fuzzyk.png[1].shwlid.dir)< -0.95) return false;}float xyhitdiff=abs(sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx-sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity);float xyhitsum=sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx+sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity;if(xyhitdiff/xyhitsum >=0.4) return false;float nhitall=0.0;for(unsigned int j=0;j< sr->vtx.elastic.fuzzyk.nshwlid;j++){nhitall+=sr->vtx.elastic.fuzzyk.png[j].shwlid.nhit;}if(nhitall/sr->slc.nhit<=0.7) return false;return true;})
const ana::Cut kMuonIDProd4Cut
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
const ana::Cut kNuebarCCIncFiducialLoose([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;if(sr->vtx.elastic.vtx.X()< -165.0) return false;if(sr->vtx.elastic.vtx.X() > 165.0) return false;if(sr->vtx.elastic.vtx.Y()< -165.0) return false;if(sr->vtx.elastic.vtx.Y() > 165.0) return false;if(sr->vtx.elastic.vtx.Z()< 100.0) return false;if(sr->vtx.elastic.vtx.Z() > 1000.0) return false;return true;})
Cut CutFromNuTruthCut(const NuTruthCut &stc)