All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SBNAna/Cuts/TruthCuts.cxx
Go to the documentation of this file.
4 
5 #include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"
6 
7 namespace ana{
8 
9  //---------------------------------------------------------------
10  // Slice cuts
12  [](const caf::SRSliceProxy* slc){
13  return kHasNu(slc) && PtInVolAbsX(slc->truth.position, avnd);
14  }
15  );
16 
18  [](const caf::SRSliceProxy* slc){
19  return kHasNu(slc) && PtInVolAbsX(slc->truth.position, fvndAbs);
20  }
21  );
22 
24  [](const caf::SRSliceProxy* slc){
25  return kHasNu(slc) && PtInVol(slc->truth.position, avfd_cryo1);
26  }
27  );
28 
30  [](const caf::SRSliceProxy* slc){
31  return kHasNu(slc) && PtInVol(slc->truth.position, avfd_cryo2);
32  }
33  );
34 
36  [](const caf::SRSliceProxy* slc){
37  return kHasNu(slc) && PtInVol(slc->truth.position, fvfd_cryo1);
38  }
39  );
40 
42  [](const caf::SRSliceProxy* slc){
43  return kHasNu(slc) && PtInVol(slc->truth.position, fvfd_cryo2);
44  }
45  );
46 
47  const Cut kIsAntiNu([](const caf::SRSliceProxy* slc){
48  if(slc->truth.index < 0) return false;
49  return slc->truth.pdg < 0;
50  });
51 
52  const Cut kIsNu([](const caf::SRSliceProxy* slc){
53  if(slc->truth.index < 0) return false;
54  return slc->truth.pdg > 0;
55  });
56 
57  const Cut kHasNu([](const caf::SRSliceProxy* slc){
58  return slc->truth.index >= 0;
59  });
60 
61  const Cut kIsNue([](const caf::SRSliceProxy* slc){
62  return slc->truth.index >= 0 && abs(slc->truth.pdg) == 12;
63  });
64 
65  const Cut kIsNumu([](const caf::SRSliceProxy* slc){
66  return slc->truth.index >= 0 && abs(slc->truth.pdg) == 14;
67  });
68 
69  const Cut kIsNutau([](const caf::SRSliceProxy* slc){
70  return slc->truth.index >= 0 && abs(slc->truth.pdg) == 16;
71  });
72 
73  const Cut kIsCC([](const caf::SRSliceProxy* slc){
74  if(slc->truth.index < 0) return false;
75  return (slc->truth.iscc==1);
76  });
77 
78  const Cut kIsNC([](const caf::SRSliceProxy* slc){
79  if(slc->truth.index < 0) return false;
80  return (slc->truth.isnc==1);
81  });
82 
83  const Cut kVtxDistMagCut([](const caf::SRSliceProxy* slc){
84  if(slc->truth.index < 0) return true;
85  return (kTruthVtxDistMag(slc) < 1);
86  });
87 
88  const Cut kSlcCompletenessCut([](const caf::SRSliceProxy* slc){
89  if(slc->truth.index < 0) return false;
90  return (kCompletness(slc) > 0.5);
91  });
92 
93  //---------------------------------------------------------------
94  // Spill cuts
95 
96  const SpillCut kIsCosmicSpill([](const caf::SRSpillProxy* sr) {
97  return (sr->mc.nnu == 0);
98  });
99 
100  const SpillCut kIsSingleNuSpill([](const caf::SRSpillProxy* sr) {
101  return (sr->mc.nnu < 2);
102  });
103 
104  const SpillCut kIsNueSpill([](const caf::SRSpillProxy* sr){
105  if (kIsCosmicSpill(sr) || !kIsSingleNuSpill(sr)) return false;
106  return (std::abs(sr->mc.nu[0].pdg) == 12);
107  });
108 
109  const SpillCut kIsNumuSpill([](const caf::SRSpillProxy* sr){
110  if (kIsCosmicSpill(sr) || !kIsSingleNuSpill(sr)) return false;
111  return (std::abs(sr->mc.nu[0].pdg) == 14);
112  });
113 
114  const SpillCut kIsNutauSpill([](const caf::SRSpillProxy* sr){
115  if (kIsCosmicSpill(sr) || !kIsSingleNuSpill(sr)) return false;
116  return (std::abs(sr->mc.nu[0].pdg) == 16);
117  });
118 
119  const SpillCut kIsCCSpill([](const caf::SRSpillProxy* sr) {
120  if (kIsCosmicSpill(sr) || !kIsSingleNuSpill(sr)) return false;
121  return ((bool)sr->mc.nu[0].iscc);
122  });
123 
124  const SpillCut kIsNCSpill([](const caf::SRSpillProxy* sr) {
125  if (kIsCosmicSpill(sr) || !kIsSingleNuSpill(sr)) return false;
126  return ((bool)sr->mc.nu[0].isnc);
127  });
128 
129 
130 
131 }
const SpillCut kIsCosmicSpill([](const caf::SRSpillProxy *sr){return(sr->mc.nnu==0);})
const Cut kSlcCompletenessCut([](const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return(kCompletness(slc) > 0.5);})
const FidVol avfd_cryo1
const Cut kIsNC([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.isnc;})
Is this a Neutral Current event?
const Cut kTrueFiducialVolumeFDCryo1([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVol(slc->truth.position, fvfd_cryo1);})
const Cut kTrueFiducialVolumeND([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVolAbsX(slc->truth.position, fvndAbs);})
const Var kCompletness([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) slc->tmatch.eff:-5.f);})
Definition: TruthVars.h:8
bool PtInVolAbsX(const caf::SRVector3DProxy &pt, const FidVol &vol)
const Cut kIsCC([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.iscc;})
const Cut kTrueActiveVolumeFDCryo1([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVol(slc->truth.position, avfd_cryo1);})
const Var kTruthVtxDistMag([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) std::hypot(kTruthVtxDistX(slc), kTruthVtxDistY(slc), kTruthVtxDistZ(slc)):-5.f);})
Definition: TruthVars.h:20
const Cut kIsNu([](const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return false;return slc->truth.pdg > 0;})
process_name opflashCryoW ana
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
const Cut kIsNue([](const caf::SRSliceProxy *slc){return slc->truth.index >=0 &&abs(slc->truth.pdg)==12;})
const Cut kIsNutau([](const caf::SRSliceProxy *slc){return slc->truth.index >=0 &&abs(slc->truth.pdg)==16;})
const FidVol fvfd_cryo1
T abs(T value)
const Cut kHasNu([](const caf::SRSliceProxy *slc){return slc->truth.index >=0;})
const SpillCut kIsNueSpill([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return(std::abs(sr->mc.nu[0].pdg)==12);})
const FidVol avnd
const FidVol fvfd_cryo2
_Cut< caf::SRSliceProxy > Cut
Definition: Cut.h:95
const Cut kIsNumu([](const caf::SRSliceProxy *slc){return slc->truth.index >=0 &&abs(slc->truth.pdg)==14;})
caf::Proxy< caf::StandardRecord > SRSpillProxy
Definition: EpilogFwd.h:3
const SpillCut kIsSingleNuSpill([](const caf::SRSpillProxy *sr){return(sr->mc.nnu< 2);})
_Cut< caf::SRSpillProxy > SpillCut
Equivalent of Cut acting on caf::SRSpill. For use in spill-by-spill data quality cuts.
Definition: Cut.h:99
const SpillCut kIsNCSpill([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return((bool) sr->mc.nu[0].isnc);})
const Cut kTrueActiveVolumeND([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVolAbsX(slc->truth.position, avnd);})
const SpillCut kIsCCSpill([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return((bool) sr->mc.nu[0].iscc);})
const SpillCut kIsNumuSpill([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return(std::abs(sr->mc.nu[0].pdg)==14);})
const FidVol avfd_cryo2
const Cut kTrueActiveVolumeFDCryo2([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVol(slc->truth.position, avfd_cryo2);})
const Cut kIsAntiNu([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.pdg< 0;})
Is this truly an antineutrino?
const FidVol fvndAbs
const Cut kVtxDistMagCut([](const caf::SRSliceProxy *slc){if(slc->truth.index< 0) return true;return(kTruthVtxDistMag(slc)< 1);})
const SpillCut kIsNutauSpill([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return(std::abs(sr->mc.nu[0].pdg)==16);})
bool PtInVol(const caf::SRVector3DProxy &pt, const FidVol &vol)
const Cut kTrueFiducialVolumeFDCryo2([](const caf::SRSliceProxy *slc){return kHasNu(slc)&&PtInVol(slc->truth.position, fvfd_cryo2);})