Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#ifndef TVTRACK_H
#define TVTRACK_H
//*************************************************************************
//* ===============
//* TVTrack Class
//* ===============
//*
//* (Description)
//* This is the base class for various tracks.
//* (Requires)
//* TVCurve;
//* (Provides)
//* class TVTrack
//* (Update Recored)
//* 2003/10/24 K.Fujii Original version.
//* 2005/08/14 K.Fujii Added IsInB().
//*
//*************************************************************************
//
#include "TVector3.h"
#include "TMatrixD.h"
#if 1
#include "TMath.h"
#include "TCollection.h"
#endif
#include "TVCurve.h"
//_____________________________________________________________________
// -----------------------------------
// Base Class for any track
// -----------------------------------
class TVTrack : public TVCurve {
public:
// Ctors and Dtor
TVTrack(Double_t dr = 0.,
Double_t phi0 = 0.,
Double_t kappa = 1.e-5,
Double_t dz = 0.,
Double_t tanl = 0.,
Double_t x0 = 0.,
Double_t y0 = 0.,
Double_t z0 = 0.,
Double_t b = 30.);
TVTrack(const TMatrixD &a, const TVector3 & x0, Double_t b = 30.);
virtual ~TVTrack() {}
// Utility methods
virtual void MoveTo(const TVector3 &x0to,
Double_t &fid,
TMatrixD *F = 0,
TMatrixD *C = 0) = 0;
virtual void MoveTo(const TVector3 &x0to,
Double_t &fid,
TMatrixD &C)
{
Int_t sdim = C.GetNrows();
TMatrixD F(sdim, sdim);
MoveTo(x0to,fid,&F,&C);
}
inline virtual void ScatterBy(Double_t dphi, Double_t dtnl)
{
fPhi0 += dphi;
fKappa += (fKappa*fTanL/(1+fTanL*fTanL)) * dtnl;
fTanL += dtnl;
}
inline virtual void PutInto(TMatrixD &sv) const
{
sv(0,0) = fDrho;
sv(1,0) = fPhi0;
sv(2,0) = fKappa;
sv(3,0) = fDz;
sv(4,0) = fTanL;
}
virtual TVector3 CalcXAt (Double_t phi) const = 0;
virtual TMatrixD CalcDxDa (Double_t phi) const = 0;
virtual TMatrixD CalcDxDphi(Double_t phi) const = 0;
virtual void CalcDapDa (Double_t fid,
Double_t dr,
Double_t drp,
TMatrixD &F) const = 0;
// Getters
inline virtual Double_t GetDrho () const { return fDrho; }
inline virtual Double_t GetPhi0 () const { return fPhi0; }
inline virtual Double_t GetKappa () const { return fKappa; }
inline virtual Double_t GetDz () const { return fDz; }
inline virtual Double_t GetTanLambda() const { return fTanL; }
inline virtual const TVector3 & GetPivot () const { return fX0; }
inline virtual Double_t GetRho () const { return fAlpha/fKappa; }
inline virtual Double_t GetPtoR () const { return fAlpha; }
// Setters
inline virtual void SetTo(const TMatrixD &sv, const TVector3 &x0)
{
fDrho = sv(0,0);
fPhi0 = sv(1,0);
fKappa = sv(2,0);
fDz = sv(3,0);
fTanL = sv(4,0);
fX0 = x0;
}
inline virtual void SetMagField(Double_t b)
{
// // units: mm, sec, Tesla
if (b != 0.) fAlpha = kGiga/kLightVelocity*1000./b;
// units: cm, sec, kGaus
//if (b != 0.) fAlpha = kGiga/kLightVelocity*100./(b/10);
else fAlpha = kInfinity;
}
inline virtual Bool_t IsInB() const { return fAlpha < kInfinity ? kTRUE : kFALSE; }
protected:
Double_t fDrho; // drho
Double_t fPhi0; // phi0
Double_t fKappa; // kappa
Double_t fDz; // dz
Double_t fTanL; // tanl
TVector3 fX0; // pivot
Double_t fAlpha; // alpha
#if __GNUC__ < 4 && !defined(__STRICT_ANSI__)
static const Double_t kLightVelocity = 2.99792458e8; //! light velocity [m/sec]
static const Double_t kGiga = 1.0e9; //! Giga = 10^{9}
static const Double_t kInfinity = 1.e+20; //! infinity
#else
static const Double_t kLightVelocity; //! light velocity [m/sec]
static const Double_t kGiga; //! Giga = 10^{9}
static const Double_t kInfinity; //! infinity
#endif
ClassDef(TVTrack,1) // Base class for any track
};
#endif