All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions | Variables
XSecSelection/eventsel.h File Reference
#include "sbnana/CAFAna/Core/Binning.h"
#include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"
#include "sbnana/SBNAna/Vars/Vars.h"
#include "sbnana/SBNAna/Vars/NumuVars.h"
#include "sbnana/SBNAna/Vars/NumuVarsSBND202106.h"
#include "sbnana/SBNAna/Cuts/Cuts.h"
#include "sbnana/SBNAna/Cuts/NumuCuts.h"
#include "sbnana/SBNAna/Cuts/NumuCutsSBND202106.h"
#include "sbnana/SBNAna/Cuts/TruthCuts.h"

Go to the source code of this file.

Classes

struct  PlotDef
 
struct  SelDef
 

Functions

const Var kCounting_scale ([](const caf::SRSliceProxy *slc){double count=6e20/3.08823e19;return count;})
 
const Var kPrimTrkCosth ([](const caf::SRSliceProxy *slc){int muIdx=kPrimMuonIdx(slc);if(muIdx< 0) return-5.;return(double) slc->reco.trk[muIdx].costh;})
 
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 kIsNuSlice ([](const caf::SRSliceProxy *slc){return(slc->truth.index >=0);})
 
const Cut kIsNuMuCC ([](const caf::SRSliceProxy *slc){return(kIsNuSlice(slc)&&slc->truth.iscc &&(slc->truth.pdg==14||slc->truth.pdg==-14));})
 

Variables

std::vector< PlotDefplots
 
const Cut kIsCosmic = ( !kIsNuSlice )
 
const Cut kIsNuOther = ( kIsNuSlice && !kIsNuMuCC )
 
const Cut kNoCut_numucc = kNoCut && kIsNuMuCC
 
const Cut kNoCut_cosmic = kNoCut && kIsCosmic
 
const Cut kNoCut_othernu = kNoCut && kIsNuOther
 
const Cut kPreSelection_numucc = kSlcNuScoreCut && kInFV && kIsNuMuCC
 
const Cut kPreSelection_cosmic = kSlcNuScoreCut && kInFV && kIsCosmic
 
const Cut kPreSelection_othernu = kSlcNuScoreCut && kInFV && kIsNuOther
 
const Cut kFlashMatching_numucc = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kIsNuMuCC
 
const Cut kFlashMatching_cosmic = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kIsCosmic
 
const Cut kFlashMatching_othernu = kSlcNuScoreCut && kInFV &&kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kIsNuOther
 
const Cut kMuonTrk_numucc = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kIsNuMuCC
 
const Cut kMuonTrk_cosmic = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kIsCosmic
 
const Cut kMuonTrk_othernu = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kIsNuOther
 
const Cut kALLCuts_numucc = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kCRTTrackAngleCut && kCRTHitDistanceCut && kIsNuMuCC
 
const Cut kALLCuts_cosmic = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kCRTTrackAngleCut && kCRTHitDistanceCut && kIsCosmic
 
const Cut kALLCuts_othernu = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kCRTTrackAngleCut && kCRTHitDistanceCut && kIsNuOther
 
std::vector< SelDefsels
 

Function Documentation

const Var kCounting_scale ( [] (const caf::SRSliceProxy *slc){double count=6e20/3.08823e19;return count;}  )
const Cut kIsNuMuCC ( [] (const caf::SRSliceProxy *slc){return(kIsNuSlice(slc)&&slc->truth.iscc &&(slc->truth.pdg==14||slc->truth.pdg==-14));}  )
const Cut kIsNuSlice ( [] (const caf::SRSliceProxy *slc){return(slc->truth.index >=0);}  )
const Var kPrimTrkCosth ( [] (const caf::SRSliceProxy *slc){int muIdx=kPrimMuonIdx(slc);if(muIdx< 0) return-5.;return(double) slc->reco.trk[muIdx].costh;}  )
const Var kPrimTrkCRTdist ( [] (const caf::SRSliceProxy *slc){int muIdx=kPrimMuonIdx(slc);if(muIdx< 0) return-5.;return(double) slc->reco.trk[muIdx].crthit.distance;}  )

