ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MPIAnalyzer/src/TCJet.cc
Revision: 1.5
Committed: Wed Mar 23 13:47:10 2011 UTC (14 years, 1 month ago) by naodell
Content type: text/plain
Branch: MAIN
Changes since 1.4: +7 -3 lines
Log Message:
JES uncertainty methods

File Contents

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