ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Track.h
Revision: 1.10
Committed: Tue Jul 1 08:53:09 2008 UTC (16 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.9: +37 -44 lines
Log Message:
Cleanup although this class needs serious work.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Track.h,v 1.9 2008/06/30 16:54:40 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 P() const { return sqrt( Px()*Px() + Py()*Py() + Pz()*Pz() ); }
35 Double_t Px() const { return cos(fPhi)*fabs(fPt); }
36 Double_t Py() const { return sin(fPhi)*fabs(fPt); }
37 Double_t Pz() const { return fabs(fPt)/tan(fTheta); }
38 Double_t Phi() const { return fPhi; }
39 Double_t PhiErr() const { return fPhiErr; }
40 Double_t Pt() const { return fPt; }
41 Double_t PtErr() const { return fPtErr; }
42 Double_t Theta() const { return fTheta; }
43 Double_t ThetaErr() const { return fThetaErr; }
44
45 void SetCharge(Int_t charge) { fCharge = charge; }
46 void SetHelix (Double_t phi, Double_t d0, Double_t pt, Double_t dz, Double_t theta);
47 void SetErrors(Double_t phiErr, Double_t d0Err, Double_t ptErr,
48 Double_t dzErr, Double_t thetaErr);
49
50 SimParticle* GetSimParticle() const { return (SimParticle*)fSimParticleRef.GetObject(); }
51 void SetSimParticle(SimParticle* p) { fSimParticleRef = p; }
52
53 protected:
54 Double_t fPhi; // azimuthal angle
55 Double_t fD0; // raw impact parameter
56 Double_t fPt; // transverse momentum
57 Double_t fDz; // z-displacement
58 Double_t fTheta; // polar angle
59 Double_t fPhiErr; // uncertainy on phi
60 Double_t fD0Err; // uncertainty on D0
61 Double_t fPtErr; // uncertainty on pt
62 Double_t fDzErr; // uncertainty on dz
63 Double_t fThetaErr; // uncertainty on theta
64 Int_t fCharge; // electric charge of reconstructed track
65 TRef fSimParticleRef; //reference to sim particle (for monte carlo)
66
67 ClassDef(Track, 1) // Track class
68 };
69 }
70
71 //--------------------------------------------------------------------------------------------------
72 inline
73 void mithep::Track::SetHelix(Double_t phi, Double_t d0, Double_t pt, Double_t dz, Double_t theta)
74 {
75 fPhi = phi;
76 fD0 = d0;
77 fPt = pt;
78 fDz = dz;
79 fTheta = theta;
80 }
81
82 //--------------------------------------------------------------------------------------------------
83 inline
84 void mithep::Track::SetErrors(Double_t phiErr, Double_t d0Err, Double_t ptErr, Double_t dzErr,
85 Double_t thetaErr)
86 {
87 fPhiErr = phiErr;
88 fD0Err = d0Err;
89 fPtErr = ptErr;
90 fDzErr = dzErr;
91 fThetaErr = thetaErr;
92 }
93 #endif