ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Track.h
Revision: 1.11
Committed: Thu Jul 3 09:47:49 2008 UTC (16 years, 10 months ago) by paus
Content type: text/plain
Branch: MAIN
Changes since 1.10: +22 -17 lines
Log Message:
Adding some useful accessors.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Track.h,v 1.10 2008/07/01 08:53:09 loizides Exp $
3 //
4 // Track
5 //
6 // This will/must be re-written :-)
7 //
8 // Authors: C.Loizides, J.Bendavid, C.Paus
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef DATATREE_TRACK_H
12 #define DATATREE_TRACK_H
13
14 #include "MitAna/DataTree/interface/DataObject.h"
15 #include "MitAna/DataTree/interface/SimParticle.h"
16 #include "MitAna/DataTree/interface/Types.h"
17
18 namespace mithep
19 {
20 class Track : public DataObject
21 {
22 public:
23 Track() {}
24 Track(Double_t phi, Double_t d0, Double_t pt, Double_t dz, Double_t theta) :
25 fPhi(phi), fD0(d0), fPt(pt), fDz(dz), fTheta(theta) {}
26 ~Track() {}
27
28 Int_t Charge() const { return fCharge; }
29 Double_t D0() const { return fD0; }
30 Double_t D0Err() const { return fD0Err; }
31 Double_t Dz() const { return fDz; }
32 Double_t DzErr() const { return fDzErr; }
33 ThreeVector Mom() const { return ThreeVector(Px(),Py(),Pz()); }
34 Double_t P2() const { return Px()*Px()+Py()*Py()+Pz()*Pz(); }
35 Double_t P() const { return sqrt(P2()); }
36 Double_t Px() const { return cos(fPhi)*fabs(fPt); }
37 Double_t Py() const { return sin(fPhi)*fabs(fPt); }
38 Double_t Pz() const { return fabs(fPt)/tan(fTheta); }
39 Double_t Phi() const { return fPhi; }
40 Double_t PhiErr() const { return fPhiErr; }
41 Double_t Pt() const { return fPt; }
42 Double_t PtErr() const { return fPtErr; }
43 Double_t Theta() const { return fTheta; }
44 Double_t ThetaErr() const { return fThetaErr; }
45
46 FourVector Mom4(double m) const { return FourVector(Px(),Py(),Pz(),E(m)); }
47 Double_t E2(double m) const { return P2()+m*m; }
48 Double_t E(double m) const { return sqrt(E2(m)); }
49
50 void SetCharge(Int_t charge) { fCharge = charge; }
51 void SetHelix (Double_t phi, Double_t d0, Double_t pt, Double_t dz, Double_t theta);
52 void SetErrors(Double_t phiErr, Double_t d0Err, Double_t ptErr,
53 Double_t dzErr, Double_t thetaErr);
54
55 SimParticle* GetSimParticle() const { return (SimParticle*)fSimParticleRef.GetObject(); }
56 void SetSimParticle(SimParticle* p) { fSimParticleRef = p; }
57
58 protected:
59 Double_t fPhi; // azimuthal angle
60 Double_t fD0; // raw impact parameter
61 Double_t fPt; // transverse momentum
62 Double_t fDz; // z-displacement
63 Double_t fTheta; // polar angle
64 Double_t fPhiErr; // uncertainy on phi
65 Double_t fD0Err; // uncertainty on D0
66 Double_t fPtErr; // uncertainty on pt
67 Double_t fDzErr; // uncertainty on dz
68 Double_t fThetaErr; // uncertainty on theta
69 Int_t fCharge; // electric charge of reconstructed track
70 TRef fSimParticleRef; //reference to sim particle (for monte carlo)
71
72 ClassDef(Track, 1) // Track class
73 };
74 }
75
76 //--------------------------------------------------------------------------------------------------
77 inline
78 void mithep::Track::SetHelix(Double_t phi, Double_t d0, Double_t pt, Double_t dz, Double_t theta)
79 {
80 fPhi = phi;
81 fD0 = d0;
82 fPt = pt;
83 fDz = dz;
84 fTheta = theta;
85 }
86
87 //--------------------------------------------------------------------------------------------------
88 inline
89 void mithep::Track::SetErrors(Double_t phiErr, Double_t d0Err, Double_t ptErr, Double_t dzErr,
90 Double_t thetaErr)
91 {
92 fPhiErr = phiErr;
93 fD0Err = d0Err;
94 fPtErr = ptErr;
95 fDzErr = dzErr;
96 fThetaErr = thetaErr;
97 }
98 #endif