NueCuts2018.cxx
Go to the documentation of this file.
2 
4 
5 #include <cassert>
6 
7 namespace ana
8 {
9  const Cut kNue2018CVNCut([](const caf::SRProxy* sr) {
10  if(kIsRHC(sr)) return kNue2018RHCCVNCut(sr);
11  else return kNue2018FHCCVNCut(sr);
12  });
13 
14  const Cut kNearestSliceCosRej2018([](const caf::SRProxy* sr) {
15  const double hibin = kIsRHC(sr) ? kNue2018CVNRHCHighEdge : kNue2018CVNFHCHighEdge;
16 
17  const double topcut = (kCVNSSe(sr) >= hibin) ? 50 : 400;
18 
19  return (fabs(sr->slc.closestslicetime) >= 100 ||
20  sr->slc.closestsliceminfromtop >= topcut ||
21  sr->slc.closestslicemindist >= 500);
22  });
23 
25  {
26  return (kNue2017BasicPart(sr) &&
27  !kNue2018CorePart(sr) &&
28  kNueEnergy2018(sr) < 4.5 &&
29  kNueEnergy2018(sr) >= 0 &&
30  kIsFarDet(sr));
31  }
32 
34  {
35  if(kIsRHC(sr)) return kNue2018CVNVsCosPIDRHC(sr);
36 
37  else return kNue2018CVNVsCosPIDFHC(sr);
38  }
39 
41  {
43  }
44 
45  const Cut kNue2018CVNCutLP([](const caf::SRProxy* sr) {
46  if(kIsRHC(sr)) return kNue2018RHCCVNCutLP(sr);
47  else return kNue2018FHCCVNCutLP(sr);
48  });
49 
50  const Cut kNue2018CVNVsCosPIDLP([](const caf::SRProxy* sr){
51 
52  if(kNue2018CVNVsCosPID(sr)) return false;
53 
54  if(kIsRHC(sr)) return kNue2018CVNVsCosPIDRHCLP(sr);
55 
56  else return kNue2018CVNVsCosPIDFHCLP(sr);
57 
58  });
59 
60  const Var kNue2018SelectionBin([](const caf::SRProxy *sr){
61  bool isPeri = kNue2018FDPeripheral(sr);
62 
63  if (isPeri)
64  return float(2.5);
65 
66  std::cout << "ERROR::kNue2018SelectionBin. Looking for cvnProd3Train. Branch no longer exists." << std::endl;
67  abort();
68  /*
69  const double lowedge = kIsRHC(sr) ? kNue2018CVNRHCLowEdge : kNue2018CVNFHCLowEdge;
70  const double highedge = kIsRHC(sr) ? kNue2018CVNRHCHighEdge : kNue2018CVNFHCHighEdge;
71  if (sr->sel.cvnProd3Train.nueid >= lowedge && sr->sel.cvnProd3Train.nueid < highedge)
72  return float(0.5);
73  else if (sr->sel.cvnProd3Train.nueid >= highedge)
74  return float(1.5);
75  else return float(-5.0);
76  */
77  return float(-5.0);
78  });
79 
80  const Var kNue2018AnaBin([](const caf::SRProxy *sr){
81  int selBin = kNue2018SelectionBin(sr);
82  float nuE = kNueEnergy2018(sr);
83  int nuEBin = nuE/0.5;
84 
85  assert(nuEBin <= 8 && "An event with nuE > 4.5 should never happen");
86 
87  int anaBin = 9*selBin + nuEBin;
88 
89  return anaBin;
90  });
91 
92  const Binning kNue2018Binning = Binning::Simple(27,0,27);
93 
94  const Var kNue2018AnaBinMergedPeripheral([](const caf::SRProxy *sr){
95  int anaBin = kNue2018AnaBin(sr);
96  anaBin = anaBin > 18 ? 20 : anaBin;
97  return anaBin;
98  });
99 
100  const Binning kNue2018BinningMergedPeripheral = Binning::Simple(23,0,23);
101 
102  const HistAxis kNue2018AxisMergedPeripheral("NuE Energy / Analysis Bin",
103  kNue2018BinningMergedPeripheral,
104  kNue2018AnaBinMergedPeripheral);
105 
106  const Var kNue2018AnaResBin([](const caf::SRProxy *sr){
107  int selBin = kNue2018SelectionBin(sr);
108  float nuERes = (kNueEnergy2018(sr) - kTrueE(sr))/kTrueE(sr);
109  int nuEBin = (nuERes + 1)*9 ;//double binning for resolution
110  int anaBin = 18*selBin + nuEBin;
111  return anaBin;
112  });
113 
114  const HistAxis kNue2018ResAxis("NuE Energy Resolution / Analysis Bin",
115  Binning::Simple(54, 0, 54), kNue2018AnaResBin);
116 
117 
118  const Var kNue2018AnaSuperBin([](const caf::SRProxy *sr){
119  int isPeri = 0;
120  if(kNue2018FDPeripheral(sr)) isPeri = 1 ;
121 
122  std::cout << "ERROR::kNue2018SelectionBin. Looking for cvnProd3Train. Branch no longer exists." << std::endl;
123  abort();
124  //double cvn = sr->sel.cvnProd3Train.nueid;
125  double cvn=-1;
126 
127  const double cvnlow = kIsRHC(sr) ? kNue2018CVNRHCLowEdge : kNue2018CVNFHCLowEdge;
128  const double cvnhigh = kIsRHC(sr) ? kNue2018CVNRHCHighEdge : kNue2018CVNFHCHighEdge;
129 
130  assert(cvn >= cvnlow && cvn<=1 && "Wrong cvn value");
131 
132  float nuE = kNueEnergy2018(sr);
133  int nuEBin = nuE/0.5;
134 
135 // assert(nuEBin <= 8 && "An event with nuE > 4.5 should never happen");
136 
137  int cvnbin =(int)(cvn/cvnhigh);// cvn binning always do [) same for energy bin
138 
139  cvnbin += isPeri;//peripheral shifted from highest to the last bin
140 
141  int anaBin = 9*cvnbin + nuEBin;
142  return anaBin;
143  });
144 
145  const Binning kNue2018SuperBinning = Binning::Simple(27,0,27);
146 
147  const HistAxis kNue2018SuperAxis("NuE Energy / Analysis Bin",
148  kNue2018SuperBinning,kNue2018AnaSuperBin);
149 
150  const Var kNue2018AnaSuperBinMergedPeripheral([](const caf::SRProxy *sr){
151  int anaBin = kNue2018AnaSuperBin(sr);
152  anaBin = anaBin > 18 ? 20: anaBin;
153  return anaBin;
154  });
155 
156  const Binning kNue2018SuperBinningMergedPeripheral = Binning::Simple(23,0,23);
157 
158  const HistAxis kNue2018SuperAxisMergedPeripheral("NuE Energy / Analysis Bin",
159  kNue2018SuperBinningMergedPeripheral,
160  kNue2018AnaSuperBinMergedPeripheral);
161 }
const Cut kNue2018CVNVsCosPIDFHCLP
Definition: NueCuts2018.h:102
const Cut kNue2018RHCCVNCutLP
Definition: NueCuts2018.h:84
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kNue2018RHCCVNCut
Definition: NueCuts2018.h:47
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
const double kNue2018CVNFHCHighEdge
Definition: NueCuts2018.h:41
const Cut kNue2018CVNVsCosPIDRHC
Definition: NueCuts2018.h:64
const Cut kNue2018PeripheralPresel(kNue2018PeripheralPreselFunc)
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2108
const Cut kNue2017BasicPart(kNue2017BasicPartFunc)
const Cut kNue2018CVNVsCosPIDRHCLP
Definition: NueCuts2018.h:100
const Cut kIsFarDet([](const caf::SRProxy *sr){return sr->hdr.det==caf::kFARDET;})
Definition: Cuts.h:94
Defines an enumeration for prong classification.
const Cut kNue2018CVNCut([](const caf::SRProxy *sr){if(kIsRHC(sr)) return kNue2018RHCCVNCut(sr);else return kNue2018FHCCVNCut(sr);})
Definition: NueCuts2018.h:49
const Cut kNue2018FHCCVNCutLP
Definition: NueCuts2018.h:83
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
caf::Proxy< float > closestslicetime
Definition: SRProxy.h:1281
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 XML_Char int const XML_Char * value
Definition: expat.h:331
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 Var kNue2018SelectionBin([](const caf::SRProxy *sr){bool isPeri=kNue2018FDPeripheral(sr);double cvn=sr->sel.cvnProd3Train.nueid;if(isPeri) return float(3.5);if(cvn > 0.75 &&cvn< 0.87) return float(0.5);if(cvn > 0.87 &&cvn< 0.95) return float(1.5);if(cvn > 0.95) return float(2.5);return float(-0.5);})
const Cut Energy
const Cut kNue2018CVNVsCosPIDFHC
Definition: NueCuts2018.h:66
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
Definition: Cut.h:96
caf::StandardRecord * sr
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
caf::Proxy< float > closestsliceminfromtop
Definition: SRProxy.h:1278
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)
OStream cout
Definition: OStream.cxx:6
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 kIsRHC([](const caf::SRProxy *sr){return sr->spill.isRHC;})
Definition: Vars.h:16
bool kNue2018CVNVsCosPIDFunc(const caf::SRProxy *sr)
Definition: NueCuts2018.cxx:33
bool kNue2018PeripheralPreselFunc(const caf::SRProxy *sr)
Definition: NueCuts2018.cxx:24
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2124
caf::Proxy< float > closestslicemindist
Definition: SRProxy.h:1273
assert(nhit_max >=nhit_nbins)
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 kNue2018CorePart
Definition: NueCuts2018.h:29
bool kNue2018FDPeripheralFunc(const caf::SRProxy *sr)
Use this cut for the full FD Peripheral sample, the same for RHC and FHC.
Definition: NueCuts2018.cxx:40
const Cut kNue2018FHCCVNCut
Definition: NueCuts2018.h:46