1 |
devildog |
1.1 |
/*
|
2 |
|
|
* File: TCJet.cc
|
3 |
|
|
* Author: Anton A.
|
4 |
|
|
*
|
5 |
|
|
* Created on April 30, 2010, 2:49 PM
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
#include "TCJet.h"
|
9 |
|
|
#include<iostream>
|
10 |
|
|
|
11 |
|
|
TCJet::TCJet() {
|
12 |
|
|
for (int i = 0; i < 8; ++i) {
|
13 |
|
|
_jetCorr[i] = 1.0;
|
14 |
|
|
_jetCorrIsSet[i] = false;
|
15 |
|
|
}
|
16 |
|
|
_jetCorrIsSet[0] = true;
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
TCJet::~TCJet() {
|
20 |
|
|
}
|
21 |
|
|
|
22 |
|
|
// "get" methods -------------------------------------
|
23 |
|
|
|
24 |
devildog |
1.2 |
TLorentzVector TCJet::P4() const { return _p4; }
|
25 |
devildog |
1.1 |
|
26 |
|
|
TVector2 TCJet::P2() const {
|
27 |
|
|
TVector2 v2(_p4.Px(), _p4.Py());
|
28 |
|
|
return v2;
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
float TCJet::Et() const {
|
32 |
|
|
return _p4.Et();
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
float TCJet::Pt() const {
|
36 |
|
|
return _p4.Pt();
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
// accessors for corrected jets (argument is level of correction)
|
40 |
|
|
|
41 |
|
|
TLorentzVector TCJet::P4(unsigned int lvl) const {
|
42 |
|
|
if (lvl > 7) {
|
43 |
|
|
std::cout << "\nJet correction = " << lvl << std::endl;
|
44 |
|
|
std::cout << "Correction level cannot exceed 7!\n";
|
45 |
|
|
std::cout << "No correction will be applied!\n";
|
46 |
|
|
return _p4;
|
47 |
|
|
}
|
48 |
|
|
return TotalJetCorr(lvl) * _p4;
|
49 |
|
|
}
|
50 |
|
|
|
51 |
|
|
TVector2 TCJet::P2(unsigned int lvl) const {
|
52 |
|
|
TVector2 v2(_p4.Px(), _p4.Py());
|
53 |
|
|
if (lvl > 7) {
|
54 |
|
|
std::cout << "\nJet correction = " << lvl << std::endl;
|
55 |
|
|
std::cout << "Correction level cannot exceed 7!\n";
|
56 |
|
|
std::cout << "No correction will be applied!\n";
|
57 |
|
|
return v2;
|
58 |
|
|
}
|
59 |
|
|
return TotalJetCorr(lvl) * v2;
|
60 |
|
|
}
|
61 |
|
|
|
62 |
|
|
float TCJet::Et(unsigned int lvl) const {
|
63 |
|
|
|
64 |
|
|
if (lvl > 7) {
|
65 |
|
|
std::cout << "\nJet correction = " << lvl << std::endl;
|
66 |
|
|
std::cout << "Correction level cannot exceed 7!\n";
|
67 |
|
|
std::cout << "No correction will be applied!\n";
|
68 |
|
|
return _p4.Et();
|
69 |
|
|
}
|
70 |
|
|
return TotalJetCorr(lvl) * _p4.Et();
|
71 |
|
|
}
|
72 |
|
|
|
73 |
|
|
float TCJet::Pt(unsigned int lvl) const {
|
74 |
|
|
if (lvl > 7) {
|
75 |
|
|
std::cout << "\nJet correction = " << lvl << std::endl;
|
76 |
|
|
std::cout << "Correction level cannot exceed 7!\n";
|
77 |
|
|
std::cout << "No correction will be applied!\n";
|
78 |
|
|
return _p4.Pt();
|
79 |
|
|
}
|
80 |
|
|
return TotalJetCorr(lvl) * _p4.Pt();
|
81 |
|
|
}
|
82 |
|
|
|
83 |
|
|
float TCJet::ChHadFrac() const {
|
84 |
|
|
return _chHadFrac;
|
85 |
|
|
}
|
86 |
|
|
|
87 |
|
|
float TCJet::NeuHadFrac() const {
|
88 |
|
|
return _neuHadFrac;
|
89 |
|
|
}
|
90 |
|
|
|
91 |
|
|
float TCJet::ChEmFrac() const {
|
92 |
|
|
return _chEmFrac;
|
93 |
|
|
}
|
94 |
|
|
|
95 |
|
|
float TCJet::NeuEmFrac() const {
|
96 |
|
|
return _neuEmFrac;
|
97 |
|
|
}
|
98 |
|
|
|
99 |
|
|
unsigned int TCJet::NumConstit() const {
|
100 |
|
|
return _numConstit;
|
101 |
|
|
}
|
102 |
|
|
|
103 |
|
|
unsigned int TCJet::NumChPart() const {
|
104 |
|
|
return _numChPart;
|
105 |
|
|
}
|
106 |
|
|
|
107 |
|
|
TVector3 TCJet::Vtx() const {
|
108 |
|
|
return _vtx;
|
109 |
|
|
}
|
110 |
|
|
|
111 |
|
|
float TCJet::VtxSumPt() const {
|
112 |
|
|
return _vtxSumPt;
|
113 |
|
|
}
|
114 |
|
|
|
115 |
|
|
unsigned int TCJet::VtxIndex() const {
|
116 |
|
|
return _vtxIndex;
|
117 |
|
|
}
|
118 |
|
|
|
119 |
|
|
//TVector3 TCJet::AssocVtx() {
|
120 |
|
|
// return _assocPV;
|
121 |
|
|
//}
|
122 |
|
|
|
123 |
|
|
bool TCJet::JetCorrIsSet(unsigned int lvl) const {
|
124 |
|
|
return _jetCorrIsSet[lvl];
|
125 |
|
|
}
|
126 |
|
|
|
127 |
|
|
float TCJet::JetCorr(unsigned int lvl) const {
|
128 |
|
|
return _jetCorr[lvl];
|
129 |
|
|
}
|
130 |
|
|
|
131 |
|
|
float TCJet::TotalJetCorr(unsigned int lvl) const {
|
132 |
|
|
float corr = 1.0;
|
133 |
|
|
for (unsigned int i = 1; i <= lvl; ++i) {
|
134 |
|
|
if (JetCorrIsSet(lvl)) corr *= JetCorr(i);
|
135 |
|
|
}
|
136 |
|
|
return corr;
|
137 |
|
|
}
|
138 |
|
|
|
139 |
|
|
//// b tagging discriminators
|
140 |
devildog |
1.2 |
//Track counting tag with N = 3: trackCountingHighPurBJetTags
|
141 |
|
|
|
142 |
|
|
float TCJet::BDiscrTrkCountHiPure() const {
|
143 |
|
|
return _bDiscrTrkCountHiPure;
|
144 |
|
|
}
|
145 |
|
|
|
146 |
|
|
//Track counting tag with N = 2: trackCountingHighEffBJetTags
|
147 |
devildog |
1.1 |
|
148 |
|
|
float TCJet::BDiscrTrkCountHiEff() const {
|
149 |
|
|
return _bDiscrTrkCountHiEff;
|
150 |
|
|
}
|
151 |
|
|
|
152 |
devildog |
1.2 |
//Simple secondary vertex b tag: simpleSecondaryVertexBJetTags
|
153 |
|
|
|
154 |
|
|
float TCJet::BDiscrSecVtxSimple() const {
|
155 |
|
|
return _bDiscrSecVtxSimple;
|
156 |
|
|
}
|
157 |
|
|
|
158 |
|
|
//Combined SV b tag using likelihood ratios: combinedSVBJetTags
|
159 |
|
|
|
160 |
|
|
float TCJet::BDiscrSecVtxL() const {
|
161 |
|
|
return _bDiscrSecVtxL;
|
162 |
|
|
}
|
163 |
|
|
|
164 |
|
|
//Combined SV b tag using MVA: combinedSVMVABJetTags
|
165 |
|
|
|
166 |
|
|
float TCJet::BDiscrSecVtxMVA() const {
|
167 |
|
|
return _bDiscrSecVtxMVA;
|
168 |
|
|
}
|
169 |
devildog |
1.1 |
|
170 |
|
|
|
171 |
|
|
// "set" methods ---------------------------------------------
|
172 |
|
|
|
173 |
|
|
void TCJet::SetP4(TLorentzVector p4) {
|
174 |
|
|
_p4 = p4;
|
175 |
|
|
}
|
176 |
|
|
|
177 |
|
|
void TCJet::SetP4(float px, float py, float pz, float e) {
|
178 |
|
|
TLorentzVector p4(px, py, pz, e);
|
179 |
|
|
_p4 = p4;
|
180 |
|
|
}
|
181 |
|
|
|
182 |
|
|
void TCJet::SetVtx(float vx, float vy, float vz) {
|
183 |
|
|
TVector3 v3(vx, vy, vz);
|
184 |
|
|
_vtx = v3;
|
185 |
|
|
}
|
186 |
|
|
|
187 |
|
|
void TCJet::SetVtxSumPt(float vtxSumPt){
|
188 |
|
|
_vtxSumPt = vtxSumPt;
|
189 |
|
|
}
|
190 |
|
|
|
191 |
|
|
void TCJet::SetVtxIndex(unsigned int vtxIndex){
|
192 |
|
|
_vtxIndex = vtxIndex;
|
193 |
|
|
}
|
194 |
|
|
//void TCJet::SetAssocVtx(float vx, float vy, float vz) {
|
195 |
|
|
// TVector3 v3(vx, vy, vz);
|
196 |
|
|
// _assocPV = v3;
|
197 |
|
|
//}
|
198 |
|
|
|
199 |
|
|
void TCJet::SetChHadFrac(float c) {
|
200 |
|
|
_chHadFrac = c;
|
201 |
|
|
}
|
202 |
|
|
|
203 |
|
|
void TCJet::SetNeuHadFrac(float n) {
|
204 |
|
|
_neuHadFrac = n;
|
205 |
|
|
}
|
206 |
|
|
|
207 |
|
|
void TCJet::SetChEmFrac(float c) {
|
208 |
|
|
_chEmFrac = c;
|
209 |
|
|
}
|
210 |
|
|
|
211 |
|
|
void TCJet::SetNeuEmFrac(float n) {
|
212 |
|
|
_neuEmFrac = n;
|
213 |
|
|
}
|
214 |
|
|
|
215 |
|
|
void TCJet::SetNumConstit(unsigned int n) {
|
216 |
|
|
_numConstit = n;
|
217 |
|
|
}
|
218 |
|
|
|
219 |
|
|
void TCJet::SetNumChPart(unsigned int n) {
|
220 |
|
|
_numChPart = n;
|
221 |
|
|
}
|
222 |
|
|
|
223 |
|
|
void TCJet::SetJetCorr(unsigned int lvl, float corr) {
|
224 |
|
|
|
225 |
|
|
if (lvl <= 7) {
|
226 |
|
|
_jetCorr[lvl] = corr;
|
227 |
|
|
_jetCorrIsSet[lvl] = true;
|
228 |
|
|
|
229 |
|
|
} else {
|
230 |
|
|
std::cout << "\nJet correction lvl = " << lvl << " is not valid!\n";
|
231 |
|
|
std::cout << "No correction will be applied!\n\n";
|
232 |
|
|
}
|
233 |
|
|
|
234 |
|
|
}
|
235 |
|
|
// b tagging discriminators
|
236 |
|
|
|
237 |
devildog |
1.2 |
void TCJet::SetBDiscrTrkCountHiPure(float d) {
|
238 |
|
|
_bDiscrTrkCountHiPure = d;
|
239 |
|
|
}
|
240 |
devildog |
1.1 |
|
241 |
|
|
void TCJet::SetBDiscrTrkCountHiEff(float d) {
|
242 |
|
|
_bDiscrTrkCountHiEff = d;
|
243 |
|
|
}
|
244 |
|
|
|
245 |
devildog |
1.2 |
void TCJet::SetBDiscrSecVtxSimple(float d) {
|
246 |
|
|
_bDiscrSecVtxSimple = d;
|
247 |
|
|
}
|
248 |
|
|
|
249 |
|
|
void TCJet::SetBDiscrSecVtxL(float d) {
|
250 |
|
|
_bDiscrSecVtxL = d;
|
251 |
|
|
}
|
252 |
|
|
|
253 |
|
|
void TCJet::SetBDiscrSecVtxMVA(float d) {
|
254 |
|
|
_bDiscrSecVtxMVA = d;
|
255 |
|
|
}
|
256 |
|
|
|
257 |
|
|
void TCJet::SetVtxSumPtFrac(float vtxSumPtFrac){
|
258 |
|
|
_vtxSumPtFrac = vtxSumPtFrac;
|
259 |
|
|
}
|
260 |
|
|
void TCJet::SetVtxTrackFrac(float vtxTrackFrac){
|
261 |
|
|
_vtxTrackFrac = vtxTrackFrac;
|
262 |
|
|
}
|
263 |
|
|
|
264 |
|
|
void TCJet::SetVtxNTracks(int vtxNTracks){
|
265 |
|
|
_vtxNTracks = vtxNTracks;
|
266 |
|
|
}
|
267 |
|
|
|
268 |
|
|
float TCJet::VtxSumPtFrac() const {
|
269 |
|
|
return _vtxSumPtFrac;
|
270 |
|
|
}
|
271 |
|
|
|
272 |
|
|
float TCJet::VtxTrackFrac() const {
|
273 |
|
|
return _vtxTrackFrac;
|
274 |
|
|
}
|
275 |
|
|
|
276 |
|
|
int TCJet::VtxNTracks() const {
|
277 |
|
|
return _vtxNTracks;
|
278 |
|
|
}
|
279 |
devildog |
1.3 |
|
280 |
|
|
|
281 |
|
|
float TCJet::UncertaintyJES() const {
|
282 |
|
|
return _jesUncertainty;
|
283 |
|
|
}
|
284 |
|
|
|
285 |
|
|
void TCJet::SetUncertaintyJES(float u) {
|
286 |
|
|
_jesUncertainty = u;
|
287 |
|
|
}
|