All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NumuVarsSBND202106.h
Go to the documentation of this file.
1 #pragma once
2 // Specific variables for the Numu event selection.
3 
5 
6 namespace ana
7 {
8  // Variables for Data/MC comparison
9  //extern const Var kIsTrackStSlc;
10  //extern const Var kIsTrackContained;
11  extern const Var kPrimaryMuonTrkIdx;
12  extern const Var kPrimaryMuonTrkP;
13  extern const Var kPrimaryMuonTrkLen;
14  extern const Var kCRTTrkAngle;
15  extern const Var kCRTTrkTime;
16  extern const Var kCRTHitDist;
17  extern const Var kNuScore;
18 
19 } // namespace
20 
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);})
process_name opflashCryoW ana
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 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 kPrimaryMuonTrkIdx([](const caf::SRSliceProxy *slc){double longest=-1;int best_idx=-1;double dist=-1;bool atslc, contained, maybe_muon_exiting, maybe_muon_contained;float chi2_proton, chi2_muon;for(unsigned int trkidx=0;trkidx< slc->reco.trk.size();++trkidx){const caf::SRTrackProxy &trk=slc->reco.trk[trkidx];if(trk.bestplane==-1) continue;dist=sqrt((pow(trk.start.x-slc->vertex.x, 2))+(pow(trk.start.y-slc->vertex.y, 2))+(pow(trk.start.z-slc->vertex.z, 2)));atslc=dist< 10;if(!atslc||!trk.pfp.parent_is_primary) continue;contained=((-199.15+10)< trk.end.x &&trk.end.x< (199.15-10)&&(-200.+10)< trk.end.y &&trk.end.y< (200.-10)&&(0.0+10)< trk.end.z &&trk.end.z< (500.-50));chi2_proton=trk.chi2pid[trk.bestplane].chi2_proton;chi2_muon=trk.chi2pid[trk.bestplane].chi2_muon;maybe_muon_exiting=!contained &&trk.len > 100;maybe_muon_contained=contained &&chi2_proton > 60 &&chi2_muon< 30 &&trk.len > 50;if(!maybe_muon_contained &&!maybe_muon_exiting) continue;if(trk.len > longest){longest=trk.len;best_idx=trkidx;}}return best_idx;})
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;})
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;})