ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/devildog/SWonAnalysis3/Thesis/src/TCJet.cc
Revision: 1.3
Committed: Fri May 27 05:45:15 2011 UTC (13 years, 11 months ago) by devildog
Content type: text/plain
Branch: MAIN
Changes since 1.2: +9 -0 lines
Log Message:
Added JES uncertainty

File Contents

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