NueEnergy2020.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/Var.h"
4 
5 namespace ana
6 {
7  double NueRecoE_2020RHCFit_2D3D(double rawEM, double rawHA);
8  double NueRecoE_2020RHCFit(double rawEM, double rawHA);
9 
10  double NueRecoE_2020FHCFit_2D3D(double rawEM, double rawHA);
11  double NueRecoE_2020FHCFit(double rawEM, double rawHA);
12 
13  // with 3d prong cvn only, old still, without calib correction
14  extern const Var kEME_2020;
15  extern const Var kHADE_2020;
16 
17  // with 3d prong cvn and 2d prong cvn
18  extern const Var kEME2020_2D3D;
19  extern const Var kHADE2020_2D3D;
20 
21  // with 3d prong cvn and 2d prong cvn
23  // with 3d prong cvn only, eme and hade are the same as 2018's definitions,
24  // kFHCEME, kFHCHADE, dont be surprised:)
25  extern const Var kNueEnergyFHC2020;
26 
27  // for RHC test when you see sth weird after presels(dataset spill info issue etc.)
28  // for RHC study when you running out of stats in training sample,
29  // dont use this unless you sure this is what you want...
31  // with 3d prong cvn only, eme and hade are the same as 2018's definitions,
32  // kFHCEME, kFHCHADE, yes, same with fhc defs now :)
33  extern const Var kNueEnergyRHC2020;
34 
35  // Nue energy estimator with new vars(3d+2d prongs)
36  extern const Var kNueEnergy2020_2D3D;
37  // Nue energy estimator with old vars(3d prong only)
38  extern const Var kNueEnergy2020;
39 
40  // Reconstructed nue electron energy Ee from estimator tuned for 2020
41  extern const Var kNueElectronE2020;
42  // Reconstructed nue electron transverse momentum Pt using kNueElectronE2020
43  extern const Var kNueElectronPt2020;
44 
45 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kNueEnergyRHC2020([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;return NueRecoE_2020RHCFit(kEME_2020(sr), kHADE_2020(sr));})
Definition: NueEnergy2020.h:33
const Var kNueEnergy2020_2D3D([](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_2D3D(sr);else return kNueEnergyFHC2020_2D3D(sr);})
Nue energy with 3d prong and 2d prong info. (new version of vars)
Definition: NueEnergy2020.h:36
const Var kEME2020_2D3D([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;const caf::SRFuzzyKProngProxy &prim_png=sr->vtx.elastic.fuzzyk.png[0];double CVNem_CalE=0.0;for(const caf::SRFuzzyKProngProxy &png:sr->vtx.elastic.fuzzyk.png){double png_CalE=png.shwlid.calE;double emPID=((double) png.cvnpart.photonid+(double) png.cvnpart.electronid);if(emPID<=0) continue;if(emPID >=0.5 ) CVNem_CalE+=png_CalE;}for(const caf::SRProngProxy &png:sr->vtx.elastic.fuzzyk.png2d){double png_CalE=png.calE;double emPID=((double) png.cvnpart.photonid+(double) png.cvnpart.electronid);if(emPID<=0) continue;if(emPID >=0.7 ) CVNem_CalE+=png_CalE;}if(CVNem_CalE<=0||kLongestProng(sr) >=500) CVNem_CalE=prim_png.shwlid.calE;return CVNem_CalE;})
Definition: NueEnergy2020.h:18
double NueRecoE_2020RHCFit_2D3D(double rawEM, double rawHA)
double NueRecoE_2020FHCFit(double rawEM, double rawHA)
const Var kHADE2020_2D3D([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;double CVNhad_CalE=0.0;double em=0.0;for(const caf::SRFuzzyKProngProxy &png:sr->vtx.elastic.fuzzyk.png){double png_CalE=png.shwlid.calE;double emPID=((double) png.cvnpart.photonid+(double) png.cvnpart.electronid);if(emPID< 0.5 ) CVNhad_CalE+=png_CalE;else em+=png_CalE;}for(const caf::SRProngProxy &png:sr->vtx.elastic.fuzzyk.png2d){double png_CalE=png.calE;double emPID=((double) png.cvnpart.photonid+(double) png.cvnpart.electronid);if(emPID< 0.7 ) CVNhad_CalE+=png_CalE;else em+=png_CalE;}CVNhad_CalE+=sr->vtx.elastic.fuzzyk.orphCalE;if(em<=0||kLongestProng(sr) >=500) CVNhad_CalE-=sr->vtx.elastic.fuzzyk.png[0].shwlid.calE;if(CVNhad_CalE< 0) abort();return CVNhad_CalE;})
Definition: NueEnergy2020.h:19
const Var kNueEnergyRHC2020_2D3D([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;return NueRecoE_2020RHCFit_2D3D(kEME2020_2D3D(sr), kHADE2020_2D3D(sr));})
Definition: NueEnergy2020.h:30
double NueRecoE_2020RHCFit(double rawEM, double rawHA)
const Var kNueElectronE2020([](const caf::SRProxy *sr){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].calE;float energy=x;double a0, a1, a2, a3, a4, a5, a6;if(sr->hdr.det==caf::kFARDET){if(sr->spill.isRHC){a0=-0.727211;a1=2.319804;a2=-2.697100;a3=1.604802;a4=-0.493659;a5=0.075183;a6=-0.004478;}else{a0=-0.428873;a1=1.486957;a2=-1.772140;a3=1.114639;a4=-0.358208;a5=0.056065;a6=-0.003376;}}else{return energy;}if(x > 0) energy=x-(a0+a1 *x+a2 *pow(x, 2)+ a3 *pow(x, 3)+a4 *pow(x, 4)+ a5 *pow(x, 5)+a6 *pow(x, 6));if(energy< 0) energy=x;return energy;})
Definition: NueEnergy2020.h:41
const Var kHADE_2020([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;const double CVNha_CalE=sr->slc.calE;return std::max(CVNha_CalE-kEME_2020(sr), 0.);})
Definition: NueEnergy2020.h:15
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 kNueEnergyFHC2020_2D3D([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;return NueRecoE_2020FHCFit_2D3D(kEME2020_2D3D(sr), kHADE2020_2D3D(sr));})
Definition: NueEnergy2020.h:22
const Var kNueElectronPt2020([](const caf::SRProxy *sr){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(sr->hdr.det);float ct=elecDir.Dot(beamDir);float p=kNueElectronE2020(sr);if(p< 0||fabs(ct) > 1) return-1000.f;return float(p *sin(acos(ct)));})
Definition: NueEnergy2020.h:43
double NueRecoE_2020FHCFit_2D3D(double rawEM, double rawHA)
const Var kNueEnergyFHC2020([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;return NueRecoE_2020FHCFit(kEME_2020(sr), kHADE_2020(sr));})
Definition: NueEnergy2020.h:25
const Var kEME_2020([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;double CVNem_CalE=0.0;const caf::SRFuzzyKProngProxy &prim_png=sr->vtx.elastic.fuzzyk.png[0];for(const caf::SRFuzzyKProngProxy &png:sr->vtx.elastic.fuzzyk.png){double png_CalE=png.shwlid.calE;double emPID=((double) png.cvnpart.photonid+ (double) png.cvnpart.pizeroid+ (double) png.cvnpart.electronid);double haPID=((double) png.cvnpart.protonid+ (double) png.cvnpart.pionid+ (double) png.cvnpart.neutronid+ (double) png.cvnpart.otherid+ (double) png.cvnpart.muonid);if(emPID< 0) continue;if(emPID >=haPID ) CVNem_CalE+=png_CalE;else continue;}if(kLongestProng(sr) >=500) CVNem_CalE=prim_png.shwlid.calE;return CVNem_CalE;})
Definition: NueEnergy2020.h:14