4 #include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"
13 return (
kIsNuSlice(slc) && slc->truth.iscc && ( slc->truth.pdg == 14 || slc->truth.pdg == -14 ) );
19 return ( !isnan(slc->vertex.x) && slc->vertex.x < 0 );
23 return ( !isnan(slc->truth.position.x) &&
24 ( ( slc->truth.position.x < -71.1 - 25 && slc->truth.position.x > -369.33 + 25 ) ||
25 ( slc->truth.position.x > 71.1 + 25 && slc->truth.position.x < 369.33 - 25 ) ) &&
26 !isnan(slc->truth.position.y) &&
27 ( slc->truth.position.y > -181.7 + 25 && slc->truth.position.y < 134.8 - 25 ) &&
28 !isnan(slc->truth.position.z) &&
29 ( slc->truth.position.z > -895.95 + 30 && slc->truth.position.z < 895.95 - 50 ) );
33 return ( !isnan(slc->vertex.x) &&
34 ( ( slc->vertex.x < -71.1 - 25 && slc->vertex.x > -369.33 + 25 ) ||
35 ( slc->vertex.x > 71.1 + 25 && slc->vertex.x < 369.33 - 25 ) ) &&
36 !isnan(slc->vertex.y) &&
37 ( slc->vertex.y > -181.7 + 25 && slc->vertex.y < 134.8 - 25 ) &&
38 !isnan(slc->vertex.z) &&
39 ( slc->vertex.z > -895.95 + 30 && slc->vertex.z < 895.95 - 50 ) );
43 return !slc->is_clear_cosmic;
47 return ( !isnan(slc->nu_score) && slc->nu_score > 0.4 );
51 return ( !isnan(slc->fmatch.score) && slc->fmatch.score < 7.0 );
60 bool Contained(
false);
63 auto const& trk = slc->reco.trk.at(Ind);
64 Contained = ( !isnan(trk.end.x) &&
65 ( trk.end.x < -71.1 - 25 && trk.end.x > -369.33 + 25 ) &&
67 ( trk.end.y > -181.7 + 25 && trk.end.y < 134.8 - 25 ) &&
69 ( trk.end.z > -895.95 + 30 && trk.end.z < 895.95 - 50 ) );
79 auto const& trk = slc->reco.trk.at(Ind);
80 Exiting = !( !isnan(trk.end.x) &&
81 ( trk.end.x < -71.1 - 25 && trk.end.x > -369.33 + 25 ) &&
83 ( trk.end.y > -181.7 + 25 && trk.end.y < 134.8 - 25 ) &&
85 ( trk.end.z > -895.95 + 30 && trk.end.z < 895.95 - 50 ) );
138 bool ProgCut =
false;
139 bool NuIsNuMuCC, IsMuon, Contained;
140 for (
auto const&
nu: sr->mc.nu)
142 NuIsNuMuCC =
nu.iscc && (
nu.pdg == 14 ||
nu.pdg == -14 );
143 for (
auto const& prim:
nu.prim)
145 IsMuon = ( prim.pdg == 13 || prim.pdg == -13 );
146 Contained = ( prim.contained == 1 );
147 ProgCut = ProgCut || ( NuIsNuMuCC && IsMuon && ( (Contained && prim.length > 50.0) || (!Contained && prim.length > 100.0) ) );
const Cut kFMScore([](const caf::SRSliceProxy *slc){return(!isnan(slc->fmatch.score)&&slc->fmatch.score< 7.0);})
const Cut kIsNuMuCC([](const caf::SRSliceProxy *slc){return(kIsNuSlice(slc)&&slc->truth.iscc &&(slc->truth.pdg==14||slc->truth.pdg==-14));})
const Cut kNuOther_RFiducial
const Cut kNuMuCC_FMScore
const Cut kPTrackContained([](const caf::SRSliceProxy *slc){int Ind=kPTrackInd(slc);bool Contained(false);if(Ind >=0){auto const &trk=slc->reco.trk.at(Ind);Contained=(!isnan(trk.end.x)&&(trk.end.x< -71.1-25 &&trk.end.x >-369.33+25)&&!isnan(trk.end.y)&&(trk.end.y >-181.7+25 &&trk.end.y< 134.8-25)&&!isnan(trk.end.z)&&(trk.end.z >-895.95+30 &&trk.end.z< 895.95-50));}return Contained;})
const Cut kNuOther_ClearCos
const Cut kNuMuCC_FullSelection
const Cut kNuScore([](const caf::SRSliceProxy *slc){return(!isnan(slc->nu_score)&&slc->nu_score > 0.4);})
process_name opflashCryoW ana
const Cut kCosmic_FMScore
const Cut kTFiducial([](const caf::SRSliceProxy *slc){return(!isnan(slc->truth.position.x)&&((slc->truth.position.x< -71.1-25 &&slc->truth.position.x >-369.33+25)||(slc->truth.position.x > 71.1+25 &&slc->truth.position.x< 369.33-25))&&!isnan(slc->truth.position.y)&&(slc->truth.position.y >-181.7+25 &&slc->truth.position.y< 134.8-25)&&!isnan(slc->truth.position.z)&&(slc->truth.position.z >-895.95+30 &&slc->truth.position.z< 895.95-50));})
const Cut kCosmic_RFiducial
caf::Proxy< caf::SRSlice > SRSliceProxy
const SpillCut kLongTrack([](const caf::SRSpillProxy *sr){bool ProgCut=false;bool NuIsNuMuCC, IsMuon, Contained;for(auto const &nu:sr->mc.nu){NuIsNuMuCC=nu.iscc &&(nu.pdg==14||nu.pdg==-14);for(auto const &prim:nu.prim){IsMuon=(prim.pdg==13||prim.pdg==-13);Contained=(prim.contained==1);ProgCut=ProgCut||(NuIsNuMuCC &&IsMuon &&((Contained &&prim.length > 50.0)||(!Contained &&prim.length > 100.0)));}}return ProgCut;})
_Cut< caf::SRSliceProxy > Cut
const Cut kNuOther_PTrack
for($it=0;$it< $RaceTrack_number;$it++)
caf::Proxy< caf::StandardRecord > SRSpillProxy
const Cut kNuOther_NuScore
const Cut kCosmic_NuScore
const Cut kNuOther_TFiducial
const Cut kCosmic_TFiducial
const Cut kCryo0([](const caf::SRSliceProxy *slc){return(!isnan(slc->vertex.x)&&slc->vertex.x< 0);})
const Cut kNotClearCosmic([](const caf::SRSliceProxy *slc){return!slc->is_clear_cosmic;})
const Cut kNuMuCC_RFiducial
const Cut kNuMuCC_ClearCos
const Cut kRFiducial([](const caf::SRSliceProxy *slc){return(!isnan(slc->vertex.x)&&((slc->vertex.x< -71.1-25 &&slc->vertex.x >-369.33+25)||(slc->vertex.x > 71.1+25 &&slc->vertex.x< 369.33-25))&&!isnan(slc->vertex.y)&&(slc->vertex.y >-181.7+25 &&slc->vertex.y< 134.8-25)&&!isnan(slc->vertex.z)&&(slc->vertex.z >-895.95+30 &&slc->vertex.z< 895.95-50));})
Template for Cut and SpillCut.
const Cut kPTrack([](const caf::SRSliceProxy *slc){return(kPTrackInd(slc) >=0);})
const Cut kPTrackExiting([](const caf::SRSliceProxy *slc){int Ind=kPTrackInd(slc);bool Exiting(false);if(Ind >=0){auto const &trk=slc->reco.trk.at(Ind);Exiting=!(!isnan(trk.end.x)&&(trk.end.x< -71.1-25 &&trk.end.x >-369.33+25)&&!isnan(trk.end.y)&&(trk.end.y >-181.7+25 &&trk.end.y< 134.8-25)&&!isnan(trk.end.z)&&(trk.end.z >-895.95+30 &&trk.end.z< 895.95-50));}return Exiting;})
const Cut kCosmic_ClearCos
const Cut kNuMuCC_NuScore
const Cut kNuOther_FMScore
const Cut kNuMuCC_TFiducial
const Var kPTrackInd([](const caf::SRSliceProxy *slc) -> int{float Longest(0);int PTrackInd(-1);for(std::size_t i(0);i< slc->reco.trk.size();++i){auto const &trk=slc->reco.trk.at(i);if(trk.bestplane==-1) continue;const float Atslc=std::hypot(slc->vertex.x-trk.start.x, slc->vertex.y-trk.start.y, slc->vertex.z-trk.start.z);const bool AtSlice=(Atslc< 10.0 &&trk.pfp.parent_is_primary);const float Chi2Proton=trk.chi2pid[trk.bestplane].chi2_proton;const float Chi2Muon=trk.chi2pid[trk.bestplane].chi2_muon;const bool Contained=(!isnan(trk.end.x)&&(trk.end.x< -71.1-25 &&trk.end.x >-369.33+25)&&!isnan(trk.end.y)&&(trk.end.y >-181.7+25 &&trk.end.y< 134.8-25)&&!isnan(trk.end.z)&&(trk.end.z >-895.95+30 &&trk.end.z< 895.95-50));const bool MaybeMuonExiting=(!Contained &&trk.len > 100);const bool MaybeMuonContained=(Contained &&Chi2Proton > 60 &&Chi2Muon< 30 &&trk.len > 50);{Longest=trk.len;PTrackInd=i;}}return PTrackInd;})