NumubarCCIncCuts.cxx
Go to the documentation of this file.
3 
6 
7 #include "TVector3.h"
8 
9 namespace ana { namespace xsec { namespace numubarcc
10 {
11 
12  const bool testo = true;
13 
14  ////////////////////////////////////
15  /// Main analysis truth cuts
16  ////////////////////////////////////
17 
18  bool VtxInBounds(const caf::SRVector3DProxy * vec, const TVector3 * vmin, const TVector3 * vmax){
19  return (vec->X() >= vmin->X() && vec->Y() >= vmin->Y() && vec->Z() >= vmin->Z() &&
20  vec->X() <= vmax->X() && vec->Y() <= vmax->Y() && vec->Z() <= vmax->Z());
21  }
22 
24  return (nu->iscc && nu->pdg == -14);
25  });
27 
28  const NuTruthCut kIsNumuCC_NT([](const caf::SRNeutrinoProxy* nu)
29  {
30  return (nu->iscc && nu->pdg == +14);
31  });
33 
35  const Cut kIsNumuNumubar_NT = CutFromNuTruthCut(kIsNumuNumubarCC_NT);
36 
37  ////////////////////////////////////
38  /// Signal cuts
39  ////////////////////////////////////
40  const NuTruthCut kIsNueCC_NT([](const caf::SRNeutrinoProxy* nu){
41  return (nu->iscc && (nu->pdg == 12));
42  });
44  return (nu->iscc && (nu->pdg == -12));
45  });
47  return (nu->iscc && (std::abs(nu->pdg) == 12));
48  });
49  const NuTruthCut kIsCC_NT([](const caf::SRNeutrinoProxy* nu){
50  return (nu->iscc);
51  });
53 
58  const Cut kIsNC = CutFromNuTruthCut(kIsNC_NT);
59 
60  ////////////////////////////////////
61  /// Geometry
62  ////////////////////////////////////
63  const TVector3 * detector_vtx_min = new TVector3(-191, -187, 0);
64  const TVector3 * detector_vtx_max = new TVector3( 192, 194, 1270);
65 
66  const TVector3 * loose_vtx_min = new TVector3(-160, -160, 25);
67  const TVector3 * loose_vtx_max = new TVector3(160, 160, 1150);
68 
70  {
71  return VtxInBounds(&nu->vtx, detector_vtx_min, detector_vtx_max);
72  });
74 
76  {
77  return VtxInBounds(&nu->vtx, loose_vtx_min, loose_vtx_max);
78  });
81  const Cut kTrueVtxCut = ana::CutFromNuTruthCut(kTrueVtxCut_NT);
82 
83  ////////////////////////////////////
84  /// Preselection
85  ////////////////////////////////////
86  const Cut kQualityCut([](const caf::SRProxy* sr)
87  {
88  return (sr->trk.kalman.ntracks > 0 && sr->slc.nhit > 20 && sr->slc.ncontplanes > 4);
89  });
90  const Cut kContainmentCut([](const caf::SRProxy* sr)
91  {
92  if(!sr->vtx.elastic.IsValid) return false;
93  int ibesttrk = ana::muonid_classifier::kBestMuonTrack(sr);
94  if(ibesttrk < 0 || ibesttrk >= int(sr->trk.kalman.ntracks))
95  return false;
96 
97  // All prongs and shower containment
98  TVector3 * containLow = new TVector3(-180, -180, 20);
99  TVector3 * containHigh = new TVector3(180, 180, 1525);
100  for(const caf::SRFuzzyKProngProxy& prong : sr->vtx.elastic.fuzzyk.png)
101  if(!VtxInBounds(&prong.shwlid.start, containLow, containHigh) || !VtxInBounds(&prong.shwlid.stop, containLow, containHigh))
102  return false;
103 
104  // Only most muon-like track present in muon catcher
105  if(sr->trk.kalman.ntracks < 1)
106  return false;
107  const unsigned short muon_catcher_edge = 1270;
108  for(unsigned int i = 0; i < sr->trk.kalman.ntracks; ++i)
109  {
110  if(int(i) == ibesttrk)
111  continue;
112  if( sr->trk.kalman.tracks[i].start.Z() > muon_catcher_edge ||
113  sr->trk.kalman.tracks[i].stop.Z() > muon_catcher_edge )
114  return false;
115  }
116 
117  // Muon catcher has less modules, require muon
118  const caf::SRKalmanTrackProxy& besttrack = sr->trk.kalman.tracks[ibesttrk];
119  return ((besttrack.stop.Z() < muon_catcher_edge || besttrack.trkyposattrans < 55 ) // air gap
120  && besttrack.trkfwdcellnd > 5 && besttrack.trkbakcellnd > 10);
121  });
122 
123  ////////////////////////////////////
124  /// Main analysis reconstruction cuts
125  ////////////////////////////////////
126  // const Cut kTrueMubarTrk([](const caf::SRProxy* sr)
127  // {
128  // unsigned int ibesttrk = 0;
129  // if (sr->trk.kalman.ntracks < 1)
130  // return false;
131  // return (sr->trk.kalman.tracks[ibesttrk].truth.pdg == -13);
132  // });
133 
134  // const Cut kTrueMuonTrk([](const caf::SRProxy* sr)
135  // {
136  // unsigned int ibesttrk = 0;
137  // if (sr->trk.kalman.ntracks < 1)
138  // return false;
139  // return (sr->trk.kalman.tracks[ibesttrk].truth.pdg == +13);
140  // });
141 
142  // const Cut kTrueMuOrMubarTrk([](const caf::SRProxy* sr)
143  // {
144  // unsigned int ibesttrk = 0;
145  // if (sr->trk.kalman.ntracks < 1)
146  // return false;
147  // return (std::abs(sr->trk.kalman.tracks[ibesttrk].truth.pdg) == 13);
148  // });
149 
150  const Cut kRecoVtxDetectorCut([](const caf::SRProxy* sr)
151  {
152  if (!sr->vtx.elastic.IsValid)
153  return false;
154  return VtxInBounds(&sr->vtx.elastic.vtx, detector_vtx_min, detector_vtx_max);
155  });
156 
157  const Cut kRecoVtxLooseCut([](const caf::SRProxy* sr)
158  {
159  if (!sr->vtx.elastic.IsValid)
160  return false;
161  return VtxInBounds(&sr->vtx.elastic.vtx, loose_vtx_min, loose_vtx_max);
162  });
164 
165 } } } // End ana::xsec::numubar namespace
const NuTruthCut kIsNueCC_NT([](const caf::SRNeutrinoProxy *nu){return(nu->iscc &&(nu->pdg==12));})
Signal cuts.
caf::Proxy< caf::SRFuzzyK > fuzzyk
Definition: SRProxy.h:1983
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const NuTruthCut kTrueVtxDetectorCut_NT([](const caf::SRNeutrinoProxy *nu){return VtxInBounds(&nu->vtx, detector_vtx_min, detector_vtx_max);})
const TVector3 * detector_vtx_max
caf::Proxy< size_t > ntracks
Definition: SRProxy.h:1724
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2038
caf::Proxy< unsigned int > ncontplanes
Definition: SRProxy.h:1261
const NuTruthCut kIsNuebarCC_NT([](const caf::SRNeutrinoProxy *nu){return(nu->iscc &&(nu->pdg==-12));})
GenericCut< caf::SRNeutrinoProxy > NuTruthCut
Cut designed to be used over the nuTree, ie all neutrinos, not just those that got slices...
Definition: Cut.h:104
float abs(float number)
Definition: d0nt_math.hpp:39
caf::Proxy< caf::SRElastic > elastic
Definition: SRProxy.h:2030
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
Definition: SRProxy.h:1967
const TVector3 * loose_vtx_max
const Cut kQualityCut([](const caf::SRProxy *sr){return(sr->trk.kalman.ntracks > 0 &&sr->slc.nhit > 20 &&sr->slc.ncontplanes > 4);})
Preselection.
caf::Proxy< unsigned int > nhit
Definition: SRProxy.h:1262
const NuTruthCut kIsNueorbarCC_NT([](const caf::SRNeutrinoProxy *nu){return(nu->iscc &&(std::abs(nu->pdg)==12));})
caf::Proxy< caf::SRTrackBranch > trk
Definition: SRProxy.h:2057
const NuTruthCut kIsNumuNumubarCC_NT
Eigen::VectorXd vec
const NuTruthCut kIsNC_NT
const NuTruthCut kIsNumuCC_NT([](const caf::SRNeutrinoProxy *nu){return(nu->iscc &&nu->pdg==+14);})
Double_t xsec[nknots]
Definition: testXsec.C:47
const Var kBestMuonTrack(muonid_classifier::BestTrack)
const Cut kRecoVtxDetectorCut([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;return VtxInBounds(&sr->vtx.elastic.vtx, detector_vtx_min, detector_vtx_max);})
Main analysis reconstruction cuts.
caf::Proxy< caf::SRKalman > kalman
Definition: SRProxy.h:1743
Template for Cut and SpillCut.
Definition: Cut.h:15
const NuTruthCut kTrueVtxCut_NT
caf::Proxy< bool > IsValid
Definition: SRProxy.h:1982
const NuTruthCut kIsNumubarCC_NT([](const caf::SRNeutrinoProxy *nu){return(nu->iscc &&nu->pdg==-14);})
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2054
const Cut kContainmentCut([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;int ibesttrk=ana::muonid_classifier::kBestMuonTrack(sr);if(ibesttrk< 0||ibesttrk >=int(sr->trk.kalman.ntracks)) return false;TVector3 *containLow=new TVector3(-180,-180, 20);TVector3 *containHigh=new TVector3(180, 180, 1525);for(const caf::SRFuzzyKProngProxy &prong:sr->vtx.elastic.fuzzyk.png) if(!VtxInBounds(&prong.shwlid.start, containLow, containHigh)||!VtxInBounds(&prong.shwlid.stop, containLow, containHigh)) return false;if(sr->trk.kalman.ntracks< 1) return false;const unsigned short muon_catcher_edge=1270;for(unsigned int i=0;i< sr->trk.kalman.ntracks;++i){if(int(i)==ibesttrk) continue;if(sr->trk.kalman.tracks[i].start.Z() > muon_catcher_edge|| sr->trk.kalman.tracks[i].stop.Z() > muon_catcher_edge) return false;}const caf::SRKalmanTrackProxy &besttrack=sr->trk.kalman.tracks[ibesttrk];return((besttrack.stop.Z()< muon_catcher_edge||besttrack.trkyposattrans< 55) &&besttrack.trkfwdcellnd > 5 &&besttrack.trkbakcellnd > 10);})
caf::Proxy< caf::SRVector3D > vtx
Definition: SRProxy.h:1985
const TVector3 * detector_vtx_min
Geometry.
caf::Proxy< std::vector< caf::SRKalmanTrack > > tracks
Definition: SRProxy.h:1726
const NuTruthCut kTrueVtxLooseCut_NT([](const caf::SRNeutrinoProxy *nu){return VtxInBounds(&nu->vtx, loose_vtx_min, loose_vtx_max);})
caf::Proxy< caf::SRVertexBranch > vtx
Definition: SRProxy.h:2058
const TVector3 * loose_vtx_min
const Cut kRecoVtxLooseCut([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;return VtxInBounds(&sr->vtx.elastic.vtx, loose_vtx_min, loose_vtx_max);})
const NuTruthCut kIsCC_NT([](const caf::SRNeutrinoProxy *nu){return(nu->iscc);})
Cut CutFromNuTruthCut(const NuTruthCut &stc)
Definition: Cut.cxx:128
static constexpr Double_t sr
Definition: Munits.h:164
bool VtxInBounds(const caf::SRVector3DProxy *vec, const TVector3 *vmin, const TVector3 *vmax)
Main analysis truth cuts.