ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/devildog/SWonAnalysis3/Thesis/src/TCElectron.cc
Revision: 1.3
Committed: Wed Jun 15 22:12:53 2011 UTC (13 years, 10 months ago) by devildog
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -3 lines
Log Message:
Removed custom copy constructor

File Contents

# User Rev Content
1 devildog 1.1 /*
2     * File: TCElectron.cc
3     * Author: S. Won
4     */
5    
6     #include "TCElectron.h"
7     #include <iostream>
8    
9     TCElectron::TCElectron() {
10     }
11    
12     TCElectron::~TCElectron() {
13     }
14    
15     // "get" methods -------------------------------------
16    
17     TVector3 TCElectron::Position() const {
18     return _position;
19     }
20    
21     TLorentzVector TCElectron::P4() const {
22     return _p4;
23     }
24    
25     TVector2 TCElectron::P2() const {
26     TVector2 v2(_p4.Px(), _p4.Py());
27     return v2;
28     }
29    
30     float TCElectron::Et() const {
31     return _p4.Et();
32     }
33    
34     float TCElectron::Pt() const {
35     return _p4.Pt();
36     }
37    
38     int TCElectron::Charge() const{
39     return charge;
40     }
41    
42     float TCElectron::SumPt03() const {
43     return sumPt03;
44     }
45    
46     float TCElectron::EmEt03() const {
47     return emEt03;
48     }
49    
50     float TCElectron::HadEt03() const {
51     return hadEt03;
52     }
53    
54     float TCElectron::Phi() const {
55     return _p4.Phi();
56     }
57    
58     int TCElectron::CutLevel(int lvl) const{
59     if(lvl==95){
60     return Cut95;
61     }else if(lvl==90) {
62     return Cut90;
63     }else if(lvl==85) {
64     return Cut85;
65     }else if(lvl==80) {
66     return Cut80;
67     }else if(lvl==70) {
68     return Cut70;
69     }else if(lvl==60) {
70     return Cut60;
71     }else{
72     return -99;
73     }
74     }
75    
76     bool TCElectron::passID(int lvl) const {
77     int c = CutLevel(lvl);
78     if(c < 0) return false;
79     if( (c == 1) || (c == 3) || (c == 5) || (c == 7)) return true;
80     return false;
81     }
82    
83     bool TCElectron::passConversion(int lvl) const {
84     int c = CutLevel(lvl);
85     if(c < 0) return false;
86     if( (c == 4) || (c == 5) || (c == 6) || (c == 7)) return true;
87     return false;
88     }
89    
90     bool TCElectron::passIsolation(int lvl) const {
91     int c = CutLevel(lvl);
92     if(c < 0) return false;
93     if( (c == 2) || (c == 3) || (c == 6) || (c == 7)) return true;
94     return false;
95     }
96    
97     bool TCElectron::isEB() const {
98     return isEB_;
99     }
100    
101     bool TCElectron::isEE() const {
102     return isEE_;
103     }
104    
105     bool TCElectron::isInGap() const {
106     return isInGap_;
107     }
108    
109     int TCElectron::numberOfValidPixelHits() const {
110     return numberOfValidPixelHits_;
111     }
112    
113     int TCElectron::numberOfValidTrackerHits() const {
114     return numberOfValidTrackerHits_;
115     }
116    
117     int TCElectron::numberOfMissingPixelHits() const {
118     return numberOfMissingPixelHits_;
119     }
120    
121     int TCElectron::numberOfMissingTrackerHits() const {
122     return numberOfMissingTrackerHits_;
123     }
124    
125     float TCElectron::PFRelIso(float coneSize) const {
126     float relIso = 0;
127     if (fabs(coneSize - 0.3) < 0.01)
128     relIso = (PFiso_Pt03 + PFiso_Gamma03 + PFiso_Neutral03) / _p4.Pt();
129     if (fabs(coneSize - 0.4) < 0.01)
130     relIso = (PFiso_Pt04 + PFiso_Gamma04 + PFiso_Neutral04) / _p4.Pt();
131     if (fabs(coneSize - 0.5) < 0.01)
132     relIso = (PFiso_Pt05 + PFiso_Gamma05 + PFiso_Neutral05) / _p4.Pt();
133     return relIso;
134     }
135    
136     float TCElectron::PFSumPt(float coneSize) const {
137     float sumPt = 0;
138     if (fabs(coneSize - 0.3) < 0.01) sumPt = PFiso_Pt03;
139     if (fabs(coneSize - 0.4) < 0.01) sumPt = PFiso_Pt04;
140     if (fabs(coneSize - 0.5) < 0.01) sumPt = PFiso_Pt05;
141     return sumPt;
142     }
143    
144     float TCElectron::PFENeutral(float coneSize) const {
145     float neutral = 0;
146     if (fabs(coneSize - 0.3) < 0.01) neutral = PFiso_Neutral03;
147     if (fabs(coneSize - 0.4) < 0.01) neutral = PFiso_Neutral04;
148     if (fabs(coneSize - 0.5) < 0.01) neutral = PFiso_Neutral05;
149     return neutral;
150     }
151    
152     float TCElectron::PFEGamma(float coneSize) const {
153     float gamma = 0;
154     if (fabs(coneSize - 0.3) < 0.01) gamma = PFiso_Gamma03;
155     if (fabs(coneSize - 0.4) < 0.01) gamma = PFiso_Gamma04;
156     if (fabs(coneSize - 0.5) < 0.01) gamma = PFiso_Gamma05;
157     return gamma;
158     }
159    
160     // "set" methods ---------------------------------------------
161    
162     void TCElectron::SetPosition(float x, float y, float z) {
163     TVector3 p(x, y, z);
164     _position = p;
165     }
166    
167     void TCElectron::SetP4(TLorentzVector p4) {
168     _p4 = p4;
169     }
170    
171     void TCElectron::SetP4(float px, float py, float pz, float e) {
172     TLorentzVector p4(px, py, pz, e);
173     _p4 = p4;
174     }
175    
176     void TCElectron::SetsumPt03(float s) {
177     sumPt03 = s;
178     }
179    
180     void TCElectron::SetemEt03(float s) {
181     emEt03 = s;
182     }
183    
184     void TCElectron::SethadEt03(float s) {
185     hadEt03 = s;
186     }
187    
188     void TCElectron::SetCharge(int c) {
189     charge = c;
190     }
191    
192     void TCElectron::SetCutLevel(int cut, int lvl){
193     if(lvl==95){
194     Cut95 = cut;
195     }else if(lvl==90) {
196     Cut90 = cut;
197     }else if(lvl==85) {
198     Cut85 = cut;
199     }else if(lvl==80) {
200     Cut80 = cut;
201     }else if(lvl==70) {
202     Cut70 = cut;
203     }else if(lvl==60) {
204     Cut60 = cut;
205     }
206     }
207    
208     void TCElectron::SetnumberOfValidPixelHits(int n) {
209     numberOfValidPixelHits_ = n;
210     }
211    
212     void TCElectron::SetnumberOfValidTrackerHits(int n) {
213     numberOfValidTrackerHits_ = n;
214     }
215    
216     void TCElectron::SetnumberOfMissingPixelHits(int n) {
217     numberOfMissingPixelHits_ = n;
218     }
219    
220     void TCElectron::SetnumberOfMissingTrackerHits(int n) {
221     numberOfMissingTrackerHits_ = n;
222     }
223    
224     void TCElectron::SetPFSumPt(float coneSize, float f) {
225     if(fabs(coneSize - 0.3) < 0.01) PFiso_Pt03 = f;
226     if(fabs(coneSize - 0.4) < 0.01) PFiso_Pt04 = f;
227     if(fabs(coneSize - 0.5) < 0.01) PFiso_Pt05 = f;
228     }
229    
230     void TCElectron::SetPFEGamma(float coneSize, float f) {
231     if(fabs(coneSize - 0.3) < 0.01) PFiso_Gamma03 = f;
232     if(fabs(coneSize - 0.4) < 0.01) PFiso_Gamma04 = f;
233     if(fabs(coneSize - 0.5) < 0.01) PFiso_Gamma05 = f;
234     }
235    
236     void TCElectron::SetPFENeutral(float coneSize, float f) {
237     if(fabs(coneSize - 0.3) < 0.01) PFiso_Neutral03 = f;
238     if(fabs(coneSize - 0.4) < 0.01) PFiso_Neutral04 = f;
239     if(fabs(coneSize - 0.5) < 0.01) PFiso_Neutral05 = f;
240     }
241    
242     void TCElectron::SetisEB(bool b) {
243     isEB_ = b;
244     }
245    
246     void TCElectron::SetisEE(bool b) {
247     isEE_ = b;
248     }
249    
250     void TCElectron::SetisInGap(bool b) {
251     isInGap_ = b;
252     }
253 devildog 1.2
254     float TCElectron::dz() const {
255     return dz_;
256     }
257    
258     float TCElectron::dxy() const {
259     return dxy_;
260     }
261    
262     void TCElectron::SetDxy(float n) {
263     dxy_ = n;
264     }
265    
266     void TCElectron::SetDz(float n) {
267     dz_ = n;
268     }