ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/devildog/SWonAnalysis3/Thesis/src/TCJet.cc
Revision: 1.1
Committed: Thu Apr 7 02:02:29 2011 UTC (14 years ago) by devildog
Content type: text/plain
Branch: MAIN
Log Message:
*** empty log message ***

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