3 #include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"
12 if( (
int)slc->reco.ntrk == 0 )
return -5.0;
16 double best_len = -5.0;
17 for(
unsigned int trkIdx = 0; trkIdx < slc->
reco.ntrk; trkIdx++ ){
18 auto &trk = slc->reco.trk[trkIdx];
19 if(trk.chi2pid[2].pid_ndof < 0 )
return -5.0;
22 bool isMuonLike = trk.chi2pid[2].chi2_pion > trk.chi2pid[2].chi2_muon;
23 if( isMuonLike && trk.len > best_len ){
38 if ( slc->reco.ntrk > 0 ){
41 len = slc->reco.trk[muIdx].len;
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
_Var< caf::SRSliceProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
process_name standard_reco_uboone reco
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;})