4 #include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"
15 if ( largestShwIdx==-1 )
18 return ( slc->reco.shw[largestShwIdx].bestplane_energy > 0.f &&
19 slc->reco.shw[largestShwIdx].bestplane_dEdx > 0.f &&
20 slc->reco.shw[largestShwIdx].conversion_gap > 0.f );
29 if ( largestShwIdx==-1 )
32 return (slc->reco.shw[largestShwIdx].bestplane_energy > 0.2f &&
33 slc->reco.shw[largestShwIdx].bestplane_dEdx < 3 &&
34 slc->reco.shw[largestShwIdx].conversion_gap < 3 );
42 if ( largestShwIdx==-1 )
45 return (slc->reco.shw[largestShwIdx].bestplane_energy > 0.2f );
53 if ( largestShwIdx==-1 )
56 return (slc->reco.shw[largestShwIdx].bestplane_dEdx < 3.625f);
64 if ( largestShwIdx==-1 )
67 return (slc->reco.shw[largestShwIdx].conversion_gap < 3.25f);
82 return slc->reco.ntrk > 0;
90 if (longestTrackIdx == -1)
114 if ( largestShwIdx==-1 )
117 return (slc->reco.shw[largestShwIdx].density > 4.5);
137 for (
auto const& trk : slc->reco.trk)
139 if (trk.dazzle.pdg==13)
149 for (
auto const& trk : slc->reco.trk)
151 if (trk.dazzle.muonScore > 0.8)
182 if ( largestShwIdx==-1 )
185 double this_endx = slc->reco.shw[largestShwIdx].start.x + (slc->reco.shw[largestShwIdx].dir.x * slc->reco.shw[largestShwIdx].len);
186 double this_endy = slc->reco.shw[largestShwIdx].start.y + (slc->reco.shw[largestShwIdx].dir.y * slc->reco.shw[largestShwIdx].len);
187 double this_endz = slc->reco.shw[largestShwIdx].start.z + (slc->reco.shw[largestShwIdx].dir.z * slc->reco.shw[largestShwIdx].len);
192 bool starty = (
fvndAbs.
ymin < slc->reco.shw[largestShwIdx].start.y) && (slc->reco.shw[largestShwIdx].start.y <
fvndAbs.
ymax);
195 bool startz = (
fvndAbs.
zmin < slc->reco.shw[largestShwIdx].start.z) && (slc->reco.shw[largestShwIdx].start.z <
fvndAbs.
zmax);
198 return (startx && endx && starty && endy && startz && endz);
206 if ( largestShwIdx==-1 )
209 double this_endx = slc->reco.shw[largestShwIdx].start.x + (slc->reco.shw[largestShwIdx].dir.x * slc->reco.shw[largestShwIdx].len);
210 double this_endy = slc->reco.shw[largestShwIdx].start.y + (slc->reco.shw[largestShwIdx].dir.y * slc->reco.shw[largestShwIdx].len);
211 double this_endz = slc->reco.shw[largestShwIdx].start.z + (slc->reco.shw[largestShwIdx].dir.z * slc->reco.shw[largestShwIdx].len);
223 return (startx && endx && starty && endy && startz && endz);
const Cut kShowerConvGapCut([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].conversion_gap< 3.25f);})
const Var kRecoShower_OpenAngle([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?180.*shw->open_angle/M_PI:-5.;})
then if[["$THISISATEST"==1]]
const Cut kShowerDensityCut([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].density > 4.5);})
const Cut kNueContainedFD([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;double this_endx=slc->reco.shw[largestShwIdx].start.x+(slc->reco.shw[largestShwIdx].dir.x *slc->reco.shw[largestShwIdx].len);double this_endy=slc->reco.shw[largestShwIdx].start.y+(slc->reco.shw[largestShwIdx].dir.y *slc->reco.shw[largestShwIdx].len);double this_endz=slc->reco.shw[largestShwIdx].start.z+(slc->reco.shw[largestShwIdx].dir.z *slc->reco.shw[largestShwIdx].len);bool startx=(fvfd_cryo1.xmin< slc->reco.shw[largestShwIdx].start.x)&&(slc->reco.shw[largestShwIdx].start.x< fvfd_cryo1.xmax);bool endx=(fvfd_cryo1.xmin< this_endx)&&(this_endx< fvfd_cryo1.xmax);bool starty=(fvfd_cryo1.ymin< slc->reco.shw[largestShwIdx].start.y)&&(slc->reco.shw[largestShwIdx].start.y< fvfd_cryo1.ymax);bool endy=(fvfd_cryo1.ymin< this_endy)&&(this_endy< fvfd_cryo1.ymax);bool startz=(fvfd_cryo1.zmin< slc->reco.shw[largestShwIdx].start.z)&&(slc->reco.shw[largestShwIdx].start.z< fvfd_cryo1.zmax);bool endz=(fvfd_cryo1.zmin< this_endz)&&(this_endz< fvfd_cryo1.zmax);return(startx &&endx &&starty &&endy &&startz &&endz);})
const Var kLongestTrackChi2Proton([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrkChi2PIDProxy *chi2=LongestTrackBestPlaneChi2PID(slc);return chi2?double(chi2->chi2_proton):-5.;})
process_name opflashCryoW ana
const Cut kShowerEnergyCut([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_energy > 0.2f);})
const Var kRecoShowers_EnergyCut([](const caf::SRSliceProxy *slc) -> unsigned{unsigned int counter(0);for(auto const &shw:slc->reco.shw){++counter;}return counter;})
const Var kLongestTrackDazzleMuonScore([](const caf::SRSliceProxy *slc) -> float{const caf::SRTrackProxy *trk=LongestRecoTrack(slc);return trk?(float) trk->dazzle.muonScore:-5.f;})
caf::Proxy< caf::SRSlice > SRSliceProxy
const Cut kShowerRazzleElectronScoreCut
const Cut kNueAllTrackDazzleMuonCut([](const caf::SRSliceProxy *slc){for(auto const &trk:slc->reco.trk){return false;}return true;})
_Cut< caf::SRSliceProxy > Cut
const Cut kNueContainedND([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;double this_endx=slc->reco.shw[largestShwIdx].start.x+(slc->reco.shw[largestShwIdx].dir.x *slc->reco.shw[largestShwIdx].len);double this_endy=slc->reco.shw[largestShwIdx].start.y+(slc->reco.shw[largestShwIdx].dir.y *slc->reco.shw[largestShwIdx].len);double this_endz=slc->reco.shw[largestShwIdx].start.z+(slc->reco.shw[largestShwIdx].dir.z *slc->reco.shw[largestShwIdx].len);bool startx=(fvndAbs.xmin< std::abs(slc->reco.shw[largestShwIdx].start.x))&&(std::abs(slc->reco.shw[largestShwIdx].start.x)< fvndAbs.xmax);bool endx=(fvndAbs.xmin< std::abs(this_endx))&&(std::abs(this_endx)< fvndAbs.xmax);bool starty=(fvndAbs.ymin< slc->reco.shw[largestShwIdx].start.y)&&(slc->reco.shw[largestShwIdx].start.y< fvndAbs.ymax);bool endy=(fvndAbs.ymin< this_endy)&&(this_endy< fvndAbs.ymax);bool startz=(fvndAbs.zmin< slc->reco.shw[largestShwIdx].start.z)&&(slc->reco.shw[largestShwIdx].start.z< fvndAbs.zmax);bool endz=(fvndAbs.zmin< this_endz)&&(this_endz< fvndAbs.zmax);return(startx &&endx &&starty &&endy &&startz &&endz);})
const Cut kNueMuonCut([](const caf::SRSliceProxy *slc){return(kLongestTrackLength(slc)< 80.f||kLongestTrackChi2Muon(slc) > 30.f||kLongestTrackChi2Proton(slc)< 60.f);})
const Cut kNueHasTrackCut([](const caf::SRSliceProxy *slc){return slc->reco.ntrk > 0;})
const Var kLargestRecoShowerIdx([](const caf::SRSliceProxy *slc) -> int{int bestIdx(-1);double maxEnergy(-1);for(unsigned int i=0;i< slc->reco.nshw;i++){auto const &shw=slc->reco.shw[i];continue;if(shw.bestplane_energy > maxEnergy){bestIdx=i;maxEnergy=shw.bestplane_energy;}}return bestIdx;})
const Cut kNueTrackLenCut([](const caf::SRSliceProxy *slc){return kLongestTrackLength(slc)< 110.f;})
const Var kRecoShowerRazzlePID([](const caf::SRSliceProxy *slc) -> int{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?(int) shw->razzle.pdg:-5;})
const Cut kNueBasicCut([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_energy > 0.2f &&slc->reco.shw[largestShwIdx].bestplane_dEdx< 3 &&slc->reco.shw[largestShwIdx].conversion_gap< 3);})
const Var kLongestTrackChi2Muon([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrkChi2PIDProxy *chi2=LongestTrackBestPlaneChi2PID(slc);return chi2?double(chi2->chi2_muon):-5.;})
const Cut kShowerdEdxCut([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_dEdx< 3.625f);})
const Cut kNueLongestTrackDazzleMuonScoreCut
const Var kLongestTrackIdx([](const caf::SRSliceProxy *slc) -> int{int bestIdx(-1);double maxLength(-1);for(unsigned int i=0;i< slc->reco.ntrk;i++){auto const &trk=slc->reco.trk[i];continue;if(trk.len > maxLength){bestIdx=i;maxLength=trk.len;}}return bestIdx;})
const Cut kRecoShower([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_energy > 0.f &&slc->reco.shw[largestShwIdx].bestplane_dEdx > 0.f &&slc->reco.shw[largestShwIdx].conversion_gap > 0.f);})
const Cut kShowerOpenAngleCut([](const caf::SRSliceProxy *slc){return kRecoShower_OpenAngle(slc)< 12.f;})
const Cut kShowerRazzleElectronCut
Template for Cut and SpillCut.
const Var kRecoShowerRazzleElectronScore([](const caf::SRSliceProxy *slc) -> float{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?(float) shw->razzle.electronScore:-5.f;})
const Cut kNueAllTrackDazzleMuonScoreCut([](const caf::SRSliceProxy *slc){for(auto const &trk:slc->reco.trk){return false;}return true;})
const Var kLongestTrackDazzlePID([](const caf::SRSliceProxy *slc) -> int{const caf::SRTrackProxy *trk=LongestRecoTrack(slc);return trk?(int) trk->dazzle.pdg:-5;})
bool PtInVol(const caf::SRVector3DProxy &pt, const FidVol &vol)
const Cut kNueTrackContainmentCut([](const caf::SRSliceProxy *slc){const int longestTrackIdx(kLongestTrackIdx(slc));return true;return PtInVol(slc->reco.trk[longestTrackIdx].end, fvndExit);})
const Cut kNueNumShowersCut([](const caf::SRSliceProxy *slc){return((unsigned int) kRecoShowers_EnergyCut(slc)==1);})
const Var kLongestTrackLength([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrackProxy *trk=LongestRecoTrack(slc);return trk?double(trk->len):-5.;})
const Cut kNueLongestTrackDazzleMuonCut