NueVarsExtra.h
Go to the documentation of this file.
1 #pragma once
2 
3 // Additional Vars used in Nue Data/MC and validation
4 // No duplicates, please
5 
6 #include "CAFAna/Core/Var.h"
7 
8 namespace ana
9 {
10  extern const Var kVtxX;
11  extern const Var kVtxY;
12  extern const Var kVtxZ;
13 
14  extern const Var kEPerHit;
15  extern const Var kRecoEPerHit;
16 
17  extern const Var kemCalE;
18  extern const Var kEMNhit;
19 
20  extern const Var kEMEPerHit;
21  extern const Var kHADEPerHit;
22 
23  extern const Var kShwStartX;
24  extern const Var kShwStartY;
25  extern const Var kShwStartZ;
26 
27  extern const Var kShwStopX;
28  extern const Var kShwStopY;
29  extern const Var kShwStopZ;
30 
31  extern const Var kShwCalE;
32  extern const Var kShwNHit;
33 
34  extern const Var kShwWidth;
35  extern const Var kShwLen;
36  extern const Var kShwGap;
37 
38  extern const Var kInelasticity;
39 
40  extern const Var kHadCalE;
41 
42  extern const Var kemE2017;
43  extern const Var khadE2017;
44 
45  extern const Var kemE2018;
46  extern const Var khadE2018;
47 
48  extern const Var kNueHadEFrac;
49  extern const Var kNueHadEFrac2;
50  extern const Var kNueHadEFrac2020;
51 
52  extern const Var kNueHadCalEFrac;
53 
54  extern const Var kProtonCVN;
55  extern const Var kElectronCVN;
56  extern const Var kPhotonCVN;
57  extern const Var kPizeroCVN;
58  extern const Var kNeutronCVN;
59  extern const Var kOtherCVN;
60  extern const Var kMuonCVN;
61 
62  extern const Var kFirstProngCosTheta;
63  extern const Var kFirstProngTheta;
64 
65  extern const Var kCosTheta;
66  extern const Var kPi0Mass;
67  extern const Var kShwEFrac;
68 
69  extern const Var kMuLLL;
70  extern const Var kMuLLT;
71  extern const Var kELLL;
72  extern const Var kELLT;
73  extern const Var kEGLLL;
74  extern const Var kEGLLT;
75  extern const Var kEPLLL;
76  extern const Var kEPLLT;
77  extern const Var kENLLL;
78  extern const Var kENLLT;
79  extern const Var kEMuLLL;
80  extern const Var kEMuLLT;
81  extern const Var kEPi0LLL;
82  extern const Var kEPi0LLT;
83  extern const Var kEPiLLL;
84  extern const Var kEPiLLT;
85 
86  extern const Var kCVNeQE;
87  extern const Var kCVNeRES;
88  extern const Var kCVNeDIS;
89  extern const Var kCVNeOTHER;
90  extern const Var kCVNmQE;
91  extern const Var kCVNmRES;
92  extern const Var kCVNmDIS;
93  extern const Var kCVNmOTHER;
94 
95  extern const Var kConfusion;
96  extern const Var kConfusionCVNLEM;
97  extern const Var kConfusionCVNLID;
98 
99  extern const Var kCVNMode;
100 
101  extern const Var kPIDExp;
102  extern const Var kMeany;
103  extern const Var kQFrac;
104  extern const Var kEDiff;
105  extern const Var kEnrich;
106  extern const Var kNElastic;
107 
108  extern const Var kNShwLID;
109 
110  extern const Var kPtpMassless;
111 
112  extern const Var kHitsPerPlane;
113 
114  extern const Var kCosdang;
115 
116  extern const Var kCosAngleNextShower;
117 
118  /// asymmetry between x and y hits of most energetic shower
119  extern const Var kShwHitXYAsymm;
120 
121  /// Asymmetry of x vs y hits
123 
124  /// Fraction of hits in a 3D shower out of total slice
125  extern const Var kShwHitFrac;
126  extern const Var kNPlanesToFront;
127 
128  ///Count number of prongs identified as protons by CVN prong.
129  ///Applying a CVN cut of 0.9, and protons within 20 cm of vertex
130  ///used in wrong-sign studies in docdb-25899
131  extern const Var kProtonCount;
132 
133  ///return CVN proton score for most proton-like prong
134  extern const Var kProngCVNMaxProton;
135 
136  ///return distance from vertex for most proton-like prong
138 }//namespace
const Var kShwNHit
const Var kProtonCount([](const caf::SRProxy *sr){int count=0;const caf::SRVector3DProxy &vtx=sr->vtx.elastic.vtx;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.npng;++i){if(sr->vtx.elastic.fuzzyk.png[i].cvnpart.pdgmax!=2212) continue;const caf::SRVector3DProxy &st=sr->vtx.elastic.fuzzyk.png[i].start;if(util::pythag(vtx.X()-st.X(), vtx.Y()-st.Y(), vtx.Z()-st.Z())>20) if(sr->vtx.elastic.fuzzyk.png[i].cvnpart.maxval< 0.9) continue;count++;}return count;})
Definition: NueVarsExtra.h:131
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kConfusionCVNLEM([](const caf::SRProxy *sr){std::cout<< "ERROR::kConfusionCVNLEM. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort();return-5.;})
Definition: NueVarsExtra.h:96
const Var kEMNhit([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;double Nhit=0;for(const caf::SRFuzzyKProngProxy &png:sr->vtx.elastic.fuzzyk.png){double hits=png.nhit;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 ) Nhit+=hits;}return Nhit;})
Definition: NueVarsExtra.h:18
const Var kHADEPerHit([](const caf::SRProxy *sr){if((sr->slc.nhit-kEMNhit(sr))>0) return 1000.0 *(sr->slc.calE *CalibrationBugCorrectionFactor(sr->hdr)-kemCalE(sr))/(sr->slc.nhit-kEMNhit(sr));else return-5.;})
Definition: NueVarsExtra.h:21
const Var kConfusionCVNLID([](const caf::SRProxy *sr){std::cout<< "ERROR::kConfusionCVNLID. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort();return-5.;})
Definition: NueVarsExtra.h:97
const Var kEPi0LLL
const Var kCVNmQE([](const caf::SRProxy *sr){float cvnOut=-1;std::cout<< "ERROR::kCVNeQE. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort(); return cvnOut;})
Definition: NueVarsExtra.h:90
const Var kProngCVNMaxProtonDist([](const caf::SRProxy *sr){double score=-5;double dist=-5;const caf::SRVector3DProxy &vtx=sr->vtx.elastic.vtx;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.npng;++i){if(sr->vtx.elastic.fuzzyk.png[i].cvnpart.protonid > score){score=sr->vtx.elastic.fuzzyk.png[i].cvnpart.protonid;const caf::SRVector3DProxy &st=sr->vtx.elastic.fuzzyk.png[i].start;dist=util::pythag(vtx.X()-st.X(), vtx.Y()-st.Y(), vtx.Z()-st.Z());}}return dist;})
return distance from vertex for most proton-like prong
Definition: NueVarsExtra.h:137
const Var kFirstProngCosTheta([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;TVector3 prongDir=(TVector3) sr->vtx.elastic.fuzzyk.png[0].dir;TVector3 beamDir=ana::NuMIBeamDirection(sr->hdr.det);return float(prongDir.Dot(beamDir));})
Definition: NueVarsExtra.h:62
const Var kemCalE([](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.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: NueVarsExtra.h:17
const Var kCosdang
const Var kCVNmDIS([](const caf::SRProxy *sr){float cvnOut=-1;std::cout<< "ERROR::kCVNmDIS. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort(); return cvnOut;})
Definition: NueVarsExtra.h:92
const Var kShwStopX
const Var kShwCalE
const Var kEGLLL
const Var kemE2017([](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), 0.0);})
Definition: NueVarsExtra.h:42
const Var kEGLLT
const Var kENLLT
const Var kShwStartY
const Var kNueHadEFrac2020([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;if(kNueEnergy2020(sr) > 0.) return(kRecoHADE(sr)/kNueEnergy2020(sr));else return-5.;})
Definition: NueVarsExtra.h:50
const Var kNueHadEFrac2([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;if(kNueEnergy2018(sr) >0) return(kRecoHADE(sr)/kNueEnergy2018(sr));else return-5.;})
Definition: NueVarsExtra.h:49
const Var kNueHadEFrac([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1.0;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1.0;if(kNueEnergy2018(sr)>0){if(kIsRHC(sr)) return(NueRecoE_2018RHCFit(0.0, kRecoHADE(sr)))/(NueRecoE_2018RHCFit(kRecoEME(sr), kRecoHADE(sr)));else return(NueRecoE_2017FDFit(0.0, kRecoHADE(sr)))/NueRecoE_2017FDFit(kRecoEME(sr), kRecoHADE(sr));}else return-5.;})
Definition: NueVarsExtra.h:48
const Var kPizeroCVN
const Var kCVNmRES([](const caf::SRProxy *sr){float cvnOut=-1;std::cout<< "ERROR::kCVNmRES. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort(); return cvnOut;})
Definition: NueVarsExtra.h:91
const Var kEPerHit([](const caf::SRProxy *sr){if(sr->slc.nhit >0) return 1000.0 *(sr->slc.calE/sr->slc.nhit);else return-5.;})
Definition: NueVarsExtra.h:14
const Var kVtxX
const Var kShwEFrac
const Var kHadCalE([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return float(sr->slc.calE);if(sr->vtx.elastic.fuzzyk.nshwlid< 1) return float(sr->slc.calE);return((sr->slc.calE- sr->vtx.elastic.fuzzyk.png[0].shwlid.calE));})
Definition: NueVarsExtra.h:40
_Var< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:74
const Var kMeany
const Var kShwWidth
const Var kEnrich
const Var kPtpMassless([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.photptp)|| std::isinf(1.*sr->sel.nuecosrej.photptp)) return-1.f;return float(sr->sel.nuecosrej.photptp);})
Definition: NueVarsExtra.h:110
const Var kENLLL
const Var kHitsPerPlane
const Var kEMuLLT
const Var kShwStopY
const Var kCVNeOTHER([](const caf::SRProxy *sr){float cvnOut=-1;std::cout<< "ERROR::kCVNeOTHER. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort(); return cvnOut;})
Definition: NueVarsExtra.h:89
const Var kCVNmOTHER([](const caf::SRProxy *sr){float cvnOut=-1;std::cout<< "ERROR::kCVNmOTHER. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort(); return cvnOut;})
Definition: NueVarsExtra.h:93
const Var kMuLLT
const Var kShwStartX
const Var kCosAngleNextShower([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-5.f;if(sr->vtx.elastic.fuzzyk.nshwlid >=2) return(sr->vtx.elastic.fuzzyk.png[0].shwlid.dir).Dot(sr->vtx.elastic.fuzzyk.png[1].shwlid.dir);else return-5.f;})
Definition: NueVarsExtra.h:116
const Var kEPiLLL
const Var kConfusion([](const caf::SRProxy *sr){if(sr->sel.lem.pid< .47 &&sr->sel.lid.ann< .63) return.5;if(sr->sel.lem.pid< .47 &&sr->sel.lid.ann >=.63) return 1.5;if(sr->sel.lem.pid >=.47 &&sr->sel.lid.ann< .63) return 2.5;if(sr->sel.lem.pid >=.47 &&sr->sel.lid.ann >=.63) return 3.5;return-5.;})
Definition: NueVarsExtra.h:95
const Var kEMuLLL
const Var kEPiLLT
const Var kEPi0LLT
const Var kShwGap
const Var kMuLLL
const Var kCVNeQE([](const caf::SRProxy *sr){float cvnOut=-1;std::cout<< "ERROR::kCVNeQE. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort(); return cvnOut;})
Definition: NueVarsExtra.h:86
const Var kShwStopZ
const Var kFirstProngTheta([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1000.f;if(sr->vtx.elastic.fuzzyk.npng< 1) return-1000.f;float ct=kFirstProngCosTheta(sr);if(fabs(ct) > 1) return-1000.f;return float(acos(ct)*180.0/3.1416);})
Definition: NueVarsExtra.h:63
const Var kELLT
const Var kCVNMode([](const caf::SRProxy *sr){std::cout<< "ERROR::kCVNMode. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort();if(sr->sel.cvn.nueid< 0){return-1.;}return-5.;})
Definition: NueVarsExtra.h:99
const Var kEDiff
const Var kELLL
const Var kRecoEPerHit([](const caf::SRProxy *sr){if(sr->slc.nhit >0) return 1000.0 *(kNueEnergy2018(sr)/sr->slc.nhit);else return-5.;})
Definition: NueVarsExtra.h:15
const Var kNueHadCalEFrac([](const caf::SRProxy *sr){return kHadCalE(sr)/sr->slc.calE;})
Definition: NueVarsExtra.h:52
const Var khadE2018([](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 NueRecoE_2018RHCFit(0.0, kRecoHADE(sr));else return NueRecoE_2017FDFit(0.0, kRecoHADE(sr));})
Definition: NueVarsExtra.h:46
const Var kPIDExp
const Var kInelasticity([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return 1.f;if(sr->vtx.elastic.fuzzyk.nshwlid< 1) return 1.f;return((sr->slc.calE- sr->vtx.elastic.fuzzyk.png[0].shwlid.calE)/(sr->slc.calE));})
Definition: NueVarsExtra.h:38
const Var kCVNeDIS([](const caf::SRProxy *sr){float cvnOut=-1;std::cout<< "ERROR::kCVNeDIS. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort(); return cvnOut;})
Definition: NueVarsExtra.h:88
const Var kPhotonCVN
const Var kMuonCVN
const Var kProngCVNMaxProton([](const caf::SRProxy *sr){double score=-5;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.npng;++i){if(sr->vtx.elastic.fuzzyk.png[i].cvnpart.protonid > score) score=sr->vtx.elastic.fuzzyk.png[i].cvnpart.protonid;}return score;})
return CVN proton score for most proton-like prong
Definition: NueVarsExtra.h:134
const Var kShwHitFrac([](const caf::SRProxy *sr){if(sr->slc.nhit< 1) return-5.f;if(!sr->vtx.elastic.IsValid) return 0.f;float nhitall=0.0;for(unsigned int j=0;j< sr->vtx.elastic.fuzzyk.nshwlid;j++){nhitall+=sr->vtx.elastic.fuzzyk.png[j].shwlid.nhit;}return(nhitall/sr->slc.nhit);})
Fraction of hits in a 3D shower out of total slice.
Definition: NueVarsExtra.h:125
const Var kVtxY
const Var kEMEPerHit([](const caf::SRProxy *sr){if(kEMNhit(sr)>0) return 1000.0 *(kemCalE(sr)/kEMNhit(sr));else return-5.;})
Definition: NueVarsExtra.h:20
const Var kShwHitXYUnsignedAsymm([](const caf::SRProxy *sr){return abs(kShwHitXYAsymm(sr));})
Asymmetry of x vs y hits.
Definition: NueVarsExtra.h:122
const Var kPi0Mass
const Var kNPlanesToFront
const Var kemE2018([](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 NueRecoE_2018RHCFit(kRecoEME(sr), 0.0);else return NueRecoE_2017FDFit(kRecoEME(sr), 0.0);})
Definition: NueVarsExtra.h:45
const Var kElectronCVN
const Var kShwHitXYAsymm([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-5.f;if(sr->vtx.elastic.fuzzyk.nshwlid< 1) return-5.f;float xyhitdiff=sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx-sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity;float xyhitsum=(sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx+ sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity);if(xyhitsum >0) return xyhitdiff/xyhitsum;else return-5.f;})
asymmetry between x and y hits of most energetic shower
Definition: NueVarsExtra.h:119
const Var kVtxZ
const Var kEPLLT
const Var kEPLLL
const Var kNShwLID([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return 0u;return(unsigned int) sr->vtx.elastic.fuzzyk.nshwlid;})
Definition: NueVarsExtra.h:108
const Var kCosTheta
const Var kNElastic([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid){return 0.;}else{return 1.;}})
Definition: NueVarsExtra.h:106
const Var kShwStartZ
const Var kCVNeRES([](const caf::SRProxy *sr){float cvnOut=-1;std::cout<< "ERROR::kCVNeRES. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort(); return cvnOut;})
Definition: NueVarsExtra.h:87
const Var kOtherCVN
const Var kShwLen
const Var kNeutronCVN
const Var kProtonCVN
const Var khadE2017([](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(0.0, kCVNhadE(sr));})
Definition: NueVarsExtra.h:43
const Var kQFrac