ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Electron.h
Revision: 1.30
Committed: Fri Mar 20 18:23:27 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.29: +2 -2 lines
Log Message:
Cosmetics

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.30 // $Id: Electron.h,v 1.29 2009/03/18 15:44:32 loizides Exp $
3 bendavid 1.1 //
4 paus 1.3 // Electron
5 bendavid 1.1 //
6 loizides 1.29 // This class holds information about reconstructed electrons from CMSSW.
7 bendavid 1.1 //
8 sixie 1.13 // Authors: C.Loizides, J.Bendavid, S.Xie
9 bendavid 1.1 //--------------------------------------------------------------------------------------------------
10    
11 loizides 1.23 #ifndef MITANA_DATATREE_ELECTRON_H
12     #define MITANA_DATATREE_ELECTRON_H
13 loizides 1.6
14 sixie 1.13 #include "MitAna/DataTree/interface/SuperCluster.h"
15 bendavid 1.11 #include "MitAna/DataTree/interface/ChargedParticle.h"
16 bendavid 1.24 #include "MitAna/DataCont/interface/Ref.h"
17 loizides 1.6
18 bendavid 1.1 namespace mithep
19     {
20 bendavid 1.11 class Electron : public ChargedParticle
21 bendavid 1.1 {
22     public:
23 loizides 1.22 Electron() : fESuperClusterOverP(0), fESeedClusterOverPout(0), fDeltaEtaSuperClTrkAtVtx(0),
24     fDeltaEtaSeedClTrkAtCalo(0), fDeltaPhiSuperClTrkAtVtx(0),
25 loizides 1.29 fDeltaPhiSeedClTrkAtCalo(0), fHadronicOverEm(0), fNumberOfClusters(0), fE33(0),
26 loizides 1.22 fE55(0), fCovEtaEta(0), fCoviEtaiEta(0), fCovEtaPhi(0), fCovPhiPhi(0),
27     fCaloIsolation(0), fCaloTowerIsolation(0), fTrackIsolation(0),
28     fEcalJurassicIsolation(0), fHcalJurassicIsolation(0), fPassLooseID(0),
29 loizides 1.29 fPassTightID(0), fIDLikelihood(0), fPIn(0), fPOut(0),
30     fIsEnergyScaleCorrected(0), fIsMomentumCorrected(0), fClassification(0) {}
31    
32     const Track *BestTrk() const;
33     Double_t CaloIsolation() const { return fCaloIsolation; }
34     Double_t CaloTowerIsolation() const { return fCaloTowerIsolation; }
35     Int_t Classification() const { return fClassification; }
36     Double_t CovEtaEta() const { return fCovEtaEta; }
37     Double_t CovEtaPhi() const { return fCovEtaPhi; }
38     Double_t CovPhiPhi() const { return fCovPhiPhi; }
39     Double_t CoviEtaiEta() const { return fCoviEtaiEta; }
40 loizides 1.27 Double_t DeltaEtaSuperClusterTrackAtVtx() const
41     { return fDeltaEtaSuperClTrkAtVtx; }
42     Double_t DeltaEtaSeedClusterTrackAtCalo() const
43     { return fDeltaEtaSeedClTrkAtCalo; }
44     Double_t DeltaPhiSuperClusterTrackAtVtx() const
45     { return fDeltaPhiSuperClTrkAtVtx; }
46     Double_t DeltaPhiSeedClusterTrackAtCalo() const
47     { return fDeltaPhiSeedClTrkAtCalo; }
48 loizides 1.29 Double_t E33() const { return fE33; }
49     Double_t E55() const { return fE55; }
50     Double_t EcalJurassicIsolation() const { return fEcalJurassicIsolation; }
51     Double_t ESuperClusterOverP() const { return fESuperClusterOverP; }
52     Double_t ESeedClusterOverPout() const { return fESeedClusterOverPout; }
53     Double_t ESeedClusterOverPIn() const;
54     const Track *GsfTrk() const { return fGsfTrackRef.Obj(); }
55 loizides 1.30 Double_t HadronicOverEm() const { return fHadronicOverEm; }
56 loizides 1.29 Bool_t HasGsfTrk() const { return fGsfTrackRef.IsValid(); }
57     Bool_t HasTrackerTrk() const { return fTrackerTrackRef.IsValid(); }
58     Bool_t HasSuperCluster() const { return fSuperClusterRef.IsValid(); }
59     Double_t HcalIsolation() const { return fHcalJurassicIsolation; }
60     Double_t IDLikelihood() const { return fIDLikelihood; }
61     Bool_t IsEnergyScaleCorrected() const { return fIsEnergyScaleCorrected; }
62     Bool_t IsMomentumCorrected() const { return fIsMomentumCorrected; }
63     Double_t NumberOfClusters() const { return fNumberOfClusters; }
64     EObjType ObjType() const { return kElectron; }
65     Double_t PassLooseID() const { return fPassLooseID; }
66     Double_t PassTightID() const { return fPassTightID; }
67     Double_t PIn() const { return fPIn; }
68     Double_t POut() const { return fPOut; }
69     const SuperCluster *SCluster() const { return fSuperClusterRef.Obj(); }
70     void SetCaloIsolation(Double_t caloiso) { fCaloIsolation = caloiso; }
71     void SetCaloTowerIsolation(Double_t tiso) { fCaloTowerIsolation = tiso; }
72     void SetClassification(Int_t x) { fClassification = x; }
73     void SetCovEtaEta(Double_t CovEtaEta) { fCovEtaEta = CovEtaEta; }
74     void SetCovEtaPhi(Double_t CovEtaPhi) { fCovEtaPhi = CovEtaPhi; }
75     void SetCovPhiPhi(Double_t CovPhiPhi) { fCovPhiPhi = CovPhiPhi; }
76     void SetCoviEtaiEta(Double_t CoviEtaiEta) { fCoviEtaiEta = CoviEtaiEta; }
77 loizides 1.27 void SetDeltaEtaSuperClusterTrackAtVtx(Double_t x)
78     { fDeltaEtaSuperClTrkAtVtx = x; }
79     void SetDeltaEtaSeedClusterTrackAtCalo(Double_t x)
80     { fDeltaEtaSeedClTrkAtCalo = x; }
81     void SetDeltaPhiSuperClusterTrackAtVtx(Double_t x)
82     { fDeltaPhiSuperClTrkAtVtx = x; }
83     void SetDeltaPhiSeedClusterTrackAtCalo(Double_t x)
84     { fDeltaPhiSeedClTrkAtCalo = x; }
85 loizides 1.29 void SetE33(Double_t E33) { fE33 = E33; }
86     void SetE55(Double_t E55) { fE55 = E55; }
87     void SetESeedClusterOverPout(Double_t x) { fESeedClusterOverPout = x; }
88     void SetESuperClusterOverP(Double_t x) { fESuperClusterOverP = x; }
89     void SetEcalJurassicIso(Double_t iso ) { fEcalJurassicIsolation = iso; }
90     void SetGsfTrk(const Track* t)
91     { fGsfTrackRef = t; ClearMom(); ClearCharge(); }
92     void SetHadronicOverEm(Double_t x) { fHadronicOverEm = x; }
93     void SetHcalIsolation(Double_t iso ) { fHcalJurassicIsolation = iso; }
94     void SetIDLikelihood(Double_t likelihood) { fIDLikelihood = likelihood; }
95     void SetIsEnergyScaleCorrected(Bool_t x) { fIsEnergyScaleCorrected = x; }
96     void SetIsMomentumCorrected(Bool_t x) { fIsMomentumCorrected = x; }
97     void SetNumberOfClusters(Double_t x) { fNumberOfClusters = x; }
98     void SetPIn(Double_t PIn) { fPIn = PIn; }
99     void SetPOut(Double_t POut) { fPOut = POut; }
100     void SetPassLooseID(Double_t passLooseID) { fPassLooseID = passLooseID; }
101     void SetPassTightID(Double_t passTightID) { fPassTightID = passTightID; }
102     void SetSuperCluster(const SuperCluster* sc)
103     { fSuperClusterRef = sc; ClearMom(); }
104     void SetTrackerTrk(const Track* t)
105     { fTrackerTrackRef = t; ClearMom(); ClearCharge(); }
106     void SetTrackIsolation(Double_t trkiso) { fTrackIsolation = trkiso; }
107     const Track *TrackerTrk() const { return fTrackerTrackRef.Obj(); }
108     Double_t TrackIsolation() const { return fTrackIsolation; }
109     const Track *Trk() const { return BestTrk(); }
110 sixie 1.13
111 loizides 1.8 protected:
112 loizides 1.29 Double_t GetMass() const { return 0.51099892e-3; }
113 loizides 1.27 void GetMom() const;
114 loizides 1.25
115 loizides 1.27 Ref<Track> fGsfTrackRef; //gsf track reference
116     Ref<Track> fTrackerTrackRef; //tracker track reference
117     Ref<SuperCluster> fSuperClusterRef; //reference to SuperCluster
118 loizides 1.29 Double32_t fESuperClusterOverP; //[0,0,14]super cluster e over p ratio
119     Double32_t fESeedClusterOverPout; //[0,0,14]seed cluster e over p mom
120     Double32_t fDeltaEtaSuperClTrkAtVtx; //[0,0,14]delta eta of super cluster with trk
121     Double32_t fDeltaEtaSeedClTrkAtCalo; //[0,0,14]delta eta of seeed cluster with trk
122     Double32_t fDeltaPhiSuperClTrkAtVtx; //[0,0,14]delta phi of super cluster with trk
123     Double32_t fDeltaPhiSeedClTrkAtCalo; //[0,0,14]delta phi of seeed cluster with trk
124     Double32_t fHadronicOverEm; //[0,0,14]hadronic over em fraction
125     Double32_t fNumberOfClusters; //[0,0,14]number of associated clusters
126     Double32_t fE33; //[0,0,14]3x3 crystal energy
127     Double32_t fE55; //[0,0,14]5x5 crystal energy
128     Double32_t fCovEtaEta; //[0,0,14]variance eta-eta
129     Double32_t fCoviEtaiEta; //[0,0,14]covariance eta-eta (in crystals)
130     Double32_t fCovEtaPhi; //[0,0,14]covariance eta-phi
131     Double32_t fCovPhiPhi; //[0,0,14]covariance phi-phi
132     Double32_t fCaloIsolation; //[0,0,14]isolation based on rechits
133     Double32_t fCaloTowerIsolation; //[0,0,14]isolation based on calo towers
134     Double32_t fTrackIsolation; //[0,0,14]isolation based on tracks
135     Double32_t fEcalJurassicIsolation; //[0,0,14]ecal jura iso
136     Double32_t fHcalJurassicIsolation; //[0,0,14]hcal jura iso
137     Double32_t fPassLooseID; //[0,0,14]pass loose id
138     Double32_t fPassTightID; //[0,0,14]pass tight id
139     Double32_t fIDLikelihood; //[0,0,14]likelihood value
140     Double32_t fPIn; //[0,0,14]momentum at vtx
141     Double32_t fPOut; //[0,0,14]momentum at ecal surface
142     Bool_t fIsEnergyScaleCorrected; //class dependent escale correction
143     Bool_t fIsMomentumCorrected; //class dependent E-p combination
144     Int_t fClassification; //classification (see GsfElectron.h)
145 sixie 1.13
146 loizides 1.7 ClassDef(Electron, 1) // Electron class
147 bendavid 1.1 };
148 loizides 1.4 }
149 loizides 1.8
150 loizides 1.9 //--------------------------------------------------------------------------------------------------
151 loizides 1.10 inline const mithep::Track *mithep::Electron::BestTrk() const
152 loizides 1.9 {
153 loizides 1.10 // Return "best" track.
154    
155 bendavid 1.24 if (HasGsfTrk())
156 loizides 1.10 return GsfTrk();
157 bendavid 1.24 else if (HasTrackerTrk())
158 loizides 1.10 return TrackerTrk();
159 loizides 1.9
160 loizides 1.10 return 0;
161 loizides 1.9 }
162    
163 loizides 1.25 //--------------------------------------------------------------------------------------------------
164     inline void mithep::Electron::GetMom() const
165 sixie 1.14 {
166 loizides 1.25 // Get momentum of the electron. We use the direction of the
167 loizides 1.22 // track and the energy of the SuperCluster.
168 sixie 1.14
169 loizides 1.25 const mithep::Track *trk = Trk();
170 sixie 1.15
171 loizides 1.25 if (!trk) {
172     fCachedMom.SetCoordinates(0,0,0,0);
173     return;
174     }
175 sixie 1.15
176 loizides 1.25 Double_t p = 0;
177     Double_t mass = GetMass();
178 bendavid 1.18
179     const mithep::SuperCluster *sc = SCluster();
180     if (sc)
181 loizides 1.25 p = TMath::Sqrt(sc->Energy()*sc->Energy() - mass*mass);
182 bendavid 1.18 else
183 loizides 1.25 p = trk->P();
184 loizides 1.22
185 loizides 1.25 Double_t pt = TMath::Abs(p*TMath::Cos(trk->Lambda()));
186     fCachedMom.SetCoordinates(pt,trk->Eta(),trk->Phi(),mass);
187 bendavid 1.18 }
188    
189     //-------------------------------------------------------------------------------------------------
190 loizides 1.25 inline Double_t mithep::Electron::ESeedClusterOverPIn() const
191 bendavid 1.18 {
192 loizides 1.25 // Return energy of the SuperCluster seed divided by the magnitude
193     // of the track momentum at the vertex.
194    
195     return SCluster()->Seed()->Energy() / PIn();
196 bendavid 1.18 }
197 loizides 1.8 #endif