ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Track.h
Revision: 1.9
Committed: Mon Jun 30 16:54:40 2008 UTC (16 years, 10 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.8: +16 -1 lines
Log Message:
Changes to particle structure. MOre changes will follow

File Contents

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