NueCuts2020.h
Go to the documentation of this file.
1 #pragma once
6 
7 //VERY PRELIMINARY
8 
9 namespace ana
10 {
11 
12 //*************************************************************
13 //******************** Reco quality ***********************
14 //*************************************************************
15 
16  extern const Cut kNue2020RecoQuality;
17 
18 //*************************************************************
19 //************************** FD *****************************
20 //*************************************************************
21 
22  //extern const Cut kNue2020FDVeto;
23 
25 
27  //kNue2020FDVeto &&
30 
31  const Cut kNue2020FDDecafCut = kNue2020FDBasicQuality && kCVNe_looseptp >= 0.5;
33  kNHit > 30 && kNHit < 150 &&
34  kLongestProng > 100 && kLongestProng < 500;
35 
36  // Inherited from second ana, re-tuned/validated docDB 42840/42964
38  kDistAllEast > 12 && kDistAllWest > 12 &&
39  kDistAllFront > 18 && kDistAllBack > 18;
40 
41  const Cut kNue2020CorePart = kNue2020CoreBasicEventCut &&
43 
44  const Cut kNue2020CorePresel = kNue2020FDBasicQuality && kNue2020CorePart;
45 
46  // CVN FHC boundaries
47  const double kNue2020CVNFHCLowEdge = 0.84;
48  const double kNue2020CVNFHCHighEdge = 0.97;
49  const double kNue2020CosRejFHCEdge = 0.49;
50 
51  // CVN RHC boundaries
52  const double kNue2020CVNRHCLowEdge = 0.85;
53  const double kNue2020CVNRHCHighEdge = 0.97;
54  const double kNue2020CosRejRHCEdge = 0.47;
55 
56  const Cut kNue2020PIDFHC = kCVNe_looseptp >= kNue2020CVNFHCLowEdge;
57  const Cut kNue2020PIDRHC = kCVNe_looseptp >= kNue2020CVNRHCLowEdge;
60 
61  extern const Cut kNue2020PID;
62  extern const Cut kNue2020CosRej;
63 
64  // TODO update when there is new cosrej cuts
65  const Cut kNue2020FD = kNue2020CorePresel && kNue2020CosRej && kNue2020PID && kNue2020FDNearestSlice;
66 
67  //*********************** Peripheral ***********************
68 
70  kNue2020FDBasicQuality &&
71  kNueEnergy2020 < 4.5 &&
72  kNueEnergy2020 >= 0;
73 
74  const Cut kNue2020CVN_VsCosPIDRHC = ((kCVNe_looseptp >= kNue2020CVNRHCHighEdge && kCosPIDPeriBDT > 0.6) || (kCVNe_looseptp>=0.995 && kCosPIDPeriBDT > 0.56));
75  const Cut kNue2020CVN_VsCosPIDFHC = ((kCVNe_looseptp >= kNue2020CVNFHCHighEdge && kCosPIDPeriBDT > 0.61) || (kCVNe_looseptp>=0.995 && kCosPIDPeriBDT > 0.57));
76 
79 
80  /// Use this cut for the full FD Peripheral sample, the same for RHC and FHC
83 
85 
86  // --------------------- FD Sidebands --------------------- //
87  const Cut kNue2020FHCCVNCutLP = kCVNe_looseptp >= 0.5 && kCVNe_looseptp < 0.65;
88  const Cut kNue2020RHCCVNCutLP = kCVNe_looseptp >= 0.5 && kCVNe_looseptp < 0.65;
89  extern const Cut kNue2020CVNCutLP;
90 
91  ///////////////////////////////////////////////////////////////////////////
92  //
93  // --------------------- FD Peripheral Sidebands --------------------- //
94  //
95  ///////////////////////////////////////////////////////////////////////////
97  kNue2020FDBasicQuality &&
98  kNueEnergy2020 > 4.5 &&
99  kNueEnergy2020 <= 10;
100 
101  const Cut kNue2020CVNVsCosPIDRHCLP = kCVNe_looseptp >= 0.5 && kCosPIDPeriBDT>0.56;
102  const Cut kNue2020CVNVsCosPIDFHCLP = (kCVNe_looseptp >= 0.5 && kCosPIDPeriBDT>0.57);
104 
105  /// Use this cut for the sideband FD Peripheral samples, the same for RHC and FHC
106  const Cut kNue2020FDPeripheralHE = kNue2020PeripheralBasicEventCutHE && kNue2020CVN_VsCosPID && kNue2020FDNearestSlice && !kNue2020FD;
107  const Cut kNue2020FDPeripheralLP = kNue2020PeripheralBasicEventCut && kNue2020CVNVsCosPIDLP && kNue2020FDNearestSlice && !kNue2020FD;
108 
109 
110  ///////////////////////////////////////////////////////////////////////////
111  //
112  // --------------------- FD Full Sidebands --------------------- //
113  //
114  ///////////////////////////////////////////////////////////////////////////
115 
116  //------------------- Preselection Cut -------------------
118  kNueEnergy2020 > 4.5 &&
119  kNHit > 30 &&
120  kLongestProng > 100 && kLongestProng < 500;
121  const Cut kNue2020CorePartHE = kNue2020CoreBasicEventCutHE &&
123 
124  const Cut kNue2020CorePreselHE = kNue2020FDBasicQuality && kNue2020CorePartHE;
125 
126  /// Use this cut for the sideband FD Core selections, apply for both RHC and FHC
127  const Cut kNue2020FDHE = kNue2020CorePreselHE && kNue2020CosRej && kNue2020PID && kNue2020FDNearestSlice;
128  const Cut kNue2020FDLP = kNue2020CorePresel && kNue2020CVNCutLP && kNue2020CosRej && kNue2020FDNearestSlice;
129 
132 
133  ///////////////////////////////////////////////////////////////////////////
134  //
135  // --------------------- MRBrem cuts --------------------- //
136  //
137  ///////////////////////////////////////////////////////////////////////////
138  // Core
140  //kCosRejVeto && // CNN veto is not applicable for mrbrem files
142 
143  const Cut kNue2020CorePresel_MRBrem = kNue2020FDBasicQuality_MRBrem && kNue2020CorePart;
144  const Cut kNue2020FD_MRBrem = kNue2020CorePresel_MRBrem && kNue2020CosRej && kNue2020PID && kNue2020FDNearestSlice;
145 
146  // Peripheral
148  kNue2020FDBasicQuality_MRBrem &&
149  kNueEnergy2020 < 4.5 &&
150  kNueEnergy2020 >= 0;
151 
154 
155 //*************************************************************
156 //************************** ND *****************************
157 //*************************************************************
158 
159  extern const Cut kNue2020NDFrontPlanes;
160  const Cut kNue2020NDNHits = kNHit >= 20 && kNHit <= 200;
162  const Cut kNue2020NDProngLength = kLongestProng > 100 &&
163  kLongestProng < 500;
164 
165  // Inherited from second ana, re-tuned/validated docDB 42840/42964
166  extern const Cut kNue2020NDFiducial;
167  extern const Cut kNue2020NDContain;
168 
169  const Cut kNue2020NDPresel = kNue2020RecoQuality &&
170  kNue2020NDFiducial &&
171  kNue2020NDContain &&
172  kNue2020NDNHits &&
173  kNue2020NDEnergy &&
175 
176  const Cut kNue2020NDDecafCut = kNue2020RecoQuality && kNue2020NDFiducial &&
178  const Cut kNue2020ND = kNue2020NDPresel && kNue2020PID;
179 
180 //*************************************************************
181 //************** Energy/CVN Binning for 2020 ****************
182 //*************************************************************
183 
184 //will be updated once we have our cvn tuning finalized
185 //TODO: looks weird for ND test... should be ok for ND/FD binning
186 
187  // 2bin layout for 2018, ana2017 style (the third bin is for peripheral sample)
188  extern const Var kNue2020SelectionBin;
189 
190  /// Use this Analysis Binning for Ana2020, official Binning
191  extern const Var kNue2020AnaBin;
192 
193  extern const Binning kNue2020Binning;
194  /// Use this Axis for Ana2020, official Axis
195  extern const HistAxis kNue2020Axis;
196 
198 
201 
202 }
203 
204 
bool kNue2020FDPeripheralFunc(const caf::SRProxy *sr)
Use this cut for the full FD Peripheral sample, the same for RHC and FHC.
Definition: NueCuts2020.cxx:57
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kNue2020CVN_VsCosPIDFHC
Definition: NueCuts2020.h:75
const Cut kNue2020PeripheralBasicEventCut_MRBrem
Definition: NueCuts2020.h:147
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 double kNue2020CVNRHCLowEdge
Definition: NueCuts2020.h:52
const Cut kNue2020ProngContain
Definition: NueCuts2020.h:37
const Cut kApplySecondAnalysisMask([](const caf::SRProxy *sr){if(sr->hdr.det!=caf::kFARDET) return true; std::bitset< 14 > binary(sr->hdr.dibmask);std::pair< int, int > planesA=calcFirstLastLivePlane(sr->slc.firstplane, binary);std::pair< int, int > planesB=calcFirstLastLivePlane(sr->slc.lastplane, binary);if((planesA.first!=planesB.first)||(planesA.second!=planesB.second)) return false;return((planesA.second-planesA.first+1)/64 >=4);})
Definition: AnalysisMasks.h:18
const Cut kNue2020FHCCVNCutLP
Definition: NueCuts2020.h:87
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 kNue2020PID([](const caf::SRProxy *sr){if(kIsRHC(sr)) return kNue2020PIDRHC(sr);else return kNue2020PIDFHC(sr);})
Definition: NueCuts2020.h:61
const Cut kNue2020FD_MRBrem
Definition: NueCuts2020.h:144
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 kNue2020NDNHits
Definition: NueCuts2020.h:160
const Cut k3flavor2020FDVeto
Definition: 3flavorCuts.h:12
const Var kNue2020AnaBinMergedPeripheral([](const caf::SRProxy *sr){int anaBin=kNue2020AnaBin(sr);anaBin=anaBin > 18?20:anaBin;return anaBin;})
Definition: NueCuts2020.h:197
const Cut kNue2020CorePresel_MRBrem
Definition: NueCuts2020.h:143
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
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
const Var kNue2020SelectionBin([](const caf::SRProxy *sr){bool isPeri=kNue2020FDPeripheral(sr);if(isPeri) return float(2.5);const double lowedge=kIsRHC(sr)?kNue2020CVNRHCLowEdge:kNue2020CVNFHCLowEdge;const double highedge=kIsRHC(sr)?kNue2020CVNRHCHighEdge:kNue2020CVNFHCHighEdge;if(sr->sel.cvnloosepreselptp.nueid >=lowedge &&sr->sel.cvnloosepreselptp.nueid< highedge) return float(0.5);else if(sr->sel.cvnloosepreselptp.nueid >=highedge) return float(1.5);else return float(-5.0);return float(-5.0);})
Definition: NueCuts2020.h:188
const double kNue2020CVNRHCHighEdge
Definition: NueCuts2020.h:53
const double kNue2020CosRejFHCEdge
Definition: NueCuts2020.h:49
const Cut kNue2020FDAllSamplesHE
Definition: NueCuts2020.h:130
const Cut kNue2020FDNearestSlice([](const caf::SRProxy *sr){const double hibin=kIsRHC(sr)?kNue2020CVNRHCHighEdge:kNue2020CVNFHCHighEdge;const double topcut=(kCVNe_looseptp(sr) >=hibin)?50:400;return(fabs(sr->slc.closestslicetime) >=100|| sr->slc.closestsliceminfromtop >=topcut|| sr->slc.closestslicemindist >=500);})
Definition: NueCuts2020.h:24
bool kNue2020CVN_VsCosPIDFunc(const caf::SRProxy *sr)
Definition: NueCuts2020.cxx:49
const double kNue2020CosRejRHCEdge
Definition: NueCuts2020.h:54
const Cut kNue2020CVN_VsCosPID(kNue2020CVN_VsCosPIDFunc)
const Cut kIsFarDet([](const caf::SRProxy *sr){return sr->hdr.det==caf::kFARDET;})
Definition: Cuts.h:94
const Cut kNue2020FDBasicQuality
Definition: NueCuts2020.h:26
const Cut kNue2020CorePresel
Definition: NueCuts2020.h:44
const double kNue2020CVNFHCLowEdge
Definition: NueCuts2020.h:47
const Cut kNue2020ND
Definition: NueCuts2020.h:178
bool kNue2020FDPeripheralFunc_MRBrem(const caf::SRProxy *sr)
Definition: NueCuts2020.cxx:78
const Cut kNue2020CosRej([](const caf::SRProxy *sr){if(kIsRHC(sr)) return kNue2020CosRejRHC(sr);else return kNue2020CosRejFHC(sr);})
Definition: NueCuts2020.h:62
const Cut kNue2020CosRejRHC
Definition: NueCuts2020.h:59
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 double kNue2020CVNFHCHighEdge
Definition: NueCuts2020.h:48
const Cut kNue2020FDAllSamplesLP
Definition: NueCuts2020.h:131
const Cut kNue2020CoreBasicEventCutHE
Definition: NueCuts2020.h:117
const Binning kNue2020Binning
const Cut kNue2020RHCCVNCutLP
Definition: NueCuts2020.h:88
const Cut kNue2020CoreBasicEventCut
Definition: NueCuts2020.h:32
const Cut kNue2020FDBasicQuality_MRBrem
Definition: NueCuts2020.h:139
const Var kLongestProng([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return 0.f;if(sr->vtx.elastic.fuzzyk.npng==0) return 0.f;auto idx=sr->vtx.elastic.fuzzyk.longestidx;return float(sr->vtx.elastic.fuzzyk.png[idx].len);})
Definition: Vars.h:89
const Cut kNue2020NDContain([](const caf::SRProxy *sr){for(unsigned int ix=0;ix< sr->vtx.elastic.fuzzyk.nshwlid;++ix){const caf::SRVector3DProxy &start=sr->vtx.elastic.fuzzyk.png[ix].shwlid.start;const caf::SRVector3DProxy &stop=sr->vtx.elastic.fuzzyk.png[ix].shwlid.stop;if(std::min(start.X(), stop.X())< -150.0) return false;if(std::max(start.X(), stop.X()) > 170.0) return false;if(std::min(start.Y(), stop.Y())< -170.0) return false;if(std::max(start.Y(), stop.Y()) > 150.0) return false;if(std::min(start.Z(), stop.Z())< 100.0) return false;if(std::max(start.Z(), stop.Z()) > 1225.0) return false;}if(sr->sel.contain.nplanestofront< 10) return false;return true;})
Definition: NueCuts2020.h:167
const HistAxis kNue2020AxisMergedPeripheral("NuE Energy / Analysis Bin", kNue2020BinningMergedPeripheral, kNue2020AnaBinMergedPeripheral)
Definition: NueCuts2020.h:200
const Cut kNue2020CVNCutLP([](const caf::SRProxy *sr){if(kIsRHC(sr)) return kNue2020RHCCVNCutLP(sr);else return kNue2020FHCCVNCutLP(sr);})
Definition: NueCuts2020.h:89
const Cut kNue2020NDDecafCut
Definition: NueCuts2020.h:176
const Cut kNue2020NDPresel
Definition: NueCuts2020.h:169
const Var kNHit
Definition: Vars.cxx:71
const Cut kNue2020NDProngLength
Definition: NueCuts2020.h:162
const HistAxis kNue2020Axis("NuE Energy / Analysis Bin", kNue2020Binning, kNue2020AnaBin)
Use this Axis for Ana2020, official Axis.
Definition: NueCuts2020.h:195
const Cut kNue2020CVNVsCosPIDRHCLP
Definition: NueCuts2020.h:101
const Cut kNue2020PeripheralBasicEventCut
Definition: NueCuts2020.h:69
const Cut kNue2020FDPeripheralHE
Use this cut for the sideband FD Peripheral samples, the same for RHC and FHC.
Definition: NueCuts2020.h:106
caf::StandardRecord * sr
const Cut kNue2020FDDecafCut
Definition: NueCuts2020.h:31
const Cut kNue2020FDPeripheral_MRBrem(kNue2020FDPeripheralFunc_MRBrem)
const Cut kNue2020PIDFHC
Definition: NueCuts2020.h:56
const Cut kNue2020FD
Definition: NueCuts2020.h:65
const Cut kNue2020CVN_VsCosPIDRHC
Definition: NueCuts2020.h:74
const Cut kNue2020NDEnergy
Definition: NueCuts2020.h:161
const Cut kNue2020CVNVsCosPIDLP([](const caf::SRProxy *sr){if(kNue2020CVN_VsCosPID(sr)) return false;if(kIsRHC(sr)) return kNue2020CVNVsCosPIDRHCLP(sr);else return kNue2020CVNVsCosPIDFHCLP(sr);})
Definition: NueCuts2020.h:103
const Cut kNue2020RecoQuality([](const caf::SRProxy *sr){if(sr->sel.nuecosrej.hitsperplane >=8) return false;if(!sr->vtx.elastic.IsValid) return false;if(sr->vtx.elastic.fuzzyk.npng==0) return false;return true;})
Definition: NueCuts2020.h:16
const Var kNueEnergy2020([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;if(kIsRHC(sr)) return kNueEnergyRHC2020(sr);else return kNueEnergyFHC2020(sr);})
Nue energy with 3d prong info. only (old version of vars)
Definition: NueEnergy2020.h:38
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 kNue2020FDPeripheralLP
Definition: NueCuts2020.h:107
const Cut kNue2020CorePart
Definition: NueCuts2020.h:41
Collect information describing the x-axis of an analysis histogram.
Definition: HistAxis.h:18
const Cut kNue2020PeripheralBasicEventCutHE
Definition: NueCuts2020.h:96
const Cut kNue2020NDFiducial([](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() > 160.0) return false;if(sr->vtx.elastic.vtx.Y()< -160.0) return false;if(sr->vtx.elastic.vtx.Y() > 100.0) return false;if(sr->vtx.elastic.vtx.Z()< 150.0) return false;if(sr->vtx.elastic.vtx.Z() > 900.0) return false;return true;})
Definition: NueCuts2020.h:166
const Var kNue2020AnaBin([](const caf::SRProxy *sr){int selBin=kNue2020SelectionBin(sr);float nuE=kNueEnergy2020(sr);int nuEBin=nuE/0.5;assert(nuEBin<=8 &&"An event with nuE > 4.5 should never happen");int anaBin=9 *selBin+nuEBin;return anaBin;})
Use this Analysis Binning for Ana2020, official Binning.
Definition: NueCuts2020.h:191
const Cut kNue2020FDLP
Definition: NueCuts2020.h:128
const Cut kNue2020CorePartHE
Definition: NueCuts2020.h:121
const Cut kNue2020FDAllSamples
Definition: NueCuts2020.h:84
const Cut kNue2020CosRejFHC
Definition: NueCuts2020.h:58
const Cut kNue2020FDPeripheral(kNue2020FDPeripheralFunc)
const Var kCVNe_looseptp
Definition: Vars.cxx:36
const Cut kNue2020CorePreselHE
Definition: NueCuts2020.h:124
const Var kCosPIDCoreBDT
2020 nue cosmic rejection BDT variable - core
Definition: NueVars.cxx:112
const Var kCosPIDPeriBDT
2020 nue cosmic rejection BDT variable - peripheral
Definition: NueVars.cxx:113
const Cut kNue2020FDHE
Use this cut for the sideband FD Core selections, apply for both RHC and FHC.
Definition: NueCuts2020.h:127
const Cut kNue2020NDFrontPlanes
const Cut kNue2020PIDRHC
Definition: NueCuts2020.h:57
const Binning kNue2020BinningMergedPeripheral
const Cut kNue2020CVNVsCosPIDFHCLP
Definition: NueCuts2020.h:102