NueCuts2018.h
Go to the documentation of this file.
1 #pragma once
2 
4 
6 
8 
9 namespace ana
10 {
11 
12  /// Cut for the CVN final state proton score (might be updated in future...)
14 
15 //*************************************************************
16 //*************************** FD ****************************
17 //*************************************************************
18 
19  //see technote docdb ?
20  // NB: the difference between 2017 and 2018:
21  // new kNueEnergy2018, new peripheral for RHC, new CVN variable
22 
24  kNHit > 30 && kNHit < 150 &&
25  kLongestProng > 100 && kLongestProng < 500;
26 
27  /// Cuts which define the "core" sample and are reversed for the "peripheral"
28  /// sample.
30  kNue2018Presel &&
34 
35  /// Full preselection for 2018 "core" sample with Cut-based CosRej
36  /// kNue2017BasicPart is unchanged
38 
39  // CVN FHC boundaries
40  const double kNue2018CVNFHCLowEdge = 0.84;
41  const double kNue2018CVNFHCHighEdge = 0.96;
42  // CVN RHC boundaries
43  const double kNue2018CVNRHCLowEdge = 0.89;
44  const double kNue2018CVNRHCHighEdge = 0.98;
45  // New CVN :
48 
49  extern const Cut kNue2018CVNCut;
50 
52 
53  /// Use this cut for the full FD Core selection, apply for both RHC and FHC
54  const Cut kNue2018FD = kNue2018CorePresel && kNue2018CVNCut && kNearestSliceCosRej2018;
55 
56 //*********************** Peripheral ***********************
57 
60 
61  // I want to make it smart enough and the same for RHC and FHC:
62  // we need a bit tougher cut for RHC and the same as in 2017 cut for FHC
63 
64  const Cut kNue2018CVNVsCosPIDRHC = kCVNSSe >= kNue2018CVNRHCHighEdge && kCosPIDContain>0.57;
65 
66  const Cut kNue2018CVNVsCosPIDFHC = (kCVNSSe >= kNue2018CVNFHCHighEdge && kCosPIDContain>0.53) || kCVNSSe>=0.99;
67 
70 
71  /// Use this cut for the full FD Peripheral sample, the same for RHC and FHC
74  //const Cut kNue2018FDPeripheral = kNue2018PeripheralPresel && kNue2018CVNVsCosPID && kNearestSliceCosRej2018;
75 
76  // Full FD selection/
78 
79 
80 
81 
82  // --------------------- FD Sidebands --------------------- //
85 
86  extern const Cut kNue2018CVNCutLP;
87 
88  ///////////////////////////////////////////////////////////////////////////
89  //
90  // --------------------- FD Peripheral Sidebands --------------------- //
91  //
92  ///////////////////////////////////////////////////////////////////////////
95  !kNue2018CorePart &&
96  kNueEnergy2018 > 4.5 &&
97  kNueEnergy2018 < 10 &&
98  kIsFarDet;
99 
101 
103 
105 
106  /// Use this cut for the sideband FD Peripheral samples, the same for RHC and FHC
107  const Cut kNue2018FDPeripheralHE = kNue2018PeripheralPreselHE && kNue2018CVNVsCosPID && kNearestSliceCosRej2018;
109 
110 
111  ///////////////////////////////////////////////////////////////////////////
112  //
113  // --------------------- FD Full Sidebands --------------------- //
114  //
115  ///////////////////////////////////////////////////////////////////////////
116 
117  //------------------- Preselection Cut -------------------
119  kNueEnergy2018 > 4.5 &&
120  kNHit > 30 &&
121  kLongestProng > 100 && kLongestProng < 500;
122 
124  kNue2018PreselHE &&
128 
130 
131 
132  /// Use this cut for the sideband FD Core selections, apply for both RHC and FHC
133  const Cut kNue2018FDHE = kNue2018CorePreselHE && kNue2018CVNCut && kNearestSliceCosRej2018;
134  const Cut kNue2018FDLP = kNue2018CorePresel && kNue2018CVNCutLP && kNearestSliceCosRej2018;
135 
138 
139 //*************************************************************
140 //************************** ND *****************************
141 //*************************************************************
142 
144 
149  kNue2017NDNHits &&
150  kNue2018NDEnergy &&
152 
153  const Cut kNue2018NDCVNSsb = kNue2018NDPresel && kNue2018CVNCut;
154 
159 
160 //*************************************************************
161 //************** Energy/CVN Binning for 2018 ****************
162 //*************************************************************
163 
164 //will be updated once we have our cvn tuning finalized
165 //TODO: looks weird for ND test... should be ok for ND/FD binning
166 
167  // 2bin layout for 2018, ana2017 style (the third bin is for peripheral sample)
168  extern const Var kNue2018SelectionBin;
169 
170  /// Use this Analysis Binning for Ana2018, official Binning
171  extern const Var kNue2018AnaBin;
172  extern const Binning kNue2018Binning;
173 
174  /// Use this Axis for Ana2018, official Axis
175  const HistAxis kNue2018Axis("NuE Energy / Analysis Bin",
176  kNue2018Binning,kNue2018AnaBin);
177 
179 
182 
183 
184 //*************************** Ana2018 Official Cuts End Line *****************************************
185  // For debugging, please DONT use it
186  extern const Var kNue2018AnaResBin;
187 
188  extern const HistAxis kNue2018ResAxis;
189 
190  // For developing/testing purpose, please DONT use it if you dont know what it is
191  extern const Var kNue2018AnaSuperBin;
192 
193  extern const Binning kNue2018SuperBinning;
194 
196 
198 
200 
202 }
const Cut kNue2018CVNVsCosPIDFHCLP
Definition: NueCuts2018.h:102
const Cut kNue2018FDPeripheralHE
Use this cut for the sideband FD Peripheral samples, the same for RHC and FHC.
Definition: NueCuts2018.h:107
const Cut kNue2018RHCCVNCutLP
Definition: NueCuts2018.h:84
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 Binning kNue2018BinningMergedPeripheral
const Cut kNue2018RHCCVNCut
Definition: NueCuts2018.h:47
const double kNue2018CVNFHCHighEdge
Definition: NueCuts2018.h:41
const Cut kNue2018CVNVsCosPIDRHC
Definition: NueCuts2018.h:64
const Cut kNue2018PeripheralPresel(kNue2018PeripheralPreselFunc)
const Cut kNue2018FDHE
Use this cut for the sideband FD Core selections, apply for both RHC and FHC.
Definition: NueCuts2018.h:133
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
const Cut kNue2017BasicPart(kNue2017BasicPartFunc)
const Var kCosPIDContain
Definition: NueVars.cxx:110
const Cut kNue2018NDCVNSsb
Definition: NueCuts2018.h:153
const Cut kNueDQ2017CVN([](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: NueCuts2017.h:28
const Cut kNue2018CVNVsCosPIDRHCLP
Definition: NueCuts2018.h:100
const Cut kNue2018FDPeripheralLP
Definition: NueCuts2018.h:108
const Cut kNue2017ProngContainment
FD containment cuts, inherited from Second Analysis.
Definition: NueCuts2017.h:79
const Cut kNue2018NDEnergy
Definition: NueCuts2018.h:143
const Cut kIsFarDet([](const caf::SRProxy *sr){return sr->hdr.det==caf::kFARDET;})
Definition: Cuts.h:94
const Cut kNue2018CVNCut([](const caf::SRProxy *sr){if(kIsRHC(sr)) return kNue2018RHCCVNCut(sr);else return kNue2018FHCCVNCut(sr);})
Definition: NueCuts2018.h:49
const Cut kNue2017NDProngLength
Definition: NueCuts2017.h:277
const Cut kNue2018NDPresel
Definition: NueCuts2018.h:145
const Cut kNue2018FHCCVNCutLP
Definition: NueCuts2018.h:83
const HistAxis kNue2018ResAxis("NuE Energy Resolution / Analysis Bin", Binning::Simple(54, 0, 54), kNue2018AnaResBin)
Definition: NueCuts2018.h:188
const Var kNue2018AnaBin([](const caf::SRProxy *sr){int selBin=kNue2018SelectionBin(sr);float nuE=kNueEnergy2018(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 Ana2018, official Binning.
Definition: NueCuts2018.h:171
const Cut kNue2018CVNVsCosPIDLP([](const caf::SRProxy *sr){if(kNue2018CVNVsCosPID(sr)) return false;if(kIsRHC(sr)) return kNue2018CVNVsCosPIDRHCLP(sr);else return kNue2018CVNVsCosPIDFHCLP(sr);})
Definition: NueCuts2018.h:104
const double kNue2018CVNRHCLowEdge
Definition: NueCuts2018.h:43
const Cut kNue2018Presel
Definition: NueCuts2018.h:23
const Cut kNue2017NDNHits
Definition: NueCuts2017.h:265
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 kNueND2018DecafCut
Definition: NueCuts2018.h:155
const Var kNueEnergy2018([](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 kNueEnergyRHC(sr);else return kNueEnergyFHC(sr);})
Definition: NueEnergy2018.h:25
const HistAxis kNue2018SuperAxisMergedPeripheral("NuE Energy / Analysis Bin", kNue2018SuperBinningMergedPeripheral, kNue2018AnaSuperBinMergedPeripheral)
Definition: NueCuts2018.h:201
const Var kNHit
Definition: Vars.cxx:71
const Binning kNue2018SuperBinningMergedPeripheral
const Cut kNue2018CorePartHE
Definition: NueCuts2018.h:123
const Cut kNue2018CVNVsCosPIDFHC
Definition: NueCuts2018.h:66
const Cut kNue2018PreselHE
Definition: NueCuts2018.h:118
const HistAxis kNue2018AxisMergedPeripheral("NuE Energy / Analysis Bin", kNue2018BinningMergedPeripheral, kNue2018AnaBinMergedPeripheral)
Definition: NueCuts2018.h:181
caf::StandardRecord * sr
const Cut kNue2017NDFrontPlanes
No hits in the first 5 planes of the detector, doc 12879.
const Var kNue2018SelectionBin([](const caf::SRProxy *sr){bool isPeri=kNue2018FDPeripheral(sr);if(isPeri) return float(2.5);std::cout<< "ERROR::kNue2018SelectionBin. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort();return float(-5.0);})
Definition: NueCuts2018.h:168
const Binning kNue2018Binning
Definition: NueCuts2018.cxx:93
const Cut kNue2018FD
Use this cut for the full FD Core selection, apply for both RHC and FHC.
Definition: NueCuts2018.h:54
const Cut kNue2018CorePresel
Definition: NueCuts2018.h:37
const Var kCVNFSProtonScore2018([](const caf::SRProxy *sr){return CVNFinalStateScore2018(sr, 2212);})
Proton score from CVN Final State labels, using Prod3Train CVN.
const Var kNue2018AnaResBin([](const caf::SRProxy *sr){int selBin=kNue2018SelectionBin(sr);float nuERes=(kNueEnergy2018(sr)-kTrueE(sr))/kTrueE(sr);int nuEBin=(nuERes+1)*9;int anaBin=18 *selBin+nuEBin;return anaBin;})
Definition: NueCuts2018.h:186
const Var kCVNSSe([](const caf::SRProxy *sr){throw std::runtime_error("kCVNSSe is no longer available. Fix your macro so you don't use it.");return-5.;})
2018 nue PID
Definition: Vars.h:52
const Cut kNue2018FDPeripheral(kNue2018FDPeripheralFunc)
const Var kNue2018AnaSuperBin([](const caf::SRProxy *sr){int isPeri=0;if(kNue2018FDPeripheral(sr)) isPeri=1;std::cout<< "ERROR::kNue2018SelectionBin. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort();double cvn=-1;const double cvnlow=kIsRHC(sr)?kNue2018CVNRHCLowEdge:kNue2018CVNFHCLowEdge;const double cvnhigh=kIsRHC(sr)?kNue2018CVNRHCHighEdge:kNue2018CVNFHCHighEdge;assert(cvn >=cvnlow &&cvn<=1 &&"Wrong cvn value");float nuE=kNueEnergy2018(sr);int nuEBin=nuE/0.5;int cvnbin=(int)(cvn/cvnhigh);cvnbin+=isPeri;int anaBin=9 *cvnbin+nuEBin;return anaBin;})
Definition: NueCuts2018.h:191
const Cut kNue2018CVNCutLP([](const caf::SRProxy *sr){if(kIsRHC(sr)) return kNue2018RHCCVNCutLP(sr);else return kNue2018FHCCVNCutLP(sr);})
Definition: NueCuts2018.h:86
const Cut kNue2018CVNVsCosPID(kNue2018CVNVsCosPIDFunc)
const Cut kNue2017BackwardCut
FD backward cosmic photon rejection cut, inherited from Second Analysis.
Definition: NueCuts2017.h:88
bool kNue2018CVNVsCosPIDFunc(const caf::SRProxy *sr)
Definition: NueCuts2018.cxx:34
bool kNue2018PeripheralPreselFunc(const caf::SRProxy *sr)
Definition: NueCuts2018.cxx:25
const Var kNue2018AnaSuperBinMergedPeripheral([](const caf::SRProxy *sr){int anaBin=kNue2018AnaSuperBin(sr);anaBin=anaBin > 18?20:anaBin;return anaBin;})
Definition: NueCuts2018.h:197
const Cut kCVNFSProtonCut2018
Cut for the CVN final state proton score (might be updated in future...)
Definition: NueCuts2018.h:13
const Cut kNue2018FDLP
Definition: NueCuts2018.h:134
const Cut kNue2017NDContain([](const caf::SRProxy *sr){for(unsigned int ix=0;ix< sr->vtx.elastic.fuzzyk.nshwlid;++ix){TVector3 start=sr->vtx.elastic.fuzzyk.png[ix].shwlid.start;TVector3 stop=sr->vtx.elastic.fuzzyk.png[ix].shwlid.stop;if(std::min(start.X(), stop.X())< -170.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()) > 170.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;}return true;})
Loose containtment on start and end of all showers, docdb-12943.
Definition: NueCuts2017.h:259
const HistAxis kNue2018SuperAxis("NuE Energy / Analysis Bin", kNue2018SuperBinning, kNue2018AnaSuperBin)
Definition: NueCuts2018.h:195
const Cut kNue2018FDAllSamples
Definition: NueCuts2018.h:77
const double kNue2018CVNRHCHighEdge
Definition: NueCuts2018.h:44
const Cut kNearestSliceCosRej2018([](const caf::SRProxy *sr){const double hibin=kIsRHC(sr)?kNue2018CVNRHCHighEdge:kNue2018CVNFHCHighEdge;const double topcut=(kCVNSSe(sr) >=hibin)?50:400;return(fabs(sr->slc.closestslicetime) >=100|| sr->slc.closestsliceminfromtop >=topcut|| sr->slc.closestslicemindist >=500);})
Definition: NueCuts2018.h:51
const Cut kNue2018FDAllSamplesLP
Definition: NueCuts2018.h:137
const Cut kNue2018CorePart
Definition: NueCuts2018.h:29
const Cut kNue2018CorePreselHE
Definition: NueCuts2018.h:129
bool kNue2018FDPeripheralFunc(const caf::SRProxy *sr)
Use this cut for the full FD Peripheral sample, the same for RHC and FHC.
Definition: NueCuts2018.cxx:41
const Cut kNue2017PtPCutCVN
Definition: NueCuts2017.h:72
const Var kNue2018AnaBinMergedPeripheral([](const caf::SRProxy *sr){int anaBin=kNue2018AnaBin(sr);anaBin=anaBin > 18?20:anaBin;return anaBin;})
Definition: NueCuts2018.h:178
const HistAxis kNue2018Axis("NuE Energy / Analysis Bin", kNue2018Binning, kNue2018AnaBin)
Use this Axis for Ana2018, official Axis.
const Cut kNue2018FHCCVNCut
Definition: NueCuts2018.h:46
const double kNue2018CVNFHCLowEdge
Definition: NueCuts2018.h:40
const Binning kNue2018SuperBinning
const Cut kNue2018PeripheralPreselHE
Definition: NueCuts2018.h:93
const Cut kNue2018FDAllSamplesHE
Definition: NueCuts2018.h:136
const Cut kNue2017NDFiducial([](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;})
Cut on ND vertex position.
Definition: NueCuts2017.h:256