ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Electron.h
Revision: 1.19
Committed: Wed Nov 12 18:56:24 2008 UTC (16 years, 5 months ago) by peveraer
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006
Changes since 1.18: +4 -1 lines
Log Message:
Added sigmaiEtaiEta

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 peveraer 1.19 // $Id: Electron.h,v 1.18 2008/09/12 12:44:57 bendavid Exp $
3 bendavid 1.1 //
4 paus 1.3 // Electron
5 bendavid 1.1 //
6     // Details to be worked out...
7     //
8 sixie 1.13 // Authors: C.Loizides, J.Bendavid, S.Xie
9 bendavid 1.1 //--------------------------------------------------------------------------------------------------
10    
11 loizides 1.6 #ifndef DATATREE_ELECTRON_H
12     #define DATATREE_ELECTRON_H
13    
14 sixie 1.13 #include "MitAna/DataTree/interface/SuperCluster.h"
15 bendavid 1.11 #include "MitAna/DataTree/interface/ChargedParticle.h"
16 loizides 1.6
17 bendavid 1.1 namespace mithep
18     {
19 bendavid 1.11 class Electron : public ChargedParticle
20 bendavid 1.1 {
21     public:
22     Electron() {}
23     ~Electron() {}
24    
25 sixie 1.14 const Track *BestTrk() const;
26     const Track *GsfTrk() const;
27     const Track *TrackerTrk() const;
28     const SuperCluster *SCluster() const;
29     FourVector Mom() const;
30     const Track *Trk() const { return BestTrk(); }
31 bendavid 1.18 Double_t E() const;
32     Double_t P() const;
33     Double_t Pt() const;
34     Double_t Px() const;
35     Double_t Py() const;
36     Double_t Pz() const;
37 sixie 1.14
38 sixie 1.13 Double_t Mass() const { return 0.51099892e-3; }
39     Double_t ESuperClusterOverP() const { return fESuperClusterOverP; }
40     Double_t ESeedClusterOverPout() const { return fESeedClusterOverPout; }
41 sixie 1.15 Double_t ESeedClusterOverPIn() const;
42     Double_t PIn() const { return fPIn; }
43     Double_t POut() const { return fPOut; }
44 sixie 1.13 Double_t DeltaEtaSuperClusterTrackAtVtx() const { return fDeltaEtaSuperClTrkAtVtx; }
45     Double_t DeltaEtaSeedClusterTrackAtCalo() const { return fDeltaEtaSeedClTrkAtCalo; }
46     Double_t DeltaPhiSuperClusterTrackAtVtx() const { return fDeltaPhiSuperClTrkAtVtx; }
47     Double_t DeltaPhiSeedClusterTrackAtCalo() const { return fDeltaPhiSeedClTrkAtCalo; }
48     Double_t HadronicOverEm() const { return fHadronicOverEm; }
49     Double_t IsEnergyScaleCorrected() const { return fIsEnergyScaleCorrected; }
50     Double_t IsMomentumCorrected() const { return fIsMomentumCorrected; }
51     Double_t NumberOfClusters() const { return fNumberOfClusters; }
52     Double_t Classification() const { return fClassification; }
53     Double_t E33() const { return fE33; }
54     Double_t E55() const { return fE55; }
55     Double_t CovEtaEta() const { return fCovEtaEta; }
56     Double_t CovEtaPhi() const { return fCovEtaPhi; }
57     Double_t CovPhiPhi() const { return fCovPhiPhi; }
58 peveraer 1.19 Double_t CoviEtaiEta() const { return fCoviEtaiEta; }
59 sixie 1.13 Double_t CaloIsolation() const { return fCaloIsolation; }
60 sixie 1.16 Double_t CaloTowerIsolation() const { return fCaloTowerIsolation; }
61 sixie 1.13 Double_t TrackIsolation() const { return fTrackIsolation; }
62 sixie 1.17 Double_t EcalJurassicIsolation() const { return fEcalJurassicIsolation; }
63     Double_t HcalJurassicIsolation() const { return fHcalJurassicIsolation; }
64    
65 sixie 1.15 Double_t PassLooseID() const { return fPassLooseID; }
66     Double_t PassTightID() const { return fPassTightID; }
67     Double_t IDLikelihood() const { return fIDLikelihood; }
68 sixie 1.13
69     void SetGsfTrk(Track* t) { fGsfTrackRef = t; }
70     void SetTrackerTrk(Track* t) { fTrackerTrackRef = t; }
71     void SetSuperCluster(SuperCluster* sc) { fSuperClusterRef = sc; }
72     void SetESuperClusterOverP(Double_t x) { fESuperClusterOverP = x; }
73     void SetESeedClusterOverPout(Double_t x) { fESeedClusterOverPout = x; }
74 sixie 1.15 void SetPIn(Double_t PIn) { fPIn = PIn; }
75     void SetPOut(Double_t POut) { fPOut = POut; }
76 sixie 1.13 void SetDeltaEtaSuperClusterTrackAtVtx(Double_t x) { fDeltaEtaSuperClTrkAtVtx = x; }
77     void SetDeltaEtaSeedClusterTrackAtCalo(Double_t x) { fDeltaEtaSeedClTrkAtCalo = x; }
78     void SetDeltaPhiSuperClusterTrackAtVtx(Double_t x) { fDeltaPhiSuperClTrkAtVtx = x; }
79     void SetDeltaPhiSeedClusterTrackAtCalo(Double_t x) { fDeltaPhiSeedClTrkAtCalo = x; }
80     void SetHadronicOverEm(Double_t x) { fHadronicOverEm = x; }
81     void SetIsEnergyScaleCorrected(Double_t x) { fIsEnergyScaleCorrected = x; }
82     void SetIsMomentumCorrected(Double_t x) { fIsMomentumCorrected = x; }
83     void SetNumberOfClusters(Double_t x) { fNumberOfClusters = x; }
84     void SetClassification(Double_t x) { fClassification = x; }
85     void SetE33(Double_t E33) { fE33 = E33; }
86     void SetE55(Double_t E55) { fE55 = E55; }
87     void SetCovEtaEta(Double_t CovEtaEta) { fCovEtaEta = CovEtaEta; }
88     void SetCovEtaPhi(Double_t CovEtaPhi) { fCovEtaPhi = CovEtaPhi; }
89     void SetCovPhiPhi(Double_t CovPhiPhi) { fCovPhiPhi = CovPhiPhi; }
90 peveraer 1.19 void SetCoviEtaiEta(Double_t CoviEtaiEta) { fCoviEtaiEta = CoviEtaiEta; }
91 sixie 1.13 void SetCaloIsolation(Double_t CaloIsolation) { fCaloIsolation = CaloIsolation; }
92 sixie 1.16 void SetCaloTowerIsolation(Double_t TowerIso) { fCaloTowerIsolation = TowerIso; }
93 sixie 1.13 void SetTrackIsolation(Double_t TrackIsolation) { fTrackIsolation = TrackIsolation;}
94 sixie 1.17 void SetEcalJurassicIsolation(Double_t iso ) { fEcalJurassicIsolation = iso; }
95     void SetHcalJurassicIsolation(Double_t iso ) { fHcalJurassicIsolation = iso; }
96 sixie 1.15 void SetPassLooseID(Double_t passLooseID) { fPassLooseID = passLooseID; }
97     void SetPassTightID(Double_t passTightID) { fPassTightID = passTightID; }
98     void SetIDLikelihood(Double_t likelihood) { fIDLikelihood = likelihood; }
99 sixie 1.13
100 loizides 1.8 protected:
101 loizides 1.9 TRef fGsfTrackRef; //global combined track reference
102     TRef fTrackerTrackRef; //tracker track reference
103 sixie 1.13 TRef fSuperClusterRef; //superCluster
104    
105     Double_t fESuperClusterOverP;
106     Double_t fESeedClusterOverPout;
107     Double_t fDeltaEtaSuperClTrkAtVtx;
108     Double_t fDeltaEtaSeedClTrkAtCalo;
109     Double_t fDeltaPhiSuperClTrkAtVtx;
110     Double_t fDeltaPhiSeedClTrkAtCalo;
111     Double_t fHadronicOverEm;
112     Double_t fIsEnergyScaleCorrected;
113     Double_t fIsMomentumCorrected;
114     Double_t fNumberOfClusters;
115     Double_t fClassification;
116     Double_t fE33;
117     Double_t fE55;
118     Double_t fCovEtaEta;
119 peveraer 1.19 Double_t fCoviEtaiEta;
120 sixie 1.13 Double_t fCovEtaPhi;
121     Double_t fCovPhiPhi;
122     Double_t fCaloIsolation;
123 sixie 1.16 Double_t fCaloTowerIsolation;
124 sixie 1.13 Double_t fTrackIsolation;
125 sixie 1.17 Double_t fEcalJurassicIsolation;
126     Double_t fHcalJurassicIsolation;
127 sixie 1.15 Double_t fPassLooseID;
128     Double_t fPassTightID;
129     Double_t fIDLikelihood;
130     Double_t fPIn;
131     Double_t fPOut;
132 sixie 1.13
133 loizides 1.7 ClassDef(Electron, 1) // Electron class
134 bendavid 1.1 };
135 loizides 1.4 }
136 loizides 1.8
137 loizides 1.9 //--------------------------------------------------------------------------------------------------
138 loizides 1.10 inline const mithep::Track *mithep::Electron::BestTrk() const
139 loizides 1.9 {
140 loizides 1.10 // Return "best" track.
141    
142     if (GsfTrk())
143     return GsfTrk();
144     else if (TrackerTrk())
145     return TrackerTrk();
146 loizides 1.9
147 loizides 1.10 return 0;
148 loizides 1.9 }
149    
150     //--------------------------------------------------------------------------------------------------
151 loizides 1.10 inline const mithep::Track *mithep::Electron::GsfTrk() const
152 loizides 1.9 {
153 loizides 1.10 // Return global combined track.
154 loizides 1.9
155 loizides 1.10 return static_cast<const Track*>(fGsfTrackRef.GetObject());
156 loizides 1.9 }
157    
158     //--------------------------------------------------------------------------------------------------
159 loizides 1.10 inline const mithep::Track *mithep::Electron::TrackerTrk() const
160 loizides 1.9 {
161 loizides 1.10 // Return tracker track.
162 loizides 1.9
163 loizides 1.10 return static_cast<const Track*>(fTrackerTrackRef.GetObject());
164 loizides 1.9 }
165 sixie 1.13 //--------------------------------------------------------------------------------------------------
166     inline const mithep::SuperCluster *mithep::Electron::SCluster() const
167     {
168     // Return Super cluster
169    
170     return static_cast<const SuperCluster*>(fSuperClusterRef.GetObject());
171     }
172 sixie 1.14
173     //-------------------------------------------------------------------------------------------------
174     inline mithep::FourVector mithep::Electron::Mom() const
175     {
176     // Return Momentum of the electron. We use the direction of the
177     // Track and the Energy of the Super Cluster
178    
179 bendavid 1.18 return FourVector(Px(), Py(), Pz(), E());
180 sixie 1.14 }
181 sixie 1.15
182 bendavid 1.18 //-------------------------------------------------------------------------------------------------
183 sixie 1.15 inline Double_t mithep::Electron::ESeedClusterOverPIn() const
184     {
185     // Return Energy of the SuperCluster Seed Divided by the magnitude
186     // of the track momentum at the vertex
187    
188     return SCluster()->Seed()->Energy() / PIn();
189     }
190    
191 bendavid 1.18 //-------------------------------------------------------------------------------------------------
192     inline Double_t mithep::Electron::E() const
193     {
194     // Return Energy of the SuperCluster if present
195     // or else return energy derived from the track
196    
197     const mithep::SuperCluster *sc = SCluster();
198     if (sc)
199     return sc->Energy();
200     else
201     return TMath::Sqrt(Trk()->P()*Trk()->P() + Mass()*Mass());
202     }
203    
204     //-------------------------------------------------------------------------------------------------
205     inline Double_t mithep::Electron::P() const
206     {
207     // Return momentum derived from the SuperCluster if present
208     // or else return momentum from the track
209    
210     const mithep::SuperCluster *sc = SCluster();
211     if (sc)
212     return TMath::Sqrt(sc->Energy()*sc->Energy() - Mass()*Mass());
213     else
214     return Trk()->P();
215     }
216    
217     //-------------------------------------------------------------------------------------------------
218     inline Double_t mithep::Electron::Px() const
219     {
220     return Pt()*TMath::Cos(Trk()->Phi());
221     }
222    
223     //-------------------------------------------------------------------------------------------------
224     inline Double_t mithep::Electron::Py() const
225     {
226     return Pt()*TMath::Sin(Trk()->Phi());
227     }
228 sixie 1.15
229 bendavid 1.18 //-------------------------------------------------------------------------------------------------
230     inline Double_t mithep::Electron::Pz() const
231     {
232     return P()*TMath::Sin(Trk()->Lambda());
233     }
234    
235     //-------------------------------------------------------------------------------------------------
236     inline Double_t mithep::Electron::Pt() const
237     {
238     return TMath::Abs(P()*TMath::Cos(Trk()->Lambda()));
239     }
240 loizides 1.8 #endif