NusCuts20.h
Go to the documentation of this file.
1 #pragma once
2 
3 // Location for NuS 2020 analysis cuts
4 // The cut values in this file are outlined in the Nus20 Selection
5 // technote, docdb 44374
6 
7 #include "CAFAna/Core/Cut.h"
10 #include "CAFAna/Cuts/Cuts.h"
11 #include "CAFAna/Vars/Vars.h"
15 #include "NuXAna/Vars/NusVars.h"
20 #include "NuXAna/Cuts/NusCuts.h"
21 
22 #include "CAFAna/Cuts/SpillCuts.h"
23 
24 namespace ana
25 {
26 
27  // -------------------------------- //
28  // GENERIC //
29  // -------------------------------- //
30 
31  // Decaf cuts: CVN NC id > .1 for decaf files (both FD and ND)
32  // Cut for prof5 CVN (using cvnlooseptp here)
33  // define both FHC and RHC cuts in case we want a different cut for RHC in '21
34  extern const Cut kNus20FHCDecafCut;
35  extern const Cut kNus20RHCDecafCut;
36 
37  // quality cuts
41  const Cut kNus20QualityCuts = kNus20ElasticProngCut &&
42  kNus20NFuzzyProngCut &&
44 
45  const Cut kNus20EnergyCut = (kNus20Energy > 0.5 && kNus20Energy < 20);
46 
47  // -------------------------------- //
48  // NEAR DETECTOR //
49  // -------------------------------- //
50 
51  // define fiducial volume here so it's picked up for both reco and true vertices
52  float xLowND = -100;
53  float xHighND = 100;
54  float yLowND = -100;
55  float yHighND = 100;
56  float zLowND = 150;
57  float zHighND = 1000;
58 
59  // pre selection cut
60  // including kNShwLid > 0 otherwise vectors go out of range
62  kNus20FHCDecafCut &&
63  !kNumu2020ND &&
64  !kNue2020ND &&
65  (kNShwLid > 0);
66 
67  // near detector containment cuts
68  const Cut kNus20NDVtxXCut = (kVtxX > xLowND && kVtxX < xHighND);
69  const Cut kNus20NDVtxYCut = (kVtxY > yLowND && kVtxY < yHighND );
70  const Cut kNus20NDVtxZCut = (kVtxZ > zLowND && kVtxZ < zHighND);
71  const Cut kNus20NDVtxPosCut = kNus20NDVtxXCut &&
72  kNus20NDVtxYCut &&
74 
81  const Cut kNus20NDMinSliceDistCut = kNus20NDDistAllTopCut &&
82  kNus20NDDistAllBottomCut &&
83  kNus20NDDistAllEastCut &&
84  kNus20NDDistAllWestCut &&
85  kNus20NDDistAllFrontCut &&
87 
88  const Cut kNus20NDFiducialCuts = kNus20NDVtxPosCut &&
90 
91  // places quality and fiducial volume cuts
92  const Cut kNus20NDQualityAndFiducialCut = kNus20QualityCuts &&
94 
95  // near detector selection cuts
96  // only places cut on CVN value
98 
100 
101  // full near detector selection
102  const Cut kNus20NDCuts = kNus20NDPreSelection &&
103  kNus20QualityCuts &&
104  kNus20NDFiducialCuts &&
105  kNus20NDSelectionCuts &&
107 
108  // this cut is to define out of the detector
112  const Cut kNus20NDTrueVtxOutOfDet = kNus20NDTrueVtxOutOfDetX ||
113  kNus20NDTrueVtxOutOfDetY ||
115 
116  // defines true vertices inside of the fiducial volume
117  // for whatever reason, the true variables are stores as meters
118  const Cut kNus20NDTrueContainedX = (kTrueVtxX > xLowND/100 && kTrueVtxX < xHighND/100);
119  const Cut kNus20NDTrueContainedY = (kTrueVtxY > yLowND/100 && kTrueVtxY < yHighND/100);
120  const Cut kNus20NDTrueContainedZ = (kTrueVtxZ > zLowND/100 && kTrueVtxZ < zHighND/100);
121  const Cut kNus20NDTrueContained = kNus20NDTrueContainedX &&
122  kNus20NDTrueContainedY &&
124 
125  // -------------------------------- //
126  // FAR DETECTOR //
127  // -------------------------------- //
128 
129  // define fiducial volume here so it's picked up for both reco and true vertices
130  float xLowFD = -100;
131  float xHighFD = 100;
132  float yLowFD = -100;
133  float yHighFD = 100;
134  float zLowFD = 150;
135  float zHighFD = 1000;
136 
137  // pre selection cut
139  kNus20FHCDecafCut &&
140  !kNumu2020FD &&
141  !kNue2020FD &&
142  (kNShwLid > 0);
143 
144  // don't apply vertex cuts straight up, instead look at just signal
145  // containment, and put the vertex positions into the BDT
146 
153  const Cut kNus20FDMinSliceDistCut = kNus20FDDistAllTopCut &&
154  kNus20FDDistAllBottomCut &&
155  kNus20FDDistAllEastCut &&
156  kNus20FDDistAllWestCut &&
157  kNus20FDDistAllFrontCut &&
159 
160  const Cut kNus20FDQualityContainment = kNus20FDPreSelection &&
161  kNus20QualityCuts &&
163 
164  // far detector selection cuts
165  // only places cut on CVN value
167 
169 
170  // far detector cosmic rejection cuts
172 
173  // full far detector selection
174  const Cut kNus20FDCuts = kNus20FDPreSelection &&
175  kNus20QualityCuts &&
176  kNus20FDMinSliceDistCut &&
177  kNus20FDSelectionCuts &&
178  kNus20FDCosRejCuts &&
180  const Cut kNus20FDCuts_ML = kNus20FDCuts && kIsLeptonMissing;
181 
182  // this cut is to define out of the detector
186  const Cut kNus20FDTrueVtxOutOfDet = kNus20FDTrueVtxOutOfDetX ||
187  kNus20FDTrueVtxOutOfDetY ||
189 
190 
191 }
const double NDT
Definition: NusCuts.cxx:12
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kNus20FDTrueVtxOutOfDet
Definition: NusCuts20.h:186
const Var kDistAllBottom([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngbottom)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngbottom);})
Distance of all showers in slice from the bottom edge of detector.
Definition: NueVars.h:33
const Cut kNus20NDPreSelection
Definition: NusCuts20.h:61
const Cut kNus20NDTrueVtxOutOfDetX
Definition: NusCuts20.h:109
const Var kDistAllWest([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngwest)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngwest);})
Distance of all showers in slice from the west edge of detector.
Definition: NueVars.h:36
const Cut kNus20NDTrueContainedX
Definition: NusCuts20.h:118
const Cut kNus20FHCDecafCut([](const caf::SRProxy *sr){if(sr->sel.cvnloosepreselptp.ncid<=.1) return false;return true;})
Definition: NusCuts20.h:34
const Var kIsElastic
Definition: NusVars.cxx:11
float zLowFD
Definition: NusCuts20.h:134
float xLowFD
Definition: NusCuts20.h:130
const Var kDistAllTop([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngtop)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngtop);})
Distance of all showers in slice from the top edge of detector.
Definition: NueVars.h:30
const Cut kNus20FDDistAllBottomCut
Definition: NusCuts20.h:148
const double NDR
Definition: NusCuts.cxx:10
const Var kDistAllBack([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngback)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngback);})
Distance of all showers in slice from the back edge of detector.
Definition: NueVars.h:42
const Cut kNus20FDSelectionCuts
Definition: NusCuts20.h:168
const Var kNus20Energy([](const caf::SRProxy *sr){if(sr->hdr.det!=caf::kNEARDET &&sr->hdr.det!=caf::kFARDET) return(double) sr->slc.calE;double pars[4][6]={{1.049, 0.795, 0.8409, 0.17, 0.82,-1.00},{1.025, 0.797, 0.9162, 0.53,-0.26,-1.48},{1.000, 1.000, 1.0000, 0.00, 0.00, 0.00},{1.000, 1.000, 1.0000, 0.00, 0.00, 0.00}};int detCur=(sr->hdr.det==caf::kFARDET)+((sr->spill.isRHC)<< 1);double e_EM=ana::kEME_2020(sr);double e_Had=ana::kHADE_2020(sr);double e_Cal=sr->slc.calE;return(e_EM/pars[detCur][0]+e_Had/pars[detCur][1])/(pars[detCur][2]+pars[detCur][3]*std::pow(e_Cal+pars[detCur][4], 2)*std::exp(pars[detCur][5]*e_Cal));})
Definition: NusVars.h:64
const Cut kIsLeptonMissing([](const caf::SRProxy *sr){if(sr->mc.nnu > 0){if(sr->mc.nu[0].prim.size()==0){return false;}else if(abs(sr->mc.nu[0].pdg)==16 &&sr->mc.nu[0].iscc){ return true;}else if(abs(sr->mc.nu[0].prim[0].pdg)< 11 ||abs(sr->mc.nu[0].prim[0].pdg) > 16){ return false;}}return true;})
const double FDE
Definition: NusCuts.cxx:21
const Cut kNumu2020ND
Definition: NumuCuts2020.h:57
float yHighND
Definition: NusCuts20.h:55
const Cut kNus20NDQualityAndFiducialCut
Definition: NusCuts20.h:92
const Var kNContPlanes
Definition: NusVars.cxx:13
const Cut kNus20NDTrueVtxOutOfDetZ
Definition: NusCuts20.h:111
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 kNus20FDDistAllTopCut
Definition: NusCuts20.h:147
float yLowFD
Definition: NusCuts20.h:132
const Var kVtxX
const Cut kNus20NDVtxXCut
Definition: NusCuts20.h:68
const Cut kNus20FDDistAllFrontCut
Definition: NusCuts20.h:151
const Cut kNue2020ND
Definition: NueCuts2020.h:178
const double NDL
Definition: NusCuts.cxx:9
const Cut kNus20NDTrueContainedZ
Definition: NusCuts20.h:120
const Cut kNus20QualityCuts
Definition: NusCuts20.h:41
const Cut kNus20NDTrueVtxOutOfDet
Definition: NusCuts20.h:112
const Cut kNus20NDCuts
Definition: NusCuts20.h:102
const Var kNFuzzyProng
Definition: NusVars.cxx:12
const Cut kNus20FDTrueVtxOutOfDetZ
Definition: NusCuts20.h:185
const Var kDistAllEast([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngeast)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngeast);})
Distance of all showers in slice from the east edge of detector.
Definition: NueVars.h:39
const Cut kNus20NDDistAllWestCut
Definition: NusCuts20.h:78
const double FDF
Definition: NusCuts.cxx:20
const Cut kNus20NDDistAllBottomCut
Definition: NusCuts20.h:76
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
const Cut kNus20NContPlanesCut
Definition: NusCuts20.h:40
const Cut kNus20NDMinSliceDistCut
Definition: NusCuts20.h:81
const Cut kNus20RHCDecafCut([](const caf::SRProxy *sr){if(sr->sel.cvnloosepreselptp.ncid<=.1) return false;return true;})
Definition: NusCuts20.h:35
const Cut kNus20NDFiducialCuts
Definition: NusCuts20.h:88
const Cut kNus20NDDistAllTopCut
Definition: NusCuts20.h:75
const Cut kNus20EnergyCut
Definition: NusCuts20.h:45
const Cut kNus20FDCosRejCuts
Definition: NusCuts20.h:171
float xHighND
Definition: NusCuts20.h:53
const Cut kNus20NDVtxZCut
Definition: NusCuts20.h:70
const Cut kNus20FDPreSelection
Definition: NusCuts20.h:138
const double FDT
Definition: NusCuts.cxx:19
const Cut kNus20FDTrueVtxOutOfDetX
Definition: NusCuts20.h:183
const double FDR
Definition: NusCuts.cxx:17
const Cut kNumu2020FD
Definition: NumuCuts2020.h:59
const Cut kNus20NDDistAllFrontCut
Definition: NusCuts20.h:79
float zLowND
Definition: NusCuts20.h:56
const Cut kNue2020FD
Definition: NueCuts2020.h:65
float xLowND
Definition: NusCuts20.h:52
const Cut kNus20FDQualityContainment
Definition: NusCuts20.h:160
float yHighFD
Definition: NusCuts20.h:133
const Cut kNus20NDSelectionCuts
Definition: NusCuts20.h:99
const Cut kNus20NDDistAllEastCut
Definition: NusCuts20.h:77
float zHighND
Definition: NusCuts20.h:57
const Cut kNus20NDTrueContainedY
Definition: NusCuts20.h:119
const Cut kNus20FDDistAllWestCut
Definition: NusCuts20.h:150
const Cut kNus20NDTrueVtxOutOfDetY
Definition: NusCuts20.h:110
const Var kTrueVtxZ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-5.f;return float(sr->mc.nu[0].vtx.Z()/100.);})
Definition: NumuVarsExtra.h:84
const double NDF
Definition: NusCuts.cxx:13
const Var kNShwLid
Definition: NusVars.cxx:22
const Var kCVNnc_looseptp
Definition: NusVars.cxx:14
const Var kDistAllFront([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngfront)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngfront);})
Distance of all showers in slice from the front edge of detector.
Definition: NueVars.h:45
const Cut kNus20NDTrueContained
Definition: NusCuts20.h:121
const Var kVtxY
const Cut kNus20NDDistAllBackCut
Definition: NusCuts20.h:80
const Cut kNus20FDTrueVtxOutOfDetY
Definition: NusCuts20.h:184
const double NDB
Definition: NusCuts.cxx:11
const Cut kNus20NDVtxPosCut
Definition: NusCuts20.h:71
const double FDL
Definition: NusCuts.cxx:16
const Var kVtxZ
const Cut kNus20FDCuts
Definition: NusCuts20.h:174
const double NDE
Definition: NusCuts.cxx:14
float xHighFD
Definition: NusCuts20.h:131
const Cut kNus20NDVtxYCut
Definition: NusCuts20.h:69
const Var kNCCosRejBDTG20
Definition: NusVarsTemp.h:28
float zHighFD
Definition: NusCuts20.h:135
const Cut kNus20FDDistAllEastCut
Definition: NusCuts20.h:149
const Cut kNus20FDCuts_ML
const double FDB
Definition: NusCuts.cxx:18
float yLowND
Definition: NusCuts20.h:54
const Cut kNus20ElasticProngCut
Definition: NusCuts20.h:38
const Var kTrueVtxX([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-5555.f;return float(sr->mc.nu[0].vtx.X()/100.);})
Definition: NumuVarsExtra.h:82
const Cut kNus20FDCVNCut
Definition: NusCuts20.h:166
const Cut kNus20NFuzzyProngCut
Definition: NusCuts20.h:39
const Cut kNus20FDDistAllBackCut
Definition: NusCuts20.h:152
const Cut kNus20FDMinSliceDistCut
Definition: NusCuts20.h:153
const Cut kNus20NDCVNCut
Definition: NusCuts20.h:97
const Var kTrueVtxY([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-5555.f;return float(sr->mc.nu[0].vtx.Y()/100.);})
Definition: NumuVarsExtra.h:83