78 |
|
#define MITANA_DATATREE_TRACK_H |
79 |
|
|
80 |
|
#include "MitAna/DataTree/interface/DataObject.h" |
81 |
+ |
#include "MitAna/DataTree/interface/SuperCluster.h" |
82 |
|
#include "MitAna/DataTree/interface/MCParticle.h" |
83 |
|
#include "MitAna/DataTree/interface/BitMask.h" |
84 |
|
#include "MitAna/DataTree/interface/Types.h" |
136 |
|
|
137 |
|
Track() : fQOverP(0), fQOverPErr(0), fLambda(0), fLambdaErr(0), |
138 |
|
fPhi0(0), fPhi0Err(0), fDxy(0), fDxyErr(0), fDsz(0), fDszErr(0), |
139 |
< |
fChi2(0), fNdof(0) {} |
139 |
> |
fChi2(0), fNdof(0), fEtaEcal(0), fPhiEcal(0) {} |
140 |
|
Track(Double_t qOverP, Double_t lambda, Double_t phi0, Double_t dxy, Double_t dsz) : |
141 |
|
fQOverP(qOverP), fQOverPErr(0), fLambda(lambda), fLambdaErr(0), |
142 |
|
fPhi0(phi0), fPhi0Err(0), fDxy(dxy), fDxyErr(0), fDsz(dsz), fDszErr(0), |
143 |
< |
fChi2(0), fNdof(0) {} |
143 |
> |
fChi2(0), fNdof(0), fEtaEcal(0), fPhiEcal(0) {} |
144 |
|
~Track() {} |
145 |
|
|
146 |
|
Int_t Charge() const { return (fQOverP>0) ? 1 : -1; } |
156 |
|
Double_t E(Double_t m) const { return TMath::Sqrt(E2(m)); } |
157 |
|
Double_t E2(Double_t m) const { return P2()+m*m; } |
158 |
|
Double_t Eta() const { return Mom().Eta(); } |
159 |
+ |
Double_t EtaEcal() const { return fEtaEcal; } |
160 |
|
Bool_t Hit(EHitLayer l) const { return fHits.TestBit(l); } |
161 |
|
const BitMask48 &Hits() const { return fHits; } |
162 |
|
Double_t Lambda() const { return fLambda; } |
172 |
|
Double_t Phi() const { return fPhi0; } |
173 |
|
Double_t Phi0() const { return fPhi0; } |
174 |
|
Double_t Phi0Err() const { return fPhi0Err; } |
175 |
+ |
Double_t PhiEcal() const { return fPhiEcal; } |
176 |
|
Double_t Prob() const { return TMath::Prob(fChi2,fNdof); } |
177 |
|
Double_t Pt() const { return TMath::Abs(TMath::Cos(fLambda)/fQOverP); } |
178 |
|
Double_t Px() const { return Pt()*TMath::Cos(fPhi0); } |
185 |
|
void SetChi2(Double_t chi2) { fChi2 = chi2; } |
186 |
|
void SetErrors(Double_t qOverPErr, Double_t lambdaErr, Double_t phi0Err, |
187 |
|
Double_t dXyErr, Double_t dSzErr); |
188 |
+ |
void SetEtaEcal(Double_t eta) { fEtaEcal = eta; } |
189 |
|
void SetHelix (Double_t qOverP, Double_t lambda, Double_t phi0, |
190 |
|
Double_t dXy, Double_t dSz); |
191 |
|
void SetHit(EHitLayer l) { fHits.SetBit(l); } |
192 |
|
void SetHits(const BitMask48 &hits) { fHits = hits; } |
193 |
|
void SetNdof(UInt_t dof) { fNdof = dof; } |
194 |
|
void SetMCPart(MCParticle *p) { fMCParticleRef = p; } |
195 |
+ |
void SetPhiEcal(Double_t phi) { fPhiEcal = phi; } |
196 |
+ |
void SetSCluster(SuperCluster* sc) { fSuperClusterRef = sc; } |
197 |
+ |
const SuperCluster *SCluster() const; |
198 |
|
const BitMask48 StereoHits() const { return (fHits & StereoLayers()); } |
199 |
< |
static BitMask48 StereoLayers(); |
199 |
> |
static const BitMask48 StereoLayers(); |
200 |
|
|
201 |
|
protected: |
202 |
|
BitMask48 fHits; //storage for mostly hit information |
212 |
|
Double_t fDszErr; //error of longitudinal distance |
213 |
|
Double_t fChi2; //chi squared of track fit |
214 |
|
UInt_t fNdof; //degree-of-freedom of track fit |
215 |
+ |
Double32_t fEtaEcal; //Eta of track at Ecal front face |
216 |
+ |
Double32_t fPhiEcal; //phi of track at Ecal front face |
217 |
+ |
TRef fSuperClusterRef; //superCluster crossed by track |
218 |
|
TRef fMCParticleRef; //reference to sim particle (for monte carlo) |
219 |
|
|
220 |
< |
ClassDef(Track, 1) // Track class |
220 |
> |
ClassDef(Track, 2) // Track class |
221 |
|
}; |
222 |
|
} |
223 |
|
|
259 |
|
} |
260 |
|
|
261 |
|
//-------------------------------------------------------------------------------------------------- |
262 |
+ |
inline const mithep::SuperCluster *mithep::Track::SCluster() const |
263 |
+ |
{ |
264 |
+ |
// Return Super cluster |
265 |
+ |
|
266 |
+ |
return static_cast<const SuperCluster*>(fSuperClusterRef.GetObject()); |
267 |
+ |
} |
268 |
+ |
|
269 |
+ |
//-------------------------------------------------------------------------------------------------- |
270 |
|
inline |
271 |
< |
mithep::BitMask48 mithep::Track::StereoLayers() |
271 |
> |
const mithep::BitMask48 mithep::Track::StereoLayers() |
272 |
|
{ |
273 |
|
// Build and return BitMask of stereo layers |
274 |
|
|