2 #include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"
22 if( muIdx < 0 )
return -5.;
24 return (
double)slc->reco.trk[muIdx].costh;
30 return slc->slc.vertex.x;
35 return slc->slc.vertex.y;
40 return slc->slc.vertex.z;
47 std::string suffix =
"";
48 std::string label =
"";
65 std::string suffix =
"";
66 std::string label =
"";
78 {{
"nocut",
"All Slices",
kNoCut, kBlack},
79 {
"sig",
"True NumuCC",
kSig, kRed+1},
80 {
"bkg",
"Not NumuCC", !
kSig, kAzure+2},
const Cut kNoCut([](const caf::SRSliceProxy *){return true;})
The simplest possible cut: pass everything, used as a default.
const Cut kIsNC([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.isnc;})
Is this a Neutral Current event?
Represent the binning of a Spectrum's x-axis.
const Var kPrimMuonIdx([](const caf::SRSliceProxy *slc) -> double{if((int) slc->reco.ntrk==0) return-5.0;double best_idx=0;double best_len=-5.0;for(unsigned int trkIdx=0;trkIdx< slc->reco.ntrk;trkIdx++){auto &trk=slc->reco.trk[trkIdx];if(trk.chi2pid[2].pid_ndof< 0) return-5.0;bool isMuonLike=trk.chi2pid[2].chi2_pion > trk.chi2pid[2].chi2_muon;if(isMuonLike &&trk.len > best_len){best_len=trk.len;best_idx=trkIdx;}}return best_idx;})
process_name opflashCryoW ana
caf::Proxy< caf::SRSlice > SRSliceProxy
const Var kSlcVtxX([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.x;})
const Var kSlcVtxY([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.y;})
const Var kSlcVtxZ([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.z;})
const Cut kIsNumu([](const caf::SRSliceProxy *slc){return slc->truth.index >=0 &&abs(slc->truth.pdg)==14;})
std::vector< PlotDef > plots
const Var kPrimTrkCosth([](const caf::SRSliceProxy *slc) -> double{int muIdx=kPrimMuonIdx(slc);if(muIdx< 0) return-5.;return(double) slc->reco.trk[muIdx].costh;})
std::vector< SelDef > sels
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})