Variable Documentation

const Cut kALLCuts_cosmic = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kCRTTrackAngleCut && kCRTHitDistanceCut && kIsCosmic

Definition at line 103 of file XSecSelection/eventsel.h.

const Cut kALLCuts_numucc = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kCRTTrackAngleCut && kCRTHitDistanceCut && kIsNuMuCC

Definition at line 102 of file XSecSelection/eventsel.h.

const Cut kALLCuts_othernu = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kCRTTrackAngleCut && kCRTHitDistanceCut && kIsNuOther

Definition at line 104 of file XSecSelection/eventsel.h.

const Cut kFlashMatching_cosmic = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kIsCosmic

Definition at line 97 of file XSecSelection/eventsel.h.

const Cut kFlashMatching_numucc = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kIsNuMuCC

Definition at line 96 of file XSecSelection/eventsel.h.

const Cut kFlashMatching_othernu = kSlcNuScoreCut && kInFV &&kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kIsNuOther

Definition at line 98 of file XSecSelection/eventsel.h.

const Cut kIsCosmic = ( !kIsNuSlice )

Definition at line 84 of file XSecSelection/eventsel.h.

const Cut kIsNuOther = ( kIsNuSlice && !kIsNuMuCC )

Definition at line 88 of file XSecSelection/eventsel.h.

const Cut kMuonTrk_cosmic = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kIsCosmic

Definition at line 100 of file XSecSelection/eventsel.h.

const Cut kMuonTrk_numucc = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kIsNuMuCC

Definition at line 99 of file XSecSelection/eventsel.h.

const Cut kMuonTrk_othernu = kSlcNuScoreCut && kInFV && kSlcFlashMatchTimeCut && kSlcFlashMatchScoreCut && kHasPrimaryMuonTrk && kIsNuOther

Definition at line 101 of file XSecSelection/eventsel.h.

const Cut kNoCut_cosmic = kNoCut && kIsCosmic

Definition at line 91 of file XSecSelection/eventsel.h.

const Cut kNoCut_numucc = kNoCut && kIsNuMuCC

Definition at line 90 of file XSecSelection/eventsel.h.

const Cut kNoCut_othernu = kNoCut && kIsNuOther

Definition at line 92 of file XSecSelection/eventsel.h.

const Cut kPreSelection_cosmic = kSlcNuScoreCut && kInFV && kIsCosmic

Definition at line 94 of file XSecSelection/eventsel.h.

const Cut kPreSelection_numucc = kSlcNuScoreCut && kInFV && kIsNuMuCC

Definition at line 93 of file XSecSelection/eventsel.h.

const Cut kPreSelection_othernu = kSlcNuScoreCut && kInFV && kIsNuOther

Definition at line 95 of file XSecSelection/eventsel.h.

