2 #include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"
18 double count = 6e20/3.08823e19;
26 if( muIdx < 0 )
return -5.;
28 return (
double)slc->reco.trk[muIdx].costh;
35 if( muIdx < 0 )
return -5.;
37 return (
double)slc->reco.trk[muIdx].crthit.distance;
45 std::string suffix =
"";
46 std::string label =
"";
73 std::string suffix =
"";
74 std::string label =
"";
82 return (slc->truth.index >= 0 );
86 return (
kIsNuSlice(slc) && slc->truth.iscc && ( slc->truth.pdg == 14 || slc->truth.pdg == -14 ) );
const Cut kIsNuMuCC([](const caf::SRSliceProxy *slc){return(kIsNuSlice(slc)&&slc->truth.iscc &&(slc->truth.pdg==14||slc->truth.pdg==-14));})
const Var kCounting_scale([](const caf::SRSliceProxy *slc){double count=6e20/3.08823e19;return count;})
const Cut kNoCut([](const caf::SRSliceProxy *){return true;})
The simplest possible cut: pass everything, used as a default.
const Cut kSlcFlashMatchTimeCut([](const caf::SRSliceProxy *slc){if(std::isnan(slc->fmatch.time)) return false;bool InBeam=(slc->fmatch.time > 0.&&slc->fmatch.time< 1.800);return(InBeam);})
Represent the binning of a Spectrum's x-axis.
const Cut kMuonTrk_cosmic
const Cut kFlashMatching_numucc
const Cut kMuonTrk_othernu
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;})
const Cut kHasPrimaryMuonTrk([](const caf::SRSliceProxy *slc){int ptrkid=kPrimaryMuonTrkIdx(slc);double ptrkrecop=kPrimaryMuonTrkP(slc);return(ptrkid!=-1 &&!isnan(ptrkrecop)&&ptrkrecop > 0.&&ptrkrecop< 7.5);})
const Cut kALLCuts_cosmic
const Var kCRTTrkAngle([](const caf::SRSliceProxy *slc) -> double{float crttrkangle(-5.f);if(kPrimaryMuonTrkIdx(slc) >=0){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];crttrkangle=ptrk.crttrack.angle;}return crttrkangle;})
const Cut kNuScore([](const caf::SRSliceProxy *slc){return(!isnan(slc->nu_score)&&slc->nu_score > 0.4);})
const Cut kPreSelection_othernu
process_name opflashCryoW ana
const Cut kMuonTrk_numucc
caf::Proxy< caf::SRSlice > SRSliceProxy
const Var kCRTTrkTime([](const caf::SRSliceProxy *slc) -> double{float crttrktime(-5.f);if(kPrimaryMuonTrkIdx(slc) >=0){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];crttrktime=ptrk.crthit.hit.time;}return crttrktime;})
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 Cut kFlashMatching_othernu
const Var kPrimTrkCRTdist([](const caf::SRSliceProxy *slc){int muIdx=kPrimMuonIdx(slc);if(muIdx< 0) return-5.;return(double) slc->reco.trk[muIdx].crthit.distance;})
const Cut kCRTTrackAngleCut([](const caf::SRSliceProxy *slc){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];return(isnan(ptrk.crttrack.angle)||ptrk.crttrack.angle > 0.05);})
const Var kPrimaryMuonTrkLen([](const caf::SRSliceProxy *slc) -> double{float ptrklen(-5.f);if(kPrimaryMuonTrkIdx(slc) >=0){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];ptrklen=ptrk.len;}return ptrklen;})
const Var kSlcVtxZ([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.z;})
std::vector< PlotDef > plots
const Cut kSlcNuScoreCut([](const caf::SRSliceProxy *slc){return(kSlcIsRecoNu(slc)&&slc->nu_score >0.4);})
const Var kPrimTrkCosth([](const caf::SRSliceProxy *slc) -> double{int muIdx=kPrimMuonIdx(slc);if(muIdx< 0) return-5.;return(double) slc->reco.trk[muIdx].costh;})
const Cut kALLCuts_othernu
const Cut kPreSelection_cosmic
const Var kPrimaryMuonTrkP([](const caf::SRSliceProxy *slc){float recop(-5.f);bool contained(false);if(kPrimaryMuonTrkIdx(slc) >=0){auto const &ptrk=slc->reco.trk.at(kPrimaryMuonTrkIdx(slc));contained=((-199.15+10)< ptrk.end.x &&ptrk.end.x< (199.15-10)&&(-200.+10)< ptrk.end.y &&ptrk.end.y< (200.-10)&&(0.0+10)< ptrk.end.z &&ptrk.end.z< (500.-50));if(contained) recop=ptrk.rangeP.p_muon;else recop=ptrk.mcsP.fwdP_muon;}return recop;})
std::vector< SelDef > sels
const Cut kPreSelection_numucc
const Cut kCRTHitDistanceCut([](const caf::SRSliceProxy *slc){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRCRTHitMatchProxy &crthit=slc->reco.trk[ptrkid].crthit;if(std::isnan(crthit.hit.time)||std::isnan(crthit.distance)) return true;return crthit.distance > 5||(crthit.hit.time > 0.&&crthit.hit.time< 1.800);})
const Var kPrimTrkLen([](const caf::SRSliceProxy *slc) -> double{double len=-5.0;if(slc->reco.ntrk > 0){int muIdx=(int) kPrimMuonIdx(slc);if(muIdx >=0){len=slc->reco.trk[muIdx].len;}}return len;})
const Cut kALLCuts_numucc
const Cut kSlcFlashMatchScoreCut([](const caf::SRSliceProxy *slc){return(slc->fmatch.score< 7);})
const Var kCRTHitDist([](const caf::SRSliceProxy *slc) -> double{float crttrkdist(-5.f);if(kPrimaryMuonTrkIdx(slc) >=0){int ptrkid=kPrimaryMuonTrkIdx(slc);const caf::SRTrackProxy &ptrk=slc->reco.trk[ptrkid];crttrkdist=ptrk.crthit.distance;}return crttrkdist;})
std::size_t count(Cont const &cont)
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
const Cut kFlashMatching_cosmic
const Cut kInFV([](const caf::SRSliceProxy *slc){return(slc->vertex.x >(-199.15+10)&&slc->vertex.x< (199.15-10)&&slc->vertex.y >(-200.+10)&&slc->vertex.y< (200.-10)&&slc->vertex.z >(0.0+10)&&slc->vertex.z< (500.-50));})