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(); } |
91 |
> |
{ fGsfTrackRef = t; 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; } |
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(); } |
102 |
> |
void SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi); |
103 |
> |
void SetSuperCluster(const SuperCluster* sc) |
104 |
> |
{ fSuperClusterRef = sc; } |
105 |
|
void SetTrackerTrk(const Track* t) |
106 |
< |
{ fTrackerTrackRef = t; ClearMom(); ClearCharge(); } |
106 |
> |
{ fTrackerTrackRef = t; ClearCharge(); } |
107 |
|
void SetTrackIsolation(Double_t trkiso) { fTrackIsolation = trkiso; } |
108 |
|
const Track *TrackerTrk() const { return fTrackerTrackRef.Obj(); } |
109 |
|
Double_t TrackIsolation() const { return fTrackIsolation; } |
113 |
|
Double_t GetMass() const { return 0.51099892e-3; } |
114 |
|
void GetMom() const; |
115 |
|
|
116 |
+ |
Vect3C fMom; //stored three-momentum |
117 |
|
Ref<Track> fGsfTrackRef; //gsf track reference |
118 |
|
Ref<Track> fTrackerTrackRef; //tracker track reference |
119 |
|
Ref<SuperCluster> fSuperClusterRef; //reference to SuperCluster |
165 |
|
//-------------------------------------------------------------------------------------------------- |
166 |
|
inline void mithep::Electron::GetMom() const |
167 |
|
{ |
168 |
< |
// Get momentum of the electron. We use the direction of the |
169 |
< |
// track and the energy of the SuperCluster. |
168 |
> |
// Get momentum of the electron. We use an explicitly stored three vector, with the pdg mass, |
169 |
> |
// since the momentum vector may be computed non-trivially in cmssw |
170 |
|
|
171 |
< |
const mithep::Track *trk = Trk(); |
170 |
< |
|
171 |
< |
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); |
171 |
> |
fCachedMom.SetCoordinates(fMom.Rho(),fMom.Eta(),fMom.Phi(),GetMass()); |
172 |
|
} |
173 |
|
|
174 |
|
//------------------------------------------------------------------------------------------------- |
179 |
|
|
180 |
|
return SCluster()->Seed()->Energy() / PIn(); |
181 |
|
} |
182 |
+ |
|
183 |
+ |
//------------------------------------------------------------------------------------------------- |
184 |
+ |
inline void mithep::Electron::SetPtEtaPhi(Double_t pt, Double_t eta, Double_t phi) |
185 |
+ |
{ |
186 |
+ |
// Set three-vector |
187 |
+ |
|
188 |
+ |
fMom.Set(pt,eta,phi); |
189 |
+ |
ClearMom(); |
190 |
+ |
} |
191 |
|
#endif |