ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Electron.h
Revision: 1.17
Committed: Tue Sep 9 12:50:43 2008 UTC (16 years, 8 months ago) by sixie
Content type: text/plain
Branch: MAIN
Changes since 1.16: +8 -5 lines
Log Message:
Add jurassic isolation calculation to Electron object.

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 sixie 1.17 // $Id: Electron.h,v 1.16 2008/09/06 18:03:23 sixie 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     Double_t E() const {return SCluster()->Energy(); }
32    
33 sixie 1.13 Double_t Mass() const { return 0.51099892e-3; }
34     Double_t ESuperClusterOverP() const { return fESuperClusterOverP; }
35     Double_t ESeedClusterOverPout() const { return fESeedClusterOverPout; }
36 sixie 1.15 Double_t ESeedClusterOverPIn() const;
37     Double_t PIn() const { return fPIn; }
38     Double_t POut() const { return fPOut; }
39 sixie 1.13 Double_t DeltaEtaSuperClusterTrackAtVtx() const { return fDeltaEtaSuperClTrkAtVtx; }
40     Double_t DeltaEtaSeedClusterTrackAtCalo() const { return fDeltaEtaSeedClTrkAtCalo; }
41     Double_t DeltaPhiSuperClusterTrackAtVtx() const { return fDeltaPhiSuperClTrkAtVtx; }
42     Double_t DeltaPhiSeedClusterTrackAtCalo() const { return fDeltaPhiSeedClTrkAtCalo; }
43     Double_t HadronicOverEm() const { return fHadronicOverEm; }
44     Double_t IsEnergyScaleCorrected() const { return fIsEnergyScaleCorrected; }
45     Double_t IsMomentumCorrected() const { return fIsMomentumCorrected; }
46     Double_t NumberOfClusters() const { return fNumberOfClusters; }
47     Double_t Classification() const { return fClassification; }
48     Double_t E33() const { return fE33; }
49     Double_t E55() const { return fE55; }
50     Double_t CovEtaEta() const { return fCovEtaEta; }
51     Double_t CovEtaPhi() const { return fCovEtaPhi; }
52     Double_t CovPhiPhi() const { return fCovPhiPhi; }
53     Double_t CaloIsolation() const { return fCaloIsolation; }
54 sixie 1.16 Double_t CaloTowerIsolation() const { return fCaloTowerIsolation; }
55 sixie 1.13 Double_t TrackIsolation() const { return fTrackIsolation; }
56 sixie 1.17 Double_t EcalJurassicIsolation() const { return fEcalJurassicIsolation; }
57     Double_t HcalJurassicIsolation() const { return fHcalJurassicIsolation; }
58    
59 sixie 1.15 Double_t PassLooseID() const { return fPassLooseID; }
60     Double_t PassTightID() const { return fPassTightID; }
61     Double_t IDLikelihood() const { return fIDLikelihood; }
62 sixie 1.13
63     void SetGsfTrk(Track* t) { fGsfTrackRef = t; }
64     void SetTrackerTrk(Track* t) { fTrackerTrackRef = t; }
65     void SetSuperCluster(SuperCluster* sc) { fSuperClusterRef = sc; }
66     void SetESuperClusterOverP(Double_t x) { fESuperClusterOverP = x; }
67     void SetESeedClusterOverPout(Double_t x) { fESeedClusterOverPout = x; }
68 sixie 1.15 void SetPIn(Double_t PIn) { fPIn = PIn; }
69     void SetPOut(Double_t POut) { fPOut = POut; }
70 sixie 1.13 void SetDeltaEtaSuperClusterTrackAtVtx(Double_t x) { fDeltaEtaSuperClTrkAtVtx = x; }
71     void SetDeltaEtaSeedClusterTrackAtCalo(Double_t x) { fDeltaEtaSeedClTrkAtCalo = x; }
72     void SetDeltaPhiSuperClusterTrackAtVtx(Double_t x) { fDeltaPhiSuperClTrkAtVtx = x; }
73     void SetDeltaPhiSeedClusterTrackAtCalo(Double_t x) { fDeltaPhiSeedClTrkAtCalo = x; }
74     void SetHadronicOverEm(Double_t x) { fHadronicOverEm = x; }
75     void SetIsEnergyScaleCorrected(Double_t x) { fIsEnergyScaleCorrected = x; }
76     void SetIsMomentumCorrected(Double_t x) { fIsMomentumCorrected = x; }
77     void SetNumberOfClusters(Double_t x) { fNumberOfClusters = x; }
78     void SetClassification(Double_t x) { fClassification = x; }
79     void SetE33(Double_t E33) { fE33 = E33; }
80     void SetE55(Double_t E55) { fE55 = E55; }
81     void SetCovEtaEta(Double_t CovEtaEta) { fCovEtaEta = CovEtaEta; }
82     void SetCovEtaPhi(Double_t CovEtaPhi) { fCovEtaPhi = CovEtaPhi; }
83     void SetCovPhiPhi(Double_t CovPhiPhi) { fCovPhiPhi = CovPhiPhi; }
84     void SetCaloIsolation(Double_t CaloIsolation) { fCaloIsolation = CaloIsolation; }
85 sixie 1.16 void SetCaloTowerIsolation(Double_t TowerIso) { fCaloTowerIsolation = TowerIso; }
86 sixie 1.13 void SetTrackIsolation(Double_t TrackIsolation) { fTrackIsolation = TrackIsolation;}
87 sixie 1.17 void SetEcalJurassicIsolation(Double_t iso ) { fEcalJurassicIsolation = iso; }
88     void SetHcalJurassicIsolation(Double_t iso ) { fHcalJurassicIsolation = iso; }
89 sixie 1.15 void SetPassLooseID(Double_t passLooseID) { fPassLooseID = passLooseID; }
90     void SetPassTightID(Double_t passTightID) { fPassTightID = passTightID; }
91     void SetIDLikelihood(Double_t likelihood) { fIDLikelihood = likelihood; }
92 sixie 1.13
93 loizides 1.8 protected:
94 loizides 1.9 TRef fGsfTrackRef; //global combined track reference
95     TRef fTrackerTrackRef; //tracker track reference
96 sixie 1.13 TRef fSuperClusterRef; //superCluster
97    
98     Double_t fESuperClusterOverP;
99     Double_t fESeedClusterOverPout;
100     Double_t fDeltaEtaSuperClTrkAtVtx;
101     Double_t fDeltaEtaSeedClTrkAtCalo;
102     Double_t fDeltaPhiSuperClTrkAtVtx;
103     Double_t fDeltaPhiSeedClTrkAtCalo;
104     Double_t fHadronicOverEm;
105     Double_t fIsEnergyScaleCorrected;
106     Double_t fIsMomentumCorrected;
107     Double_t fNumberOfClusters;
108     Double_t fClassification;
109     Double_t fE33;
110     Double_t fE55;
111     Double_t fCovEtaEta;
112     Double_t fCovEtaPhi;
113     Double_t fCovPhiPhi;
114     Double_t fCaloIsolation;
115 sixie 1.16 Double_t fCaloTowerIsolation;
116 sixie 1.13 Double_t fTrackIsolation;
117 sixie 1.17 Double_t fEcalJurassicIsolation;
118     Double_t fHcalJurassicIsolation;
119 sixie 1.15 Double_t fPassLooseID;
120     Double_t fPassTightID;
121     Double_t fIDLikelihood;
122     Double_t fPIn;
123     Double_t fPOut;
124 sixie 1.13
125 loizides 1.7 ClassDef(Electron, 1) // Electron class
126 bendavid 1.1 };
127 loizides 1.4 }
128 loizides 1.8
129 loizides 1.9 //--------------------------------------------------------------------------------------------------
130 loizides 1.10 inline const mithep::Track *mithep::Electron::BestTrk() const
131 loizides 1.9 {
132 loizides 1.10 // Return "best" track.
133    
134     if (GsfTrk())
135     return GsfTrk();
136     else if (TrackerTrk())
137     return TrackerTrk();
138 loizides 1.9
139 loizides 1.10 return 0;
140 loizides 1.9 }
141    
142     //--------------------------------------------------------------------------------------------------
143 loizides 1.10 inline const mithep::Track *mithep::Electron::GsfTrk() const
144 loizides 1.9 {
145 loizides 1.10 // Return global combined track.
146 loizides 1.9
147 loizides 1.10 return static_cast<const Track*>(fGsfTrackRef.GetObject());
148 loizides 1.9 }
149    
150     //--------------------------------------------------------------------------------------------------
151 loizides 1.10 inline const mithep::Track *mithep::Electron::TrackerTrk() const
152 loizides 1.9 {
153 loizides 1.10 // Return tracker track.
154 loizides 1.9
155 loizides 1.10 return static_cast<const Track*>(fTrackerTrackRef.GetObject());
156 loizides 1.9 }
157 sixie 1.13 //--------------------------------------------------------------------------------------------------
158     inline const mithep::SuperCluster *mithep::Electron::SCluster() const
159     {
160     // Return Super cluster
161    
162     return static_cast<const SuperCluster*>(fSuperClusterRef.GetObject());
163     }
164 sixie 1.14
165     //-------------------------------------------------------------------------------------------------
166     inline mithep::FourVector mithep::Electron::Mom() const
167     {
168     // Return Momentum of the electron. We use the direction of the
169     // Track and the Energy of the Super Cluster
170    
171     double P = TMath::Sqrt( E()*E() - Mass()*Mass());
172     return FourVector(P*sin(Trk()->Theta())*cos(Trk()->Phi()),
173     P*sin(Trk()->Theta())*sin(Trk()->Phi()), P*cos(Trk()->Theta()), E());
174     }
175 sixie 1.15
176     inline Double_t mithep::Electron::ESeedClusterOverPIn() const
177     {
178     // Return Energy of the SuperCluster Seed Divided by the magnitude
179     // of the track momentum at the vertex
180    
181     return SCluster()->Seed()->Energy() / PIn();
182     }
183    
184    
185 loizides 1.8 #endif
186 sixie 1.15