NueEnergy2017.cxx
Go to the documentation of this file.
2 
4 
5 #include "CAFAna/Vars/Vars.h"
6 
7 namespace ana
8 {
9  // Values from the noBoth fit in docdb 22199
10  double NueRecoE_2017FDFit(double rawEM, double rawHA)
11  {
12  if(rawEM < -1. || rawHA < -1.) return -5.;
13  const double p0 = 0.0;
14  const double p1 = 0.996;
15  const double p2 = 0.869;
16  const double p3 = 0.0;
17  const double p4 = 0.025;
18  const double p5 = 0.504;
19  const double recoEn = 1/(1+0.057) * (rawHA*rawHA*p5 + rawEM*rawEM*p4 + rawEM*rawHA*p3 + rawHA*p2 + rawEM*p1 + p0);
20  return recoEn;
21  }
22 
23  const Var kCVNemE([](const caf::SRProxy* sr)
24  {
25  if(!sr->vtx.elastic.IsValid) return -1.0;
26  if(sr->vtx.elastic.fuzzyk.npng < 1) return -1.0;
27 
28  double CVNem_CalE = 0;
29  for(const caf::SRFuzzyKProngProxy& png: sr->vtx.elastic.fuzzyk.png){
30  double png_CalE = png.shwlid.calE;
31 
32  double emPID = ( (double)png.cvnpart.photonid +
33  (double)png.cvnpart.pizeroid +
34  (double)png.cvnpart.electronid);
35  double haPID = ( (double)png.cvnpart.protonid +
36  (double)png.cvnpart.pionid +
37  (double)png.cvnpart.neutronid +
38  (double)png.cvnpart.otherid +
39  (double)png.cvnpart.muonid );
40 
41  if ( emPID <= 0 ) continue;
42  if ( emPID >= haPID ) CVNem_CalE += png_CalE;
43  }
44 
45  return CVNem_CalE * CalibrationBugCorrectionFactor(sr->hdr);
46  });
47 
48  const Var kCVNhadE([](const caf::SRProxy* sr)
49  {
50  if(!sr->vtx.elastic.IsValid) return -1.0;
51  if(sr->vtx.elastic.fuzzyk.npng < 1) return -1.0;
52 
53  const double calE = sr->slc.calE * CalibrationBugCorrectionFactor(sr->hdr);
54  return std::max(calE - kCVNemE(sr), 0.);
55  });
56 
57 
58 
59  const Var kNueEnergy2017(
60  [](const caf::SRProxy* sr)
61  {
62  if(!sr->vtx.elastic.IsValid) return -1.0;
63  if(sr->vtx.elastic.fuzzyk.npng < 1) return -1.0;
64 
65  return NueRecoE_2017FDFit(kCVNemE(sr), kCVNhadE(sr));
66  });
67 
68 }
caf::Proxy< size_t > npng
Definition: SRProxy.h:2038
T max(const caf::Proxy< T > &a, T b)
caf::Proxy< caf::SRFuzzyK > fuzzyk
Definition: SRProxy.h:2059
const Var kCVNemE([](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;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;}return CVNem_CalE *CalibrationBugCorrectionFactor(sr->hdr);})
Definition: NueEnergy2017.h:9
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
double CalibrationBugCorrectionFactor(const caf::SRHeaderProxy &hdr)
See docdb 23597.
Definition: Vars.cxx:141
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2137
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
const Var kCVNhadE([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;const double calE=sr->slc.calE *CalibrationBugCorrectionFactor(sr->hdr);return std::max(calE-kCVNemE(sr), 0.);})
Definition: NueEnergy2017.h:10
Proxy for caf::SRFuzzyKProng.
Definition: SRProxy.h:2003
caf::Proxy< caf::SRElastic > elastic
Definition: SRProxy.h:2118
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
Definition: SRProxy.h:2043
const Var kNueEnergy2017([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;return NueRecoE_2017FDFit(kCVNemE(sr), kCVNhadE(sr));})
Definition: NueEnergy2017.h:11
double NueRecoE_2017FDFit(double rawEM, double rawHA)
caf::StandardRecord * sr
caf::Proxy< bool > IsValid
Definition: SRProxy.h:2058
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2142
caf::Proxy< float > calE
Definition: SRProxy.h:1292
caf::Proxy< caf::SRVertexBranch > vtx
Definition: SRProxy.h:2146