ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/PollackPrograms/src/TCElectron.cc
(Generate patch)

Comparing UserCode/PollackPrograms/src/TCElectron.cc (file contents):
Revision 1.1 by bpollack, Tue Jul 24 20:24:55 2012 UTC vs.
Revision 1.2 by bpollack, Wed Feb 20 21:39:43 2013 UTC

# Line 1 | Line 1
1   #include "TCElectron.h"
2   #include <iostream>
3 #include <map>
4 #include <utility>
5 #include <string>
6
3  
4   TCElectron::TCElectron() {
5   }
# Line 11 | Line 7 | TCElectron::TCElectron() {
7   TCElectron::~TCElectron() {
8   }
9  
10 < using namespace std;
10 >
11  
12   // "get" methods -------------------------------------
13  
14 < map<string, float> TCElectron::ElectronMap() {
15 <  return _ElectronTrueMap;
14 > float TCElectron::R9() const { return _r9; }
15 >
16 > float TCElectron::PtError() const {
17 >  return _ptError;
18   }
19  
20 < TVector2 TCElectron::P2() const {
21 <  TVector2 v2(this->Px(), this->Py());
24 <  return v2;
20 > int TCElectron::NumberOfValidPixelHits() const {
21 >  return _numberOfValidPixelHits;
22   }
23  
24 < TVector3 TCElectron::Vtx() const {
25 <   return _vtx;
24 > int TCElectron::NumberOfValidTrackerHits() const {
25 >  return _numberOfValidTrackerHits;
26   }
27  
28 < float TCElectron::PtError() const {
29 <  return _ptError;
28 > int TCElectron::NumberOfLostPixelHits() const {
29 >  return _numberOfLostPixelHits;
30 > }
31 >
32 > int TCElectron::NumberOfLostTrackerHits() const {
33 >  return _numberOfLostTrackerHits;
34 > }
35 >
36 > float TCElectron::NormalizedChi2() const {
37 >  return _normalizedChi2;
38 > }
39 >
40 > bool TCElectron::ConversionVeto() const {
41 >    return _convVeto;
42   }
43  
44 < int TCElectron::Charge() const {
45 <   return _charge;
44 > short TCElectron::ConversionMissHits() const {
45 >    return _convMissHits;
46   }
47  
48 + float TCElectron::SCEta() const {
49 +    return _scEta;
50 + }
51  
52   bool TCElectron::IsEB() const {
53    return _isEB;
# Line 49 | Line 61 | bool TCElectron::IsInGap() const {
61    return _isInGap;
62   }
63  
64 + float TCElectron::HadOverEm() const {
65 +  return _hadOverEm;
66 + }
67 + float TCElectron::DphiSuperCluster() const {
68 +  return _dPhiSuperCluster;
69 + }
70 + float TCElectron::DetaSuperCluster() const {
71 +  return _dEtaSuperCluster;
72 + }
73 + float TCElectron::SigmaIEtaIEta() const {
74 +  return _sigmaIetaIeta;
75 + }
76 +
77 + float TCElectron::EOverP() const {
78 +    return _eOverP;
79 + }
80 +
81 + float TCElectron::FBrem() const {
82 +    return _fBrem;
83 + }
84  
85   int TCElectron::CutLevel(int lvl) const{
86    if(lvl==95){
# Line 86 | Line 118 | bool TCElectron::PassConversion(int lvl)
118    else return false;
119   }
120  
121 <
122 < float TCElectron::Dxy(TVector3 *primVtx) const {
91 <  //Calculating track dxy parameter wrt primary vertex
92 <  //d0 = - dxy
93 <  float vx = _vtx.X(), vy = _vtx.Y();
94 <  float px = this->Px(), py = this->Py(), pt = this->Pt();
95 <  float pvx = primVtx->X(), pvy = primVtx->Y();
96 <  float ret =  (-(vx-pvx)*py + (vy-pvy)*px)/pt;
97 <  return ret;
98 < }
99 <
100 < float TCElectron::Dz(TVector3 *primVtx) const {
101 <  //Calculating track dz parameter wrt primary vertex
102 <  float vx = _vtx.X(), vy = _vtx.Y(), vz = _vtx.Z();
103 <  float px = this->Px(), py = this->Py();
104 <  float pz = this->Pz(), pt = this->Pt();
105 <  float pvx = primVtx->X(), pvy = primVtx->Y(), pvz = primVtx->Z();
106 <  float ret =  (vz-pvz)-((vx-pvx)*px +(vy-pvy)*py)/pt*(pz/pt);
107 <  return ret;
121 > TLorentzVector TCElectron::RegressionMomCombP4() const {
122 >  return _regressionMomCombP4;
123   }
124  
125   //------------------------------------------------
# Line 112 | Line 127 | float TCElectron::Dz(TVector3 *primVtx)
127   //------------------------------------------------------------------------
128  
129  
130 < void TCElectron::LoadMap(vector<string> svec){
131 <  //Strings take a lot of memory, so call this to load the cut names into the muon class
132 <  //when you start running your analyzer, otherwise MuonMap will return an empty map
133 <    for (unsigned int i=0; i<_ElectronIndexMap.size(); i++)
134 <    {
135 <    _ElectronTrueMap[svec[i]] = _ElectronIndexMap[i];
136 <    }
137 < }
138 <
139 < void TCElectron::SetMap(string s, float v, vector<string>* svec){
140 <  //set the index map internally and the name map externally, for memory saving
141 <  for (unsigned int i = 0; i<svec->size(); i++){
142 <    if (s.compare(svec->at(i)) ==0){
143 <      _ElectronIndexMap[i] = v;
144 <      return;
130 <    }
131 <  }
132 <  svec->push_back(s);
133 <  _ElectronIndexMap[svec->size()-1] = v;
130 > void TCElectron::SetR9(float r){ _r9 = r; }
131 >
132 > void TCElectron::SetPtError(float e) {
133 >  _ptError = e;
134 > }
135 > void TCElectron::SetNumberOfValidPixelHits(int n) {
136 >  _numberOfValidPixelHits = n;
137 > }
138 >
139 > void TCElectron::SetNumberOfValidTrackerHits(int n) {
140 >  _numberOfValidTrackerHits = n;
141 > }
142 >
143 > void TCElectron::SetNumberOfLostPixelHits(int n) {
144 >  _numberOfLostPixelHits = n;
145   }
146  
147 < void TCElectron::SetVtx(float vx, float vy, float vz) {
148 <  TVector3 v3(vx, vy, vz);
138 <  _vtx = v3;
147 > void TCElectron::SetNumberOfLostTrackerHits(int n) {
148 >  _numberOfLostTrackerHits = n;
149   }
150  
151 + void TCElectron::SetNormalizedChi2(float n) {
152 +  _normalizedChi2 = n;
153 + }
154 +
155 + void TCElectron::SetHadOverEm(float he){
156 +  _hadOverEm = he;
157 + }
158 + void TCElectron::SetDphiSuperCluster(float dp){
159 +  _dPhiSuperCluster = dp;
160 + }
161 + void TCElectron::SetDetaSuperCluster(float de){
162 +  _dEtaSuperCluster = de;
163 + }
164  
165 < void TCElectron::SetCharge(int c){
166 <  _charge = c;
165 > void TCElectron::SetSigmaIEtaIEta(float sieie){
166 >  _sigmaIetaIeta = sieie;
167   }
168  
169 + void TCElectron::SetEOverP(float e)
170 + {
171 +    _eOverP = e;
172 + }
173 +
174 + void TCElectron::SetFBrem(float fb)
175 + {
176 +    _fBrem = fb;
177 + }
178 +
179 + void TCElectron::SetSCEta(float e)
180 + {
181 +    _scEta = e;
182 + }
183 +
184 + void TCElectron::SetConversionVeto(bool v) {
185 +  _convVeto = v;
186 + }
187 +
188 + void TCElectron::SetConversionMissHits(short m) {
189 +  _convMissHits = m;
190 + }
191  
192   void TCElectron::SetIsEB(bool b) {
193    _isEB = b;
# Line 171 | Line 216 | void TCElectron::SetCutLevel(int cut, in
216      _cut60 = cut;
217    }
218   }
219 +
220 + void TCElectron::SetRegressionMomCombP4(TLorentzVector tmpP4){
221 +  _regressionMomCombP4 = tmpP4;
222 + }
223 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines