NusCuts.cxx
Go to the documentation of this file.
1 #include "NuXAna/Cuts/NusCuts.h"
2 
4 
5 #include <cassert>
6 
7 namespace ana
8 {
9  const double NDL = -191.;
10  const double NDR = 192.;
11  const double NDB = -187.;
12  const double NDT = 194.;
13  const double NDF = 0.;
14  const double NDE = 1270.;
15 
16  const double FDL = -758.;
17  const double FDR = 765.;
18  const double FDB = -749.;
19  const double FDT = 765.;
20  const double FDF = 0.;
21  const double FDE = 5962.;
22 
23  const Cut kCosmicVeto([](const caf::SRProxy* sr)
24  {
25  return sr->sel.veto.keep;
26  });
27 
28  const Cut kNusEventQuality(
29  [](const caf::SRProxy* sr)
30  {
31  if(!sr->vtx.elastic.IsValid) return false;
32  if(sr->sel.nuecosrej.hitsperplane >= 8) return false;
33  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return false;
34  if(sr->vtx.elastic.fuzzyk.png[0].shwlid.gap >= 100.) return false;
35  if(sr->slc.ncontplanes <= 2) return false;
36  return true;
37  });
38 
39  const Cut kNusFDFiducial(
40  [](const caf::SRProxy* sr)
41  {
42  // can't use the assertion for N-1 plots
43  //assert(sr->vtx.elastic.IsValid && "Must apply DQ cuts");
44  if(!sr->vtx.elastic.IsValid) return false;
45 
46  const TVector3 vtx = sr->vtx.elastic.vtx;
47  if(vtx.X() < -680.0) return false;
48  if(vtx.X() > 650.0) return false;
49  if(vtx.Y() < -720.0) return false;
50  if(vtx.Y() > 500.0) return false;
51  if(vtx.Z() < 50.0) return false;
52  if(vtx.Z() > 5450.0) return false;
53  return true;
54  });
55 
56  const Cut kNusFDFidLoose(
57  [](const caf::SRProxy* sr)
58  {
59  double buf = 10.;
60  if(!sr->vtx.elastic.IsValid) return false;
61 
62  const TVector3 vtx = sr->vtx.elastic.vtx;
63  if(vtx.X() < (FDL + buf)) return false;
64  if(vtx.X() > (FDR - buf)) return false;
65  if(vtx.Y() < (FDB + buf)) return false;
66  if(vtx.Y() > (FDT - buf)) return false;
67  if(vtx.Z() < (FDF + buf)) return false;
68  if(vtx.Z() > (FDE - buf)) return false;
69  return true;
70  });
71 
72  const Cut kNusFDContain(
73  [](const caf::SRProxy* sr)
74  {
75  const caf::SRNueCosRejProxy& cr = sr->sel.nuecosrej;
76 
77  if(std::min(cr.starteast, cr.stopeast) < 10) return false;
78  if(std::min(cr.startwest, cr.stopwest) < 10) return false;
79  if(std::min(cr.starttop, cr.stoptop) < 10) return false;
80  if(std::min(cr.startbottom, cr.stopbottom) < 10) return false;
81  if(std::min(cr.startfront, cr.stopfront) < 10) return false;
82  if(std::min(cr.startback, cr.stopback) < 10) return false;
83  return true;
84  });
85 
86  const Cut kNusNCSel(
87  [](const caf::SRProxy* sr)
88  {
89  if(sr->slc.nhit >= 200) return false;
90  if(sr->slc.nhit < 20) return false;
91  if(sr->sel.cvn.ncid < 0.2) return false;
92 
93  return true;
94  });
95 
96  const Cut kNusFDDecafCut(
97  [](const caf::SRProxy* sr)
98  {
99  if(sr->sel.cosrej.numucontpid2019 <= 0.42) return false;
100  return true;
101  });
102 
103  const Cut kNusCosRej(
104  [](const caf::SRProxy* sr)
105  {
106  double numucontpid2019 = sr->sel.cosrej.numucontpid2019;
107  double partptp = sr->sel.nuecosrej.partptp;
108  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return false;
109  if(numucontpid2019 <= 0.5) return false;
110  if(partptp >= 0.8) return false;
111  if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon == 1) return false;
112  double nhit = (double)sr->slc.nhit;
113  if(nhit <= 0.) return false;
114  if(sr->slc.calE/nhit <= 0.018) return false;
115  if(std::min(sr->sel.nuecosrej.starttop, sr->sel.nuecosrej.stoptop) < 480) return false;
116  return true;
117  });
118 
119  const Cut kNusNDFiducial(
120  [](const caf::SRProxy* sr)
121  {
122  assert(sr->vtx.elastic.IsValid && "Must apply DQ cuts");
123  if(sr->vtx.elastic.vtx.X() < -100.0) return false;
124  if(sr->vtx.elastic.vtx.X() > 100.0) return false;
125  if(sr->vtx.elastic.vtx.Y() < -100.0) return false;
126  if(sr->vtx.elastic.vtx.Y() > 100.0) return false;
127  if(sr->vtx.elastic.vtx.Z() < 200.0) return false;
128  if(sr->vtx.elastic.vtx.Z() > 1000.0) return false;
129  return true;
130  });
131 
132  const Cut kNusNDFidLoose(
133  [](const caf::SRProxy* sr)
134  {
135  double buf = 10.;
136  if(!sr->vtx.elastic.IsValid) return false;
137 
138  const TVector3 vtx = sr->vtx.elastic.vtx;
139  if(vtx.X() < (NDL + buf)) return false;
140  if(vtx.X() > (NDR - buf)) return false;
141  if(vtx.Y() < (NDB + buf)) return false;
142  if(vtx.Y() > (NDT - buf)) return false;
143  if(vtx.Z() < (NDF + buf)) return false;
144  if(vtx.Z() > (NDE - buf)) return false;
145 
146  return true;
147  });
148 
149  const Cut kNusNDContain(
150  [](const caf::SRProxy* sr)
151  {
152  const caf::SRNueCosRejProxy& cr = sr->sel.nuecosrej;
153 
154  if(std::min(cr.starteast, cr.stopeast) < 25) return false;
155  if(std::min(cr.startwest, cr.stopwest) < 25) return false;
156  if(std::min(cr.starttop, cr.stoptop) < 25) return false;
157  if(std::min(cr.startbottom, cr.stopbottom) < 25) return false;
158  if(std::min(cr.startfront, cr.stopfront) < 25) return false;
159  if(std::min(cr.startback, cr.stopback) < 25) return false;
160  return true;
161  });
162 
163  const Cut kNusNDHarshTrk(
164  [](const caf::SRProxy* sr)
165  {
166  double buf = 25.;
167  if(sr->trk.kalman.ntracks == 0) return false;
168 
169  for(unsigned int i = 0, n = sr->trk.kalman.ntracks; i < n; ++i) {
170  TVector3 start = sr->trk.kalman.tracks[i].start;
171  TVector3 stop = sr->trk.kalman.tracks[i].stop;
172  if(std::min(start.X(), stop.X()) < (NDL + buf)) return false;
173  if(std::max(start.X(), stop.X()) > (NDR - buf)) return false;
174  if(std::min(start.Y(), stop.Y()) < (NDB + buf)) return false;
175  if(std::max(start.Y(), stop.Y()) > (NDT - buf)) return false;
176  if(std::min(start.Z(), stop.Z()) < (NDF + buf)) return false;
177  if(std::max(start.Z(), stop.Z()) > (NDE - buf)) return false;
178  }
179 
180  return true;
181  });
182 
183  const Cut kNusCosRejMod(
184  [](const caf::SRProxy* sr)
185  {
186  double partptp = sr->sel.nuecosrej.partptp;
187  if(sr->vtx.elastic.fuzzyk.nshwlid == 0) return false;
188  if(partptp >= 0.8) return false;
189  if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon == 1) return false;
190  double nhit = (double)sr->slc.nhit;
191  if(nhit <= 0.) return false;
192  if(sr->slc.calE/nhit <= 0.009) return false;
193  return true;
194  });
195 }
caf::Proxy< unsigned int > nshwlid
Definition: SRProxy.h:2040
const double NDT
Definition: NusCuts.cxx:12
caf::Proxy< caf::SRVeto > veto
Definition: SRProxy.h:1274
const Cut kNusFDFiducial([](const caf::SRProxy *sr){ if(!sr->vtx.elastic.IsValid) return false;const TVector3 vtx=sr->vtx.elastic.vtx;if(vtx.X()< -680.0) return false;if(vtx.X() > 650.0) return false;if(vtx.Y()< -720.0) return false;if(vtx.Y() > 500.0) return false;if(vtx.Z()< 50.0) return false;if(vtx.Z() > 5450.0) return false;return true;})
FD Fiducial volume from docdb 15285.
Definition: NusCuts.h:17
caf::Proxy< caf::SRFuzzyK > fuzzyk
Definition: SRProxy.h:2059
float partptp
Definition: NusVarsTemp.cxx:50
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
caf::Proxy< float > stoptop
Definition: SRProxy.h:1080
const Cut kNusEventQuality([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;if(sr->sel.nuecosrej.hitsperplane >=8) return false;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.gap >=100.) return false;if(sr->slc.ncontplanes<=2) return false;return true;})
Data Quality cuts from docdb 14241.
Definition: NusCuts.h:14
caf::Proxy< float > stopfront
Definition: SRProxy.h:1079
caf::Proxy< float > ncid
Definition: SRProxy.h:904
caf::Proxy< size_t > ntracks
Definition: SRProxy.h:1778
const double NDR
Definition: NusCuts.cxx:10
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
const double FDE
Definition: NusCuts.cxx:21
caf::Proxy< float > startbottom
Definition: SRProxy.h:1071
const Cut kNusNDFiducial([](const caf::SRProxy *sr){assert(sr->vtx.elastic.IsValid &&"Must apply DQ cuts");if(sr->vtx.elastic.vtx.X()< -100.0) return false;if(sr->vtx.elastic.vtx.X() > 100.0) return false;if(sr->vtx.elastic.vtx.Y()< -100.0) return false;if(sr->vtx.elastic.vtx.Y() > 100.0) return false;if(sr->vtx.elastic.vtx.Z()< 200.0) return false;if(sr->vtx.elastic.vtx.Z() > 1000.0) return false;return true;})
ND Fiducial volume from docdb 15242.
Definition: NusCuts.h:51
caf::Proxy< unsigned int > ncontplanes
Definition: SRProxy.h:1314
nhit
Definition: demo1.py:25
const Cut kNusFDContain([](const caf::SRProxy *sr){const caf::SRNueCosRejProxy &cr=sr->sel.nuecosrej;if(std::min(cr.starteast, cr.stopeast)< 10) return false;if(std::min(cr.startwest, cr.stopwest)< 10) return false;if(std::min(cr.starttop, cr.stoptop) < 10) return false;if(std::min(cr.startbottom, cr.stopbottom)< 10) return false;if(std::min(cr.startfront, cr.stopfront)< 10) return false;if(std::min(cr.startback, cr.stopback)< 10) return false;return true;})
Containment variable for NC events from docdb 14241.
Definition: NusCuts.h:24
const Cut kNusFDFidLoose([](const caf::SRProxy *sr){double buf=10.;if(!sr->vtx.elastic.IsValid) return false;const TVector3 vtx=sr->vtx.elastic.vtx;if(vtx.X()< (FDL+buf)) return false;if(vtx.X() >(FDR-buf)) return false;if(vtx.Y()< (FDB+buf)) return false;if(vtx.Y() >(FDT-buf)) return false;if(vtx.Z()< (FDF+buf)) return false;if(vtx.Z() >(FDE-buf)) return false;return true;})
Definition: NusCuts.h:21
const Cut kNusNCSel([](const caf::SRProxy *sr){if(sr->slc.nhit >=200) return false;if(sr->slc.nhit< 20) return false;if(sr->sel.cvn.ncid< 0.2) return false;return true;})
Cut that is more CC rejection than NC selection from docdb 15285.
Definition: NusCuts.h:27
caf::Proxy< float > starttop
Definition: SRProxy.h:1074
const double NDL
Definition: NusCuts.cxx:9
caf::Proxy< float > stopback
Definition: SRProxy.h:1076
caf::Proxy< caf::SRCosRej > cosrej
Definition: SRProxy.h:1252
caf::Proxy< caf::SRElastic > elastic
Definition: SRProxy.h:2118
const double FDF
Definition: NusCuts.cxx:20
const Cut kNusNDFidLoose([](const caf::SRProxy *sr){double buf=10.;if(!sr->vtx.elastic.IsValid) return false;const TVector3 vtx=sr->vtx.elastic.vtx;if(vtx.X()< (NDL+buf)) return false;if(vtx.X() >(NDR-buf)) return false;if(vtx.Y()< (NDB+buf)) return false;if(vtx.Y() >(NDT-buf)) return false;if(vtx.Z()< (NDF+buf)) return false;if(vtx.Z() >(NDE-buf)) return false;return true;})
Definition: NusCuts.h:55
caf::Proxy< float > startback
Definition: SRProxy.h:1070
caf::Proxy< caf::SRNueCosRej > nuecosrej
Definition: SRProxy.h:1265
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
Definition: SRProxy.h:2043
caf::Proxy< unsigned int > nhit
Definition: SRProxy.h:1315
caf::Proxy< float > stopeast
Definition: SRProxy.h:1078
caf::Proxy< float > stopbottom
Definition: SRProxy.h:1077
caf::Proxy< caf::SRTrackBranch > trk
Definition: SRProxy.h:2145
caf::Proxy< caf::SRCVNResult > cvn
Definition: SRProxy.h:1253
caf::Proxy< float > startfront
Definition: SRProxy.h:1073
caf::Proxy< float > hitsperplane
Definition: SRProxy.h:1046
const double FDT
Definition: NusCuts.cxx:19
const Cut kNusFDDecafCut([](const caf::SRProxy *sr){if(sr->sel.cosrej.numucontpid2019<=0.42) return false;return true;})
Decaf cut motivated by doc-db 15152.
Definition: NusCuts.h:30
caf::StandardRecord * sr
const Cut kNusNDHarshTrk([](const caf::SRProxy *sr){double buf=25.;if(sr->trk.kalman.ntracks==0) return false;for(unsigned int i=0, n=sr->trk.kalman.ntracks;i< n;++i){TVector3 start=sr->trk.kalman.tracks[i].start;TVector3 stop=sr->trk.kalman.tracks[i].stop;if(std::min(start.X(), stop.X())< (NDL+buf)) return false;if(std::max(start.X(), stop.X()) >(NDR-buf)) return false;if(std::min(start.Y(), stop.Y())< (NDB+buf)) return false;if(std::max(start.Y(), stop.Y()) >(NDT-buf)) return false;if(std::min(start.Z(), stop.Z())< (NDF+buf)) return false;if(std::max(start.Z(), stop.Z()) >(NDE-buf)) return false;}return true;})
Extra containment cut for the ND first motivated in docdb 13402.
Definition: NusCuts.h:61
caf::Proxy< float > partptp
Definition: SRProxy.h:1057
caf::Proxy< float > stopwest
Definition: SRProxy.h:1081
const double FDR
Definition: NusCuts.cxx:17
caf::Proxy< float > starteast
Definition: SRProxy.h:1072
const double NDF
Definition: NusCuts.cxx:13
caf::Proxy< caf::SRKalman > kalman
Definition: SRProxy.h:1797
caf::Proxy< bool > IsValid
Definition: SRProxy.h:2058
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2142
const Cut kNusNDContain([](const caf::SRProxy *sr){const caf::SRNueCosRejProxy &cr=sr->sel.nuecosrej;if(std::min(cr.starteast, cr.stopeast)< 25) return false;if(std::min(cr.startwest, cr.stopwest)< 25) return false;if(std::min(cr.starttop, cr.stoptop) < 25) return false;if(std::min(cr.startbottom, cr.stopbottom)< 25) return false;if(std::min(cr.startfront, cr.stopfront)< 25) return false;if(std::min(cr.startback, cr.stopback)< 25) return false;return true;})
Containment variable for NC events from docdb 15242.
Definition: NusCuts.h:58
caf::Proxy< float > calE
Definition: SRProxy.h:1292
const double NDB
Definition: NusCuts.cxx:11
Proxy for caf::SRNueCosRej.
Definition: SRProxy.h:1024
const double FDL
Definition: NusCuts.cxx:16
caf::Proxy< caf::SRVector3D > vtx
Definition: SRProxy.h:2073
assert(nhit_max >=nhit_nbins)
const Cut kNusCosRejMod([](const caf::SRProxy *sr){double partptp=sr->sel.nuecosrej.partptp;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(partptp >=0.8) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon==1) return false;double nhit=(double) sr->slc.nhit;if(nhit<=0.) return false;if(sr->slc.calE/nhit<=0.009) return false;return true;})
Definition: NusCuts.h:66
const double NDE
Definition: NusCuts.cxx:14
caf::Proxy< caf::SRIDBranch > sel
Definition: SRProxy.h:2141
T min(const caf::Proxy< T > &a, T b)
Template for Cut and SpillCut.
Definition: Cut.h:15
caf::Proxy< float > numucontpid2019
Definition: SRProxy.h:883
caf::Proxy< caf::SRVertexBranch > vtx
Definition: SRProxy.h:2146
const double FDB
Definition: NusCuts.cxx:18
const Cut kCosmicVeto([](const caf::SRProxy *sr){return sr->sel.veto.keep;})
Definition: NusCuts.h:11
caf::Proxy< float > startwest
Definition: SRProxy.h:1075
caf::Proxy< bool > keep
Definition: SRProxy.h:1205
const Cut kNusCosRej([](const caf::SRProxy *sr){double numucontpid2019=sr->sel.cosrej.numucontpid2019;double partptp=sr->sel.nuecosrej.partptp;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(numucontpid2019<=0.5) return false;if(partptp >=0.8) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon==1) return false;double nhit=(double) sr->slc.nhit;if(nhit<=0.) return false;if(sr->slc.calE/nhit<=0.018) return false;if(std::min(sr->sel.nuecosrej.starttop, sr->sel.nuecosrej.stoptop)< 480) return false;return true;})
Cosmic rejection for the NC sample from docdb 15241.
Definition: NusCuts.h:33