3 |
|
// |
4 |
|
// Electron |
5 |
|
// |
6 |
< |
// Details to be worked out... TODO: Needs description ala Muon class |
6 |
> |
// This class holds information about reconstructed electrons from CMSSW. |
7 |
|
// |
8 |
|
// Authors: C.Loizides, J.Bendavid, S.Xie |
9 |
|
//-------------------------------------------------------------------------------------------------- |
22 |
|
public: |
23 |
|
Electron() : fESuperClusterOverP(0), fESeedClusterOverPout(0), fDeltaEtaSuperClTrkAtVtx(0), |
24 |
|
fDeltaEtaSeedClTrkAtCalo(0), fDeltaPhiSuperClTrkAtVtx(0), |
25 |
< |
fDeltaPhiSeedClTrkAtCalo(0), fHadronicOverEm(0), fIsEnergyScaleCorrected(0), |
26 |
< |
fIsMomentumCorrected(0), fNumberOfClusters(0), fClassification(0), fE33(0), |
25 |
> |
fDeltaPhiSeedClTrkAtCalo(0), fHadronicOverEm(0), fNumberOfClusters(0), fE33(0), |
26 |
|
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 |
< |
fPassTightID(0), fIDLikelihood(0), fPIn(0), fPOut(0) {} |
30 |
< |
|
31 |
< |
const Track *BestTrk() const; |
32 |
< |
const Track *GsfTrk() const { return fGsfTrackRef.Obj(); } |
33 |
< |
const Track *TrackerTrk() const { return fTrackerTrackRef.Obj(); } |
34 |
< |
const SuperCluster *SCluster() const { return fSuperClusterRef.Obj(); } |
35 |
< |
const Track *Trk() const { return BestTrk(); } |
36 |
< |
Double_t CaloIsolation() const { return fCaloIsolation; } |
37 |
< |
Double_t CaloTowerIsolation() const { return fCaloTowerIsolation; } |
38 |
< |
Double_t Classification() const { return fClassification; } |
39 |
< |
Double_t CovEtaEta() const { return fCovEtaEta; } |
41 |
< |
Double_t CovEtaPhi() const { return fCovEtaPhi; } |
42 |
< |
Double_t CovPhiPhi() const { return fCovPhiPhi; } |
43 |
< |
Double_t CoviEtaiEta() const { return fCoviEtaiEta; } |
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 |
|
Double_t DeltaEtaSuperClusterTrackAtVtx() const |
41 |
|
{ return fDeltaEtaSuperClTrkAtVtx; } |
42 |
|
Double_t DeltaEtaSeedClusterTrackAtCalo() const |
45 |
|
{ return fDeltaPhiSuperClTrkAtVtx; } |
46 |
|
Double_t DeltaPhiSeedClusterTrackAtCalo() const |
47 |
|
{ return fDeltaPhiSeedClTrkAtCalo; } |
48 |
< |
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 |
< |
Double_t IDLikelihood() const { return fIDLikelihood; } |
55 |
< |
Double_t IsEnergyScaleCorrected()const { return fIsEnergyScaleCorrected; } |
56 |
< |
Double_t IsMomentumCorrected() const { return fIsMomentumCorrected; } |
57 |
< |
Double_t HadronicOverEm() const { return fHadronicOverEm; } |
58 |
< |
Bool_t HasGsfTrk() const { return fGsfTrackRef.IsValid(); } |
59 |
< |
Bool_t HasTrackerTrk() const { return fTrackerTrackRef.IsValid(); } |
60 |
< |
Bool_t HasSuperCluster() const { return fSuperClusterRef.IsValid(); } |
61 |
< |
Double_t HcalIsolation() const { return fHcalJurassicIsolation; } |
62 |
< |
Double_t NumberOfClusters() const { return fNumberOfClusters; } |
63 |
< |
EObjType ObjType() const { return kElectron; } |
64 |
< |
Double_t PassLooseID() const { return fPassLooseID; } |
65 |
< |
Double_t PassTightID() const { return fPassTightID; } |
66 |
< |
Double_t PIn() const { return fPIn; } |
67 |
< |
Double_t POut() const { return fPOut; } |
68 |
< |
Double_t TrackIsolation() const { return fTrackIsolation; } |
69 |
< |
void SetGsfTrk(const Track* t) |
70 |
< |
{ fGsfTrackRef = t; ClearMom(); ClearCharge(); } |
71 |
< |
void SetTrackerTrk(const Track* t) |
72 |
< |
{ fTrackerTrackRef = t; ClearMom(); ClearCharge(); } |
73 |
< |
void SetSuperCluster(const SuperCluster* sc) |
74 |
< |
{ fSuperClusterRef = sc; ClearMom(); } |
75 |
< |
void SetCaloIsolation(Double_t caloiso) { fCaloIsolation = caloiso; } |
76 |
< |
void SetCaloTowerIsolation(Double_t tiso) { fCaloTowerIsolation = tiso; } |
77 |
< |
void SetClassification(Double_t x) { fClassification = x; } |
82 |
< |
void SetCovEtaEta(Double_t CovEtaEta) { fCovEtaEta = CovEtaEta; } |
83 |
< |
void SetCovEtaPhi(Double_t CovEtaPhi) { fCovEtaPhi = CovEtaPhi; } |
84 |
< |
void SetCovPhiPhi(Double_t CovPhiPhi) { fCovPhiPhi = CovPhiPhi; } |
85 |
< |
void SetCoviEtaiEta(Double_t CoviEtaiEta) { fCoviEtaiEta = CoviEtaiEta; } |
48 |
> |
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 |
> |
Double_t FBrem() const { return (PIn() - POut())/PIn(); } |
55 |
> |
const Track *GsfTrk() const { return fGsfTrackRef.Obj(); } |
56 |
> |
Double_t HadronicOverEm() const { return fHadronicOverEm; } |
57 |
> |
Bool_t HasGsfTrk() const { return fGsfTrackRef.IsValid(); } |
58 |
> |
Bool_t HasTrackerTrk() const { return fTrackerTrackRef.IsValid(); } |
59 |
> |
Bool_t HasSuperCluster() const { return fSuperClusterRef.IsValid(); } |
60 |
> |
Double_t HcalIsolation() const { return fHcalJurassicIsolation; } |
61 |
> |
Double_t IDLikelihood() const { return fIDLikelihood; } |
62 |
> |
Bool_t IsEnergyScaleCorrected() const { return fIsEnergyScaleCorrected; } |
63 |
> |
Bool_t IsMomentumCorrected() const { return fIsMomentumCorrected; } |
64 |
> |
Double_t NumberOfClusters() const { return fNumberOfClusters; } |
65 |
> |
EObjType ObjType() const { return kElectron; } |
66 |
> |
Double_t PassLooseID() const { return fPassLooseID; } |
67 |
> |
Double_t PassTightID() const { return fPassTightID; } |
68 |
> |
Double_t PIn() const { return fPIn; } |
69 |
> |
Double_t POut() const { return fPOut; } |
70 |
> |
const SuperCluster *SCluster() const { return fSuperClusterRef.Obj(); } |
71 |
> |
void SetCaloIsolation(Double_t caloiso) { fCaloIsolation = caloiso; } |
72 |
> |
void SetCaloTowerIsolation(Double_t tiso) { fCaloTowerIsolation = tiso; } |
73 |
> |
void SetClassification(Int_t x) { fClassification = x; } |
74 |
> |
void SetCovEtaEta(Double_t CovEtaEta) { fCovEtaEta = CovEtaEta; } |
75 |
> |
void SetCovEtaPhi(Double_t CovEtaPhi) { fCovEtaPhi = CovEtaPhi; } |
76 |
> |
void SetCovPhiPhi(Double_t CovPhiPhi) { fCovPhiPhi = CovPhiPhi; } |
77 |
> |
void SetCoviEtaiEta(Double_t CoviEtaiEta) { fCoviEtaiEta = CoviEtaiEta; } |
78 |
|
void SetDeltaEtaSuperClusterTrackAtVtx(Double_t x) |
79 |
|
{ fDeltaEtaSuperClTrkAtVtx = x; } |
80 |
|
void SetDeltaEtaSeedClusterTrackAtCalo(Double_t x) |
83 |
|
{ fDeltaPhiSuperClTrkAtVtx = x; } |
84 |
|
void SetDeltaPhiSeedClusterTrackAtCalo(Double_t x) |
85 |
|
{ fDeltaPhiSeedClTrkAtCalo = x; } |
86 |
< |
void SetE33(Double_t E33) { fE33 = E33; } |
87 |
< |
void SetE55(Double_t E55) { fE55 = E55; } |
88 |
< |
void SetEcalJurassicIso(Double_t iso ) { fEcalJurassicIsolation = iso; } |
89 |
< |
void SetESuperClusterOverP(Double_t x) { fESuperClusterOverP = x; } |
90 |
< |
void SetESeedClusterOverPout(Double_t x) { fESeedClusterOverPout = x; } |
91 |
< |
void SetHadronicOverEm(Double_t x) { fHadronicOverEm = x; } |
92 |
< |
void SetIDLikelihood(Double_t likelihood) { fIDLikelihood = likelihood; } |
93 |
< |
void SetIsEnergyScaleCorrected(Double_t x) { fIsEnergyScaleCorrected = x; } |
94 |
< |
void SetIsMomentumCorrected(Double_t x) { fIsMomentumCorrected = x; } |
95 |
< |
void SetHcalIsolation(Double_t iso ) { fHcalJurassicIsolation = iso; } |
96 |
< |
void SetNumberOfClusters(Double_t x) { fNumberOfClusters = x; } |
97 |
< |
void SetPassLooseID(Double_t passLooseID) { fPassLooseID = passLooseID; } |
98 |
< |
void SetPassTightID(Double_t passTightID) { fPassTightID = passTightID; } |
99 |
< |
void SetPIn(Double_t PIn) { fPIn = PIn; } |
100 |
< |
void SetPOut(Double_t POut) { fPOut = POut; } |
101 |
< |
void SetTrackIsolation(Double_t trkiso) { fTrackIsolation = trkiso; } |
86 |
> |
void SetE33(Double_t E33) { fE33 = E33; } |
87 |
> |
void SetE55(Double_t E55) { fE55 = E55; } |
88 |
> |
void SetESeedClusterOverPout(Double_t x) { fESeedClusterOverPout = x; } |
89 |
> |
void SetESuperClusterOverP(Double_t x) { fESuperClusterOverP = x; } |
90 |
> |
void SetEcalJurassicIso(Double_t iso ) { fEcalJurassicIsolation = iso; } |
91 |
> |
void SetGsfTrk(const Track* t) |
92 |
> |
{ fGsfTrackRef = t; ClearCharge(); } |
93 |
> |
void SetHadronicOverEm(Double_t x) { fHadronicOverEm = x; } |
94 |
> |
void SetHcalIsolation(Double_t iso ) { fHcalJurassicIsolation = iso; } |
95 |
> |
void SetIDLikelihood(Double_t likelihood) { fIDLikelihood = likelihood; } |
96 |
> |
void SetIsEnergyScaleCorrected(Bool_t x) { fIsEnergyScaleCorrected = x; } |
97 |
> |
void SetIsMomentumCorrected(Bool_t x) { fIsMomentumCorrected = x; } |
98 |
> |
void SetNumberOfClusters(Double_t x) { fNumberOfClusters = x; } |
99 |
> |
void SetPIn(Double_t PIn) { fPIn = PIn; } |
100 |
> |
void SetPOut(Double_t POut) { fPOut = POut; } |
101 |
> |
void SetPassLooseID(Double_t passLooseID) { fPassLooseID = passLooseID; } |
102 |
> |
void SetPassTightID(Double_t passTightID) { fPassTightID = passTightID; } |
103 |
> |
void SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi); |
104 |
> |
void SetSuperCluster(const SuperCluster* sc) |
105 |
> |
{ fSuperClusterRef = sc; } |
106 |
> |
void SetTrackerTrk(const Track* t) |
107 |
> |
{ fTrackerTrackRef = t; ClearCharge(); } |
108 |
> |
void SetTrackIsolation(Double_t trkiso) { fTrackIsolation = trkiso; } |
109 |
> |
const Track *TrackerTrk() const { return fTrackerTrackRef.Obj(); } |
110 |
> |
Double_t TrackIsolation() const { return fTrackIsolation; } |
111 |
> |
const Track *Trk() const { return BestTrk(); } |
112 |
|
|
113 |
|
protected: |
114 |
< |
Double_t GetMass() const { return 0.51099892e-3; } |
114 |
> |
Double_t GetMass() const { return 0.51099892e-3; } |
115 |
|
void GetMom() const; |
116 |
|
|
117 |
+ |
Vect3C fMom; //stored three-momentum |
118 |
|
Ref<Track> fGsfTrackRef; //gsf track reference |
119 |
|
Ref<Track> fTrackerTrackRef; //tracker track reference |
120 |
|
Ref<SuperCluster> fSuperClusterRef; //reference to SuperCluster |
121 |
< |
Double32_t fESuperClusterOverP; // |
122 |
< |
Double32_t fESeedClusterOverPout; // |
123 |
< |
Double32_t fDeltaEtaSuperClTrkAtVtx; // |
124 |
< |
Double32_t fDeltaEtaSeedClTrkAtCalo; // |
125 |
< |
Double32_t fDeltaPhiSuperClTrkAtVtx; // |
126 |
< |
Double32_t fDeltaPhiSeedClTrkAtCalo; // |
127 |
< |
Double32_t fHadronicOverEm; // |
128 |
< |
Double32_t fIsEnergyScaleCorrected; // |
129 |
< |
Double32_t fIsMomentumCorrected; // |
130 |
< |
Double32_t fNumberOfClusters; // |
131 |
< |
Double32_t fClassification; // |
132 |
< |
Double32_t fE33; // |
133 |
< |
Double32_t fE55; // |
134 |
< |
Double32_t fCovEtaEta; // |
135 |
< |
Double32_t fCoviEtaiEta; // |
136 |
< |
Double32_t fCovEtaPhi; // |
137 |
< |
Double32_t fCovPhiPhi; // |
138 |
< |
Double32_t fCaloIsolation; // |
139 |
< |
Double32_t fCaloTowerIsolation; // |
140 |
< |
Double32_t fTrackIsolation; // |
141 |
< |
Double32_t fEcalJurassicIsolation; // |
142 |
< |
Double32_t fHcalJurassicIsolation; // |
143 |
< |
Double32_t fPassLooseID; // |
144 |
< |
Double32_t fPassTightID; // |
145 |
< |
Double32_t fIDLikelihood; // |
146 |
< |
Double32_t fPIn; // |
147 |
< |
Double32_t fPOut; // |
121 |
> |
Double32_t fESuperClusterOverP; //[0,0,14]super cluster e over p ratio |
122 |
> |
Double32_t fESeedClusterOverPout; //[0,0,14]seed cluster e over p mom |
123 |
> |
Double32_t fDeltaEtaSuperClTrkAtVtx; //[0,0,14]delta eta of super cluster with trk |
124 |
> |
Double32_t fDeltaEtaSeedClTrkAtCalo; //[0,0,14]delta eta of seeed cluster with trk |
125 |
> |
Double32_t fDeltaPhiSuperClTrkAtVtx; //[0,0,14]delta phi of super cluster with trk |
126 |
> |
Double32_t fDeltaPhiSeedClTrkAtCalo; //[0,0,14]delta phi of seeed cluster with trk |
127 |
> |
Double32_t fHadronicOverEm; //[0,0,14]hadronic over em fraction |
128 |
> |
Double32_t fNumberOfClusters; //[0,0,14]number of associated clusters |
129 |
> |
Double32_t fE33; //[0,0,14]3x3 crystal energy |
130 |
> |
Double32_t fE55; //[0,0,14]5x5 crystal energy |
131 |
> |
Double32_t fCovEtaEta; //[0,0,14]variance eta-eta |
132 |
> |
Double32_t fCoviEtaiEta; //[0,0,14]covariance eta-eta (in crystals) |
133 |
> |
Double32_t fCovEtaPhi; //[0,0,14]covariance eta-phi |
134 |
> |
Double32_t fCovPhiPhi; //[0,0,14]covariance phi-phi |
135 |
> |
Double32_t fCaloIsolation; //[0,0,14]isolation based on rechits |
136 |
> |
Double32_t fCaloTowerIsolation; //[0,0,14]isolation based on calo towers |
137 |
> |
Double32_t fTrackIsolation; //[0,0,14]isolation based on tracks |
138 |
> |
Double32_t fEcalJurassicIsolation; //[0,0,14]ecal jura iso |
139 |
> |
Double32_t fHcalJurassicIsolation; //[0,0,14]hcal jura iso |
140 |
> |
Double32_t fPassLooseID; //[0,0,14]pass loose id |
141 |
> |
Double32_t fPassTightID; //[0,0,14]pass tight id |
142 |
> |
Double32_t fIDLikelihood; //[0,0,14]likelihood value |
143 |
> |
Double32_t fPIn; //[0,0,14]momentum at vtx |
144 |
> |
Double32_t fPOut; //[0,0,14]momentum at ecal surface |
145 |
> |
Bool_t fIsEnergyScaleCorrected; //class dependent escale correction |
146 |
> |
Bool_t fIsMomentumCorrected; //class dependent E-p combination |
147 |
> |
Int_t fClassification; //classification (see GsfElectron.h) |
148 |
|
|
149 |
|
ClassDef(Electron, 1) // Electron class |
150 |
|
}; |
166 |
|
//-------------------------------------------------------------------------------------------------- |
167 |
|
inline void mithep::Electron::GetMom() const |
168 |
|
{ |
169 |
< |
// Get momentum of the electron. We use the direction of the |
170 |
< |
// track and the energy of the SuperCluster. |
168 |
< |
|
169 |
< |
const mithep::Track *trk = Trk(); |
169 |
> |
// Get momentum of the electron. We use an explicitly stored three vector, with the pdg mass, |
170 |
> |
// since the momentum vector may be computed non-trivially in cmssw |
171 |
|
|
172 |
< |
if (!trk) { |
172 |
< |
fCachedMom.SetCoordinates(0,0,0,0); |
173 |
< |
return; |
174 |
< |
} |
175 |
< |
|
176 |
< |
Double_t p = 0; |
177 |
< |
Double_t mass = GetMass(); |
178 |
< |
|
179 |
< |
const mithep::SuperCluster *sc = SCluster(); |
180 |
< |
if (sc) |
181 |
< |
p = TMath::Sqrt(sc->Energy()*sc->Energy() - mass*mass); |
182 |
< |
else |
183 |
< |
p = trk->P(); |
184 |
< |
|
185 |
< |
Double_t pt = TMath::Abs(p*TMath::Cos(trk->Lambda())); |
186 |
< |
fCachedMom.SetCoordinates(pt,trk->Eta(),trk->Phi(),mass); |
172 |
> |
fCachedMom.SetCoordinates(fMom.Rho(),fMom.Eta(),fMom.Phi(),GetMass()); |
173 |
|
} |
174 |
|
|
175 |
|
//------------------------------------------------------------------------------------------------- |
180 |
|
|
181 |
|
return SCluster()->Seed()->Energy() / PIn(); |
182 |
|
} |
183 |
+ |
|
184 |
+ |
//------------------------------------------------------------------------------------------------- |
185 |
+ |
inline void mithep::Electron::SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi) |
186 |
+ |
{ |
187 |
+ |
// Set three-vector |
188 |
+ |
|
189 |
+ |
fMom.Set(pt,eta,phi); |
190 |
+ |
ClearMom(); |
191 |
+ |
} |
192 |
|
#endif |