NuebarCCIncVars.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/Var.h"
4 #include "CAFAna/Core/Cut.h"
5 #include "CAFAna/Core/HistAxis.h"
7 
11 
14 
15 namespace nuebarccinc
16 {
17 
18  // some basic kinematic vars
19  // prongs
20  extern const ana::Var kNProngs;
21 
22  // slice hits
23  extern const ana::Var kNHits;
24 
25  // vertex
29 
30  extern const ana::NuTruthVar kTrueVtxXST;
31  extern const ana::NuTruthVar kTrueVtxYST;
32  extern const ana::NuTruthVar kTrueVtxZST;
33 
37 
38  // prong distance from sides
45 
46 
47 
48  int true_electron_png(const caf::SRProxy * sr);
49  ////////////////////////////////////////////////////////////////////
50  //Analysis Variables
51  ////////////////////////////////////////////////////////////////////
52 
53  extern const ana::Var kMuonID;
54  extern const ana::Var kCVNNueID;
55 
56  const ana::Var kRecoNeutrinoE = ana::kNueEnergy2018; //2018 energy estimator
57 
60 
63 
64  //Electron Energy w/ Bias Correction
73 
74  const ana::Var kRecoElectronEVsCos = ana::Var2D(kRecoElectronCosTheta,
76  kElectronE,
77  eelecbins);
78 
79  const ana::Var kRecoElectronEVsCosVsEnu = ana::Var3D(kRecoElectronCosTheta,
80  costhetabins,
81  kElectronE,
82  eelecbins,
83  kRecoNeutrinoE,
84  enubins);
85  extern const ana::Var kRecoQ2;
86  ////////////////////////////////////////////////////////////////////
87  //Prong CVN stuff
88  ////////////////////////////////////////////////////////////////////
93 
94 
95  ////////////////////////////////////////////////////////////////////
96  //MC Truth Variables
97  ////////////////////////////////////////////////////////////////////
98  extern const ana::NuTruthVar kTrueQ2ST;
102 
103  extern const ana::NuTruthVar kTrueNeutrinoEST;
104  extern const ana::NuTruthVar kTrueHadronicYST;
105  const ana::NuTruthVar kTrueHadEST = kTrueNeutrinoEST * kTrueHadronicYST;
106  const ana::NuTruthVar kTrueEMEST = kTrueNeutrinoEST - kTrueHadEST;
107 
109  const ana::Var kTrueElectronE = ana::VarFromNuTruthVar(kTrueElectronEST);
110  const ana::Var kTrueNeutrinoE = ana::VarFromNuTruthVar(kTrueNeutrinoEST);
111  const ana::Var kTrueElectronCosTheta = ana::VarFromNuTruthVar(kTrueElectronCosThetaST);
112  const ana::Var kTrueElectronTheta = ana::VarFromNuTruthVar(kTrueElectronThetaST);
113 
114  const ana::NuTruthVar kTrueElectronEVsCosST = ana::Var2D(kTrueElectronCosThetaST,
115  costhetabins,
116  kTrueElectronEST,
117  eelecbins);
118 
119  const ana::Var kTrueElectronEVsCos = ana::VarFromNuTruthVar(kTrueElectronEVsCosST);
120 
121  const ana::NuTruthVar kTrueElectronEVsCosVsEnuST = ana::Var3D(kTrueElectronCosThetaST,
122  costhetabins,
123  kTrueElectronEST,
124  eelecbins,
125  kTrueNeutrinoEST,
126  enubins);
127 
128 
129  ////////////////////////////////////////////////////////////////////
130  //Resolution Variables
131  ////////////////////////////////////////////////////////////////////
132  const ana::Var kFracResNeutrinoE = ( kRecoNeutrinoE - kTrueNeutrinoE ) / kTrueNeutrinoE;
133  const ana::Var kFracResElectronE = ( kElectronE - kTrueElectronE ) / kTrueElectronE;
134  const ana::Var kFracResElectronCosTheta = ( kRecoElectronCosTheta - kTrueElectronCosTheta ) / kTrueElectronCosTheta;
135  const ana::Var kFracResElectronTheta = ( kRecoElectronTheta - kTrueElectronTheta ) / kTrueElectronTheta;
136 
137  const ana::Var kFracResTrueElectronE = ( kTrueElectronRecoE - kTrueElectronE ) / kTrueElectronE;
138  const ana::Var kFracResTrueElectronCosTheta = ( kTrueElectronRecoCosTheta - kTrueElectronCosTheta ) / kTrueElectronCosTheta;
139  const ana::Var kFracResTrueElectronTheta = ( kTrueElectronRecoTheta - kTrueElectronTheta ) / kTrueElectronTheta;
140 
141  const ana::Var kFracResProngCVNElectronE = ( kProngCVNElectronE - kTrueElectronE ) / kTrueElectronE;
142  const ana::Var kFracResProngCVNElectronCosTheta = ( kProngCVNElectronCosTheta - kTrueElectronCosTheta ) / kTrueElectronCosTheta;
143  const ana::Var kFracResProngCVNElectronTheta = ( kProngCVNElectronTheta - kTrueElectronTheta ) / kTrueElectronTheta;
144 
145  const ana::Var kAbsResNeutrinoE = kRecoNeutrinoE - kTrueNeutrinoE ;
146  const ana::Var kAbsResElectronE = kElectronE - kTrueElectronE ;
147  const ana::Var kAbsResElectronCosTheta = kRecoElectronCosTheta - kTrueElectronCosTheta ;
148  const ana::Var kAbsResElectronTheta = kRecoElectronTheta - kTrueElectronTheta ;
149 
150  const ana::Var kAbsResTrueElectronE = kTrueElectronRecoE - kTrueElectronE ;
151  const ana::Var kAbsResTrueElectronCosTheta = kTrueElectronRecoCosTheta - kTrueElectronCosTheta ;
152  const ana::Var kAbsResTrueElectronTheta = kTrueElectronRecoTheta - kTrueElectronTheta ;
153 
154  const ana::Var kAbsResProngCVNElectronE = kProngCVNElectronE - kTrueElectronE ;
156  const ana::Var kAbsResProngCVNElectronTheta = kProngCVNElectronTheta - kTrueElectronTheta ;
157 
158  ////////////////////////////////////////////////////////////////////
159  //Defining Hist Axis
160  ////////////////////////////////////////////////////////////////////
162  {
165  };
166 
168  {
171  };
172  //Multidimension Hist Axes
173  // electron kinematics 2d
174  const ana::NuTruthHistAxis kTrueElectronEVsCosStandardAxisST("True E_{e} vs cos #theta; Elec_{e} (GeV); cos #{theta}", double_diff_bins, kTrueElectronEVsCosST);
176  const ana::HistAxis kRecoElectronEVsCosStandardAxis("Reconstructed E_{e} vs cos #theta; Elec_{e} (GeV); cos #{theta}", double_diff_bins, kRecoElectronEVsCos);
177 
178  // 3d analysis binning
179  const ana::NuTruthHistAxis kTrueElectronEVsCosVsEnuStandardAxisST("True E_{e} vs cos #{theta} vs Neutrino Energy (GeV)", three_d_bins,kTrueElectronEVsCosVsEnuST);
182  const ana::HistAxis kRecoElectronEVsCosVsEnuStandardAxis("Reco. E_{e} vs cos #{theta} vs Neutrino Energy (GeV)", three_d_bins,kRecoElectronEVsCosVsEnu);
183 
184  // electron energy 1d
185  const ana::NuTruthHistAxis kTrueElectronEStandardAxisST("True E_{e} (GeV)", eelecbins, kTrueElectronEST);
187  const ana::HistAxis kRecoElectronEStandardAxis("Reco E_{e} (GeV)", eelecbins, kElectronE);
188 
189  // electron angle 1d
190  const ana::NuTruthHistAxis kTrueElectronCosThetaStandardAxisST("True cos #theta_{e}", costhetabins, kTrueElectronCosThetaST);
192  const ana::HistAxis kRecoElectronCosThetaStandardAxis("Reco cos #theta_{e}", costhetabins, kRecoElectronCosTheta);
193 
194  // neutrino energy
195  const ana::NuTruthHistAxis kTrueNeutrinoEnergyStandardAxisST("True Neutrino Energy (GeV)", enubins, kTrueNeutrinoEST);
197  const ana::HistAxis kRecoNeutrinoEnergyStandardAxis("Reconstructed Neutrino Energy (GeV)", enubins, kRecoNeutrinoE);
198 
199  // q2
200  const ana::NuTruthHistAxis kTrueQ2StandardAxisST("True Q^{2} (GeV)",
201  q2bins,
202  kTrueQ2ST);
204  const ana::HistAxis kRecoQ2StandardAxis("Reconstructed Q^{2} (GeV)",
205  q2bins,
206  kRecoQ2);
207 } //end of namespace
const ana::Var kAllPngDistBack
const ana::Var kCVNNueID
const ana::Var kAbsResElectronTheta
const ana::Var kAllPngDistBottom
const ana::Var kNHits([](const caf::SRProxy *sr){return sr->slc.nhit;})
const ana::Var kAbsResTrueElectronE
const ana::Binning three_d_bins
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 ana::Var kProngCVNElectronCosTheta([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;int nProngs=sr->vtx.elastic.fuzzyk.npng;float maxProngCVNe=-5.;TVector3 elecdir={0, 0, 0};for(int iProng=0;iProng< nProngs;iProng++){if(sr->vtx.elastic.fuzzyk.png[iProng].cvnpart.electronid > maxProngCVNe){maxProngCVNe=sr->vtx.elastic.fuzzyk.png[iProng].cvnpart.electronid;elecdir=(TVector3) sr->vtx.elastic.fuzzyk.png[iProng].dir;}}if(maxProngCVNe==-5) return-5.f;TVector3 beamdir=ana::NuMIBeamDirection(caf::kNEARDET);return(float) elecdir.Dot(beamdir);})
const ana::Binning eelecbins
const ana::Var kTrueElectronRecoERHCTuned([](const caf::SRProxy *sr) ->float{ double p0=-0.0861793;double p1=0.235812;double p2=-0.0348964;float energy=-1000.f;if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;int true_electron_idx=true_electron_png(sr);if(true_electron_idx< 0) return-5.f;float x=(sr->vtx.elastic.fuzzyk.png[true_electron_idx].shwlid.shwE);if(x< 0) return 0.0f;if(x<=6) energy=x-(p0+x *p1+p2 *pow(x, 2));else energy=x;if(energy< 0) energy=x;return energy;})
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 ana::NuTruthVar kTrueHadEST
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 ana::HistAxis kTrueElectronEStandardAxis
const ana::Var kFracResNeutrinoE
const ana::NuTruthVar kTrueEMEST
const ana::Var kElectronERHCTuned([](const caf::SRProxy *sr) ->float{ double p0=-0.0861793;double p1=0.235812;double p2=-0.0348964;float energy=-1000.f;if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;float x=(sr->vtx.elastic.fuzzyk.png[0].shwlid.shwE);if(x< 0) return 0.0f;if(x<=6) energy=x-(p0+x *p1+p2 *pow(x, 2));else energy=x;if(energy< 0) energy=x;return energy;})
const ana::NuTruthVar kTrueVtxYST
const ana::Var kAllPngDistFront
const ana::Binning costhetabins
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 ana::Var kRecoElectronEVsCosVsEnu
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
_Var< T > Var2D(const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb)
Variable formed from two input variables.
Definition: Var.cxx:247
const ana::NuTruthHistAxis kTrueElectronEVsCosVsEnuStandardAxisST("True E_{e} vs cos #{theta} vs Neutrino Energy (GeV)", three_d_bins, kTrueElectronEVsCosVsEnuST)
const ana::Var kAbsResElectronE
const ana::Var kAbsResProngCVNElectronE
const ana::Var kTrueElectronRecoCosTheta([](const caf::SRProxy *sr) ->float{if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;int true_electron_idx=true_electron_png(sr);if(true_electron_idx< 0) return-5.f;TVector3 elecdir=(TVector3) sr->vtx.elastic.fuzzyk.png[true_electron_idx].dir;TVector3 beamdir=ana::NuMIBeamDirection(caf::kNEARDET);return elecdir.Dot(beamdir);})
const ana::HistAxis kRecoQ2StandardAxis("Reconstructed Q^{2} (GeV)", q2bins, kRecoQ2)
const ana::NuTruthVar kTrueVtxXST
const ana::Var kAbsResTrueElectronTheta
const ana::Var kAbsResElectronCosTheta
const ana::NuTruthHistAxis kTrueElectronEStandardAxisST("True E_{e} (GeV)", eelecbins, kTrueElectronEST)
const Var kVtxX
const ana::HistAxis kTrueElectronEVsCosStandardAxis
const ana::Var kRecoElectronEVsCos
const ana::Var kFracResElectronCosTheta
const ana::HistAxis kRecoElectronCosThetaStandardAxis("Reco cos #theta_{e}", costhetabins, kRecoElectronCosTheta)
_Var< T > Var3D(const _Var< T > &a, const Binning &binsa, const _Var< T > &b, const Binning &binsb, const _Var< T > &c, const Binning &binsc)
This is just like a Var2D, but useful for 3D Spectra.
Definition: Var.cxx:273
const ana::Var kTrueElectronRecoE
const ana::Var kAbsResNeutrinoE
const ana::NuTruthVar kTrueNeutrinoEST
const ana::Var kFracResTrueElectronCosTheta
const ana::HistAxis kTrueElectronEVsCosVsEnuStandardAxis
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 ana::NuTruthVar kTrueHadronicYST
const ana::Var kFracResElectronTheta
const ana::Var kElectronE
const ana::Binning double_diff_bins
const ana::Var kFracResProngCVNElectronTheta
const ana::HistAxis kTrueElectronCosThetaStandardAxis
const ana::Var kTrueElectronCosTheta
const ana::Var kAllPngDistEast
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 ana::Var kAbsResProngCVNElectronCosTheta
const ana::Var kTrueElectronEVsCos
const ana::HistAxis kRecoElectronEVsCosVsEnuStandardAxis("Reco. E_{e} vs cos #{theta} vs Neutrino Energy (GeV)", three_d_bins, kRecoElectronEVsCosVsEnu)
const ana::Var kRecoVtxY
const ana::Var kRecoElectronTheta([](const caf::SRProxy *sr) ->float{if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;TVector3 elecdir=(TVector3) sr->vtx.elastic.fuzzyk.png[0].dir;TVector3 beamdir=ana::NuMIBeamDirection(caf::kNEARDET);float theta=elecdir.Dot(beamdir);return(float) TMath::ACos(theta)*180/TMath::Pi();})
const ana::Var kFracResProngCVNElectronE
const ana::NuTruthHistAxis kTrueNeutrinoEnergyStandardAxisST("True Neutrino Energy (GeV)", enubins, kTrueNeutrinoEST)
caf::StandardRecord * sr
HistAxis HistAxisFromNuTruthHistAxis(NuTruthHistAxis ntha, double _default)
Definition: HistAxis.cxx:9
const ana::NuTruthVar kTrueElectronEVsCosVsEnuST
const ana::Var kFracResTrueElectronTheta
const ana::Var kAllPngDistTop
const ana::Var kTrueElectronTheta
const ana::Var kAbsResProngCVNElectronTheta
const ana::NuTruthHistAxis kTrueElectronCosThetaStandardAxisST("True cos #theta_{e}", costhetabins, kTrueElectronCosThetaST)
const ana::HistAxis kRecoElectronEStandardAxis("Reco E_{e} (GeV)", eelecbins, kElectronE)
ana::NuTruthHistAxis axis
const ana::HistAxis kTrueQ2StandardAxis
const ana::Var kFracResElectronE
const ana::Binning enubins
const ana::Var kTrueElectronRecoEFHCTuned([](const caf::SRProxy *sr) ->float{double p0=-0.10588;double p1=0.57885;double p2=-0.408767;double p3=0.153795;double p4=-0.0270565;double p5=0.00171687;float energy=-1000.f;if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;int true_electron_idx=true_electron_png(sr);if(true_electron_idx< 0) return-5.f;float x=(sr->vtx.elastic.fuzzyk.png[true_electron_idx].shwlid.shwE);if(x< 0) return 0.0f;if(x<=6) energy=x-(p0+x *p1+p2 *pow(x, 2)+p3 *pow(x, 3)+p4 *pow(x, 4)+p5 *pow(x, 5));else energy=x;if(energy< 0) energy=x;return energy;})
Var VarFromNuTruthVar(const NuTruthVar &stv, double _default)
Definition: Var.cxx:7
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 ana::Var kFracResProngCVNElectronCosTheta
const Var kVtxY
const ana::HistAxis kRecoNeutrinoEnergyStandardAxis("Reconstructed Neutrino Energy (GeV)", enubins, kRecoNeutrinoE)
const ana::NuTruthHistAxis kTrueQ2StandardAxisST("True Q^{2} (GeV)", q2bins, kTrueQ2ST)
const ana::Var kTrueVtxY
const ana::Var kTrueVtxX
const ana::Var kProngCVNElectronTheta([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;int nProngs=sr->vtx.elastic.fuzzyk.npng;float maxProngCVNe=-5.;TVector3 elecdir={0, 0, 0};for(int iProng=0;iProng< nProngs;iProng++){if(sr->vtx.elastic.fuzzyk.png[iProng].cvnpart.electronid > maxProngCVNe){maxProngCVNe=sr->vtx.elastic.fuzzyk.png[iProng].cvnpart.electronid;elecdir=(TVector3) sr->vtx.elastic.fuzzyk.png[iProng].dir;}}if(maxProngCVNe==-5) return-5.f;TVector3 beamdir=ana::NuMIBeamDirection(caf::kNEARDET);float theta=elecdir.Dot(beamdir);return(float)(TMath::ACos(theta)*180/TMath::Pi());})
const ana::Var kTrueNeutrinoE
const Var kVtxZ
const ana::Var kElectronEUntuned([](const caf::SRProxy *sr) ->float{if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;float x=(sr->vtx.elastic.fuzzyk.png[0].shwlid.shwE);return x;})
const ana::Var kTrueElectronE
const ana::Var kAllPngDistWest
const ana::NuTruthVar kTrueVtxZST
const ana::Var kRecoVtxZ
const ana::Var kNProngs([](const caf::SRProxy *sr) ->int{if(!sr->vtx.elastic.IsValid) return-5;return sr->vtx.elastic.fuzzyk.npng;})
const ana::Var kProngCVNElectronScore([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;int nProngs=sr->vtx.elastic.fuzzyk.npng;float maxProngCVNe=-5.;for(int iProng=0;iProng< nProngs;iProng++){if(sr->vtx.elastic.fuzzyk.png[iProng].cvnpart.electronid > maxProngCVNe){maxProngCVNe=sr->vtx.elastic.fuzzyk.png[iProng].cvnpart.electronid;}}return maxProngCVNe;})
const ana::Var kTrueElectronRecoEUntuned([](const caf::SRProxy *sr) ->float{if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;int true_electron_idx=true_electron_png(sr);if(true_electron_idx< 0) return-5.f;float x=(sr->vtx.elastic.fuzzyk.png[true_electron_idx].shwlid.shwE);return x;})
const ana::Var kProngCVNElectronE([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;int nProngs=sr->vtx.elastic.fuzzyk.npng;float maxProngCVNe=-5.;float maxProngCVNe_ElecE=-5.;for(int iProng=0;iProng< nProngs;iProng++){if(sr->vtx.elastic.fuzzyk.png[iProng].cvnpart.electronid > maxProngCVNe){maxProngCVNe=sr->vtx.elastic.fuzzyk.png[iProng].cvnpart.electronid;maxProngCVNe_ElecE=sr->vtx.elastic.fuzzyk.png[iProng].calE;}}return maxProngCVNe_ElecE;})
int true_electron_png(const caf::SRProxy *sr)
const ana::Var kTrueVtxZ
const ana::Var kElectronEFHCTuned([](const caf::SRProxy *sr) ->float{double p0=-0.10588;double p1=0.57885;double p2=-0.408767;double p3=0.153795;double p4=-0.0270565;double p5=0.00171687;float energy=-1000.f;if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;float x=(sr->vtx.elastic.fuzzyk.png[0].shwlid.shwE);if(x< 0) return 0.0f;if(x<=6) energy=x-(p0+x *p1+p2 *pow(x, 2)+p3 *pow(x, 3)+p4 *pow(x, 4)+p5 *pow(x, 5));else energy=x;if(energy< 0) energy=x;return energy;})
const ana::Var kAbsResTrueElectronCosTheta
const ana::Binning q2bins
const ana::HistAxis kTrueNeutrinoEnergyStandardAxis
const ana::NuTruthVar kTrueElectronThetaST([](const caf::SRNeutrinoProxy *nu){if(abs(nu->pdg)!=12|| !nu->iscc) return-5.0;int nprims=nu->prim.size();for(int iprim=0;iprim< nprims;iprim++){if(abs(nu->prim[iprim].pdg)==11){TVector3 edir=nu->prim[iprim].p.Vect();TVector3 beamdir=ana::NuMIBeamDirection(caf::kNEARDET);float theta=edir.Unit().Dot(beamdir.Unit());return(float) TMath::ACos(theta)*180/TMath::Pi();}}return-5.0;})
const ana::Var kMuonID
const ana::Var kRecoVtxX
const ana::NuTruthVar kTrueQ2ST
const ana::HistAxis kRecoElectronEVsCosStandardAxis("Reconstructed E_{e} vs cos #theta; Elec_{e} (GeV); cos #{theta}", double_diff_bins, kRecoElectronEVsCos)
const ana::Var kRecoNeutrinoE
const ana::NuTruthHistAxis kTrueElectronEVsCosStandardAxisST("True E_{e} vs cos #theta; Elec_{e} (GeV); cos #{theta}", double_diff_bins, kTrueElectronEVsCosST)
const ana::Var kTrueElectronRecoTheta([](const caf::SRProxy *sr) ->float{if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;int true_electron_idx=true_electron_png(sr);if(true_electron_idx< 0) return-5.f;TVector3 elecdir=(TVector3) sr->vtx.elastic.fuzzyk.png[true_electron_idx].dir;TVector3 beamdir=ana::NuMIBeamDirection(caf::kNEARDET);float theta=elecdir.Dot(beamdir);return(float) TMath::ACos(theta)*180/TMath::Pi();})
const ana::Var kRecoElectronCosTheta([](const caf::SRProxy *sr) ->float{if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;TVector3 elecdir=(TVector3) sr->vtx.elastic.fuzzyk.png[0].dir;TVector3 beamdir=ana::NuMIBeamDirection(caf::kNEARDET);return elecdir.Dot(beamdir);})
const ana::NuTruthVar kTrueElectronEVsCosST
const ana::Var kTrueQ2
const ana::Var kRecoQ2([](const caf::SRProxy *sr){const double M_e_sqrd=std::pow(0.000511, 2);double E_e=kElectronE(sr);double E_nu=kRecoNeutrinoE(sr);double cos_e=kRecoElectronCosTheta(sr);double p_e=std::sqrt(std::pow(E_e, 2)-M_e_sqrd);return 2 *E_nu *(E_e-p_e *cos_e)-M_e_sqrd;})
const ana::NuTruthVar kTrueElectronCosThetaST([](const caf::SRNeutrinoProxy *nu){int nprims=nu->prim.size();for(int iprim=0;iprim< nprims;iprim++){if(abs(nu->prim[iprim].pdg)==11){TVector3 edir=nu->prim[iprim].p.Vect();TVector3 beamdir=ana::NuMIBeamDirection(caf::kNEARDET);return edir.Unit().Dot(beamdir.Unit());}}return-5.0;})
const ana::Var kFracResTrueElectronE
enum BeamMode string
const ana::NuTruthVar kTrueElectronEST([](const caf::SRNeutrinoProxy *nu){float ee=-5;int nprims=nu->prim.size();for(int iprim=0;iprim< nprims;iprim++){if(abs(nu->prim[iprim].pdg)==11){double E=nu->prim[iprim].p.E;ee=E;}}return ee;})