ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/mschen/SusyAnalysis/code/electron.h
Revision: 1.1
Committed: Mon Mar 28 09:23:54 2011 UTC (14 years, 1 month ago) by mschen
Content type: text/plain
Branch: MAIN
CVS Tags: V2010_data_analysis_effModelInPaper, V2010_data_analysis, HEAD
Error occurred while calculating annotation data.
Log Message:
2010 same sign analysis codeing

File Contents

# Content
1 #ifndef Electron_h
2 #define Electron_h
3
4 #include <TLorentzVector.h>
5
6 #include "init.h"
7 #include "mcParticle.h"
8
9 using namespace std;
10
11 class Electron:public mcParticle {
12
13 private:
14 double ecalIso_, hcalIso_, trkIso_;
15 int type_;
16 double d0_, Chi2N_;
17 int nHit_;
18 double outZ_, outR_;
19 double HoE_, sigEtaEta_, dPhi_, dEta_, EoP_;
20
21 double parentDR_;
22 int parentI_, parentI2_, parentClass, parentPDG;
23
24 int barrel;
25 bool robustLoose_;
26 bool robustTight_;
27 bool loose_;
28 bool tight_;
29 float simpleEleId95cIso_;
30 float simpleEleId90cIso_;
31 float simpleEleId85cIso_;
32 float simpleEleId80cIso_;
33 float simpleEleId70cIso_;
34 float simpleEleId60cIso_;
35
36 double _superClusterSeedE1x5;
37 double _superClusterSeedE5x5;
38 double _fBrem;
39
40 float gen_pt, gen_eta, gen_phi;
41 int gen_q, gen_index;
42
43 bool isGsfCtfConsistent_, isGsfScPixConsistent_, isGsfCtfScPixConsistent_;
44
45 bool robustHighEnergy_;
46
47 float superClusterEt_;
48
49 bool ecalDriven_;
50
51 int nMissingHits_;
52 float convDist_, convDcot_;
53
54 public:
55 //Electron() {};
56 Electron(
57 int index,
58 int q,
59 TLorentzVector mom,
60 TLorentzVector vtx,
61
62 double ecalIso,
63 double hcalIso,
64 double trkIso,
65
66 int type,
67
68 double d0,
69 double Chi2N,
70 int nHit,
71 double outZ,
72 double outR,
73
74 double HoE,
75 double sigEtaEta,
76 double dPhi,
77 double dEta,
78 double EoP
79
80 )
81 :mcParticle(
82 index,
83 11,
84 q,
85 mom,
86 0,
87 vtx
88 ),
89 ecalIso_(ecalIso),
90 hcalIso_(hcalIso),
91 trkIso_(trkIso),
92
93 type_(type),
94 d0_(d0),
95 Chi2N_(Chi2N),
96 nHit_(nHit),
97 outZ_(outZ),
98 outR_(outR)
99 {
100 HoE_ = HoE;
101 sigEtaEta_ = sigEtaEta;
102 dPhi_ = dPhi;
103 dEta_ = dEta;
104 EoP_ = EoP;
105
106 parentDR_ = -1;
107 parentI_ = -1;
108 parentI2_ = -1;
109 parentClass = -1;
110 parentPDG = -1;
111
112 barrel = 0;
113 if (fabs(eta()) < 1.48) barrel++;
114
115 // robustLoose_ = 0;
116 // if (barrel && HoE_<0.075 && sigEtaEta_<0.0132 && dPhi_<0.058 && dEta_<0.077) robustLoose_ = 1;
117 // if (!barrel && HoE_<0.083 && sigEtaEta_<0.027 && dPhi_<0.042 && dEta_<0.01) robustLoose_ = 1;
118
119
120 gen_pt = -1; gen_eta = -99.0; gen_phi=-99.0; gen_q = -99; gen_index = -1;
121
122 isGsfCtfConsistent_=1; isGsfScPixConsistent_=1; isGsfCtfScPixConsistent_=1;
123
124 simpleEleId95cIso_ = -1;
125 simpleEleId90cIso_ = -1;
126 simpleEleId85cIso_ = -1;
127 simpleEleId80cIso_ = -1;
128 simpleEleId70cIso_ = -1;
129 simpleEleId60cIso_ = -1;
130 superClusterEt_ = 0;
131 ecalDriven_ = true;
132 };
133 ~Electron() {};
134
135 double ecalIso() const {return ecalIso_;};
136 double hcalIso() const {return hcalIso_;};
137 double trkIso() const {return trkIso_;};
138 double isolSumNorm(int type=1) const
139 {
140 double tmp;
141 if(barrel>0){
142 if(type==1){
143 tmp = (trkIso_ + (ecalIso_>1?(ecalIso_-1):0) + hcalIso_)/pt();
144 }else{
145 tmp = (trkIso_ + (ecalIso_>1?(ecalIso_-1):0) + hcalIso_)/(pt()>20?pt():20);
146 }
147 }else {
148 if(type==1){
149 tmp = (trkIso_ + ecalIso_ + hcalIso_)/pt();
150 }else {
151 tmp = (trkIso_ + ecalIso_ + hcalIso_)/(pt()>20?pt():20);
152 }
153 }
154 if (tmp<0) return 0; else return tmp;
155 };
156 double isolSum() const
157 {
158 //return (trkIso_ + ecalIso_ + hcalIso_);
159 if(barrel>0)
160 return (trkIso_ + (ecalIso_>1?(ecalIso_-1):0) + hcalIso_);
161 else
162 return (trkIso_ + ecalIso_ + hcalIso_);
163 };
164
165 void putParentDR(double dr) {parentDR_ = dr;};
166 void putParentI(int i) {parentI_ = i;};//i from full PYTHIA list
167 void putParentI2(int i) {parentI2_ = i;};//same; or i from genMu list if matched
168 void putParentPDGid(int i) {parentPDG = i;};
169 void defineParent(int i) {parentClass = defineParentClass(i);};
170 void putParentClass(int i) {parentClass = i;};
171
172 int getParentClass() {return parentClass;};
173 int getParentPDG() {return parentPDG;};
174 int getMatchedIndex() {return parentI_;};
175 double getDr() {return parentDR_;};
176
177 int type() {return type_;};
178 double d0() const {return d0_;};
179 double Chi2N() {return Chi2N_;};
180 double nHit() {return nHit_;};
181 double outZ() {return outZ_;};
182 double outR() {return outR_;};
183
184 bool robustLoose() {return robustLoose_;};
185 bool robustHighEnergy() {return robustHighEnergy_;};
186 bool robustTight() {return robustTight_;};
187 bool loose() {return loose_ ;};
188 bool tight() {return tight_;};
189 float simpleEleId95cIso() {return simpleEleId95cIso_;};
190 float simpleEleId90cIso() {return simpleEleId90cIso_;};
191 float simpleEleId85cIso() {return simpleEleId85cIso_;};
192 float simpleEleId80cIso() {return simpleEleId80cIso_;};
193 float simpleEleId70cIso() {return simpleEleId70cIso_;};
194 float simpleEleId60cIso() {return simpleEleId60cIso_;};
195 int IdRank(){
196 if (simpleEleId60cIso_==5 || simpleEleId60cIso_==7) return 60;
197 else if (simpleEleId70cIso_==5 || simpleEleId70cIso_==7) return 70;
198 else if (simpleEleId80cIso_==5 || simpleEleId80cIso_==7) return 80;
199 else if (simpleEleId85cIso_==5 || simpleEleId85cIso_==7) return 85;
200 else if (simpleEleId90cIso_==5 || simpleEleId90cIso_==7) return 90;
201 else if (simpleEleId95cIso_==5 || simpleEleId95cIso_==7) return 95;
202 else return 100;
203 };
204 void Set_simpleEleId95cIso(float f){simpleEleId95cIso_= f;};
205 void Set_simpleEleId90cIso(float f){simpleEleId90cIso_= f;};
206 void Set_simpleEleId85cIso(float f){simpleEleId85cIso_= f;};
207 void Set_simpleEleId80cIso(float f){simpleEleId80cIso_= f;};
208 void Set_simpleEleId70cIso(float f){simpleEleId70cIso_= f;};
209 void Set_simpleEleId60cIso(float f){simpleEleId60cIso_= f;};
210
211 void Set_superClusterSeedE1x5(double e1x5){_superClusterSeedE1x5=e1x5;};
212 void Set_superClusterSeedE5x5(double e5x5){_superClusterSeedE5x5=e5x5;};
213 void Set_fBrem(double fbrem){_fBrem = fbrem;};
214
215 void Set_eidRobustTight(bool b){robustTight_=b;};
216 void Set_eidRobustLoose(bool b){robustLoose_=b;};
217 void Set_eidTight(bool b){tight_=b;};
218 void Set_eidLoose(bool b){loose_=b;};
219 void Set_eidRobustHighEnergy(bool b){robustHighEnergy_=b;};
220
221 int isElectronTight();
222 int isElectronRobust();
223 int isElectronGood();
224
225 void SetGenPt(float a) {gen_pt=a;};
226 void SetGenEta(float a) {gen_eta=a;};
227 void SetGenPhi(float a) {gen_phi=a;};
228 void SetGenQ(int a) {gen_q = a;};
229 void SetGenIndex(int a){gen_index=a;};
230
231 float GetGenPt() {return gen_pt;};
232 float GetGenEta() {return gen_eta;};
233 float GetGenPhi() {return gen_phi;};
234 int GetGenQ() {return gen_q;};
235 int GetGenIndex(){return gen_index;};
236
237 bool isGsfCtfScPixChargeConsistent() const { return isGsfCtfScPixConsistent_ ; }
238 bool isGsfScPixChargeConsistent() const { return isGsfScPixConsistent_ ; }
239 bool isGsfCtfChargeConsistent() const { return isGsfCtfConsistent_ ; }
240 void SetGsfCtfScPixChargeConsistent(bool b) { isGsfCtfScPixConsistent_ = b; }
241 void SetGsfScPixChargeConsistent(bool b) { isGsfScPixConsistent_ = b ; }
242 void SetGsfCtfChargeConsistent(bool b) { isGsfCtfConsistent_ =b ; }
243
244 float superClusterEt()const {return superClusterEt_;};
245 void SetSuperClusterEt(float a){superClusterEt_=a;};
246
247 void SetEcalDriven(bool b) {ecalDriven_ = b ;};
248 bool isEcalDriven() {return ecalDriven_;};
249 void printRec(ofstream &fout);
250
251
252 void SetMissingHits(int n){nMissingHits_=n;};
253 void SetConvDist(float f){convDcot_=f;};
254 void SetConvDcot(float f){convDcot_=f;};
255 int GetMissingHits(){return nMissingHits_;};
256 float GetConvDist(){return convDcot_;};
257 float GetConvDcot(){return convDcot_;};
258
259 float sigmaIetaIeta(){return sigEtaEta_;};
260 float hOverE(){return HoE_;};
261 float dPhiIn(){return dPhi_;};
262 float dEtaIn(){return dEta_;};
263 };
264
265
266
267 #endif // #ifdef Electron_cxx