std::vector<PlotDef> plots
Initial value:
=
{{"count", "", Binning::Simple(3,0,3), kCounting},
{"count_scale", "", Binning::Simple(3,0,3), kCounting_scale},
{"mucosth", "cos#theta", Binning::Simple(50,-1,1), kPrimTrkCosth},
{"vtxx", "X (cm)", Binning::Simple(50,-200,200), kSlcVtxX},
{"vtxy", "Y (cm)", Binning::Simple(50,-200,200), kSlcVtxY},
{"vtxz", "Z (cm)", Binning::Simple(50,0,500), kSlcVtxZ},
{"mulen", "Primary Track Length", Binning::Simple(50,0,200), kPrimTrkLen},
{"mucrtdist", "Primary Track Distance to CRT hit", Binning::Simple(50,0,100), kPrimTrkCRTdist},
{"CRTangle", "CRT Track Angle", Binning::Simple(20,0,1), kCRTTrkAngle},
{"CRTHitTime", "CRT Hit Time", Binning::Simple(20,0,100), kCRTTrkTime},
{"CRTHitDist", "CRT Hit Distance", Binning::Simple(20,0,100), kCRTHitDist},
{"muonprimtrkp", "Primary Track Momentum", Binning::Simple(24,0,2), kPrimaryMuonTrkP},
{"muonprimtrklen", "Primary Track Lenght", Binning::Simple(18,40,400), kPrimaryMuonTrkLen},
{"nuscore", "Pandora Nu Score", Binning::Simple(25,0,1), kNuScore},
}
const Var kCounting_scale([](const caf::SRSliceProxy *slc){double count=6e20/3.08823e19;return count;})
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 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 kPrimTrkCRTdist([](const caf::SRSliceProxy *slc){int muIdx=kPrimMuonIdx(slc);if(muIdx< 0) return-5.;return(double) slc->reco.trk[muIdx].crthit.distance;})
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 kPrimTrkCosth([](const caf::SRSliceProxy *slc) -> double{int muIdx=kPrimMuonIdx(slc);if(muIdx< 0) return-5.;return(double) slc->reco.trk[muIdx].costh;})
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 kSlcVtxX([](const caf::SRSliceProxy *slc) -> double{return slc->slc.vertex.x;})
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;})
Definition: NumuVars.h:9
const Var kCounting
Definition: Vars.cxx:19
const Var kSlcVtxZ([](const caf::SRSliceProxy *slc) -> double{return slc->slc.vertex.z;})
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;})
const Var kSlcVtxY([](const caf::SRSliceProxy *slc) -> double{return slc->slc.vertex.y;})

Definition at line 52 of file XSecSelection/eventsel.h.

std::vector<SelDef> sels
Initial value:
=
{{"nocut_numucc", "All Slices", kNoCut_numucc, kRed},
{"nocut_cosmic", "All Slices", kNoCut_cosmic, kRed+1},
{"nocut_othernu", "All Slices", kNoCut_othernu, kRed+2},
{"PreSel_numucc", "PreSel", kPreSelection_numucc, kOrange+7},
{"PreSel_cosmic", "PreSel", kPreSelection_cosmic, kOrange+6},
{"PreSel_othernu", "PreSel", kPreSelection_othernu, kOrange+5},
{"FMatch_numucc", "PreSel+FlashM", kFlashMatching_numucc, kMagenta-4},
{"FMatch_cosmic", "PreSel+FlashM", kFlashMatching_cosmic, kMagenta-3},
{"FMatch_othernu", "PreSel+FlashM", kFlashMatching_othernu, kMagenta-2},
{"Mtrk_numucc", "PreSel+FlashM+MuonID", kMuonTrk_numucc, kCyan-7},
{"Mtrk_cosmic", "PreSel+FlashM+MuonID", kMuonTrk_cosmic, kCyan-6},
{"Mtrk_othernu", "PreSel+FlashM+MuonID", kMuonTrk_othernu, kCyan-5},
{"all_numucc", "PreSel+FlashM+MuonID+CRT", kALLCuts_numucc, kGreen+2},
{"all_cosmic", "PreSel+FlashM+MuonID+CRT", kALLCuts_cosmic, kGreen+3},
{"all_othernu", "PreSel+FlashM+MuonID+CRT", kALLCuts_othernu, kGreen+4},
}
const Cut kMuonTrk_cosmic
const Cut kNoCut_numucc
const Cut kFlashMatching_numucc
const Cut kMuonTrk_othernu
const Cut kALLCuts_cosmic
const Cut kNoCut_cosmic
const Cut kPreSelection_othernu
const Cut kMuonTrk_numucc
const Cut kFlashMatching_othernu
const Cut kNoCut_othernu
const Cut kALLCuts_othernu
const Cut kPreSelection_cosmic
const Cut kPreSelection_numucc
const Cut kALLCuts_numucc
const Cut kFlashMatching_cosmic

Definition at line 107 of file XSecSelection/eventsel.h.