7 #include "THelixTrack_.h"
9 enum THelix3dE {kU =0,kV =1, kFita =2 ,kLama =3,kPinv =4};
10 enum THelix3dE2{kKT=0,kKU=1,kKV=2, kKdDdL=3};
12 typedef double Mtx33D_t[3][3];
13 typedef double Mtx43D_t[4][3];
20 TkDir_t(
const Mtx43D_t &tkd) {*
this = tkd;}
21 void Clear() {memset(mTkd[0],0,
sizeof(mTkd));
22 for(
int i=0;i<3;i++){mTkd[i][i]=1;};}
23 operator const Mtx43D_t &()
const {
return mTkd;}
24 operator Mtx43D_t &() {
return mTkd;};
26 {assert(mTkd!=tkd); memcpy(mTkd[0],tkd[0],
sizeof(mTkd));
return *
this;}
27 TkDir_t &operator=(
const Mtx43D_t &tkd)
28 {assert(mTkd!=tkd); memcpy(mTkd[0],tkd[0],
sizeof(mTkd));
return *
this;}
29 const double* T()
const {
return mTkd[kKT];}
30 const double* U()
const {
return mTkd[kKU];}
31 const double* V()
const {
return mTkd[kKV];}
33 int Same(
const TkDir_t &as)
const;
47 operator const Mtx55D_t &()
const {
return mDer ;}
48 operator Mtx55D_t &() {
return mDer ;}
49 const TkDir_t &TkDir(
int idx)
const {
return mTkDir[idx];}
50 void SetTkDir(
int idx,
const TkDir_t& tkd) { mTkDir[idx]=tkd;}
51 double Len()
const {
return mLen ;}
66 THEmx3d_t(
double const err[15],
TkDir_t *tkDir = 0) { Clear();Set(err,tkDir);}
67 operator const double* ()
const {
return &mUU;}
68 operator double* () {
return &mUU;}
70 {
for (
int i=0;i<15;i++) {(*this)[i]*=f;}
return *
this;}
72 const TkDir_t &TkDir()
const {
return mTkDir;}
73 TkDir_t &TkDir() {
return mTkDir;}
74 void Set(
double const err[15],
TkDir_t *tkDir = 0);
75 void Set(
double eUU,
double eUV,
double eVV);
77 void Add(
double Theta2,
double Orth2,
double PinvRr);
80 void Update(
const TkDir_t &tkDir);
81 void Print(
const char *tit=0)
const;
82 double Trace()
const ;
84 double Len()
const {
return mLen;}
85 int Times(
int jk)
const {
return mTimes[jk];}
98 mUP, mVP, mFP, mLP, mPP;
107 THelix3d(
int charge,
const double xyz[3],
const double mom[3],
const double mag[3]);
111 void Clear(
const char* opt=0);
113 void Set (
int charge,
const double xyz[3],
const double mom[3],
const double bMag[3]=0);
117 void SetDerOn(
int derOn=1) { fDerOn =derOn;}
118 int IsDerOn()
const {
return fDerOn;}
122 double Move(
double step,
double F[5][5]=0);
124 double Eval(
double step,
double xyz[3]=0,
double mom[3]=0);
135 double Path(
const double point[3],
double xyz[3]=0,
double mom[3]=0);
137 double Dca(
const double point[3],
double *dcaErr=0);
140 double Path(
double x,
double y);
142 double Dca(
double x,
double y,
double *dcaErr=0) ;
161 const double *
Pos()
const {
return fX3d;}
162 double *
Pos() {
return fX3d;}
163 const double *Dir()
const {
return fD3d;}
164 double *Dir() {
return fD3d;}
165 const double *Mom()
const {
return fP3d;}
166 double MomTot()
const {
return fMom;}
167 const double *Mag()
const {
return fH3d;}
168 int Charge()
const {
return fCharge;}
169 double Pinv()
const {
return fPinv;}
170 const THDer3d_t *Der()
const {
return fDer3d;}
171 const TkDir_t &TkDir(
int idx)
const {
return fDer3d->mTkDir[idx];}
177 static void MakeTkDir(
const double T[3],
const double H[3],
TkDir_t &tkd);
180 static void TestDer();
181 static void TestDer2();
182 static void TestErr(
int charge=-1);
183 static void TestErr2(
int charge=-1);
184 static void TestErr3(
int charge=-1);
185 static void ConvertErrs(
const THelixTrack_ *he,
const double Bz
186 ,
double G[15],
double D[5][5]=0,
double Di[5][5]=0);
187 static void TestConvertErrs();
188 static void TestConvertDers();
190 static void MakeLocal(
const double T[3],
const double H[3],
double sys[3][3]);
197 void ToGlobal(
const double locX[3],
const double locD[3]
198 ,
double gloX[3],
double gloD[3],
double gloP[3])
const;
199 void GetdDdL(
double dDdL[3])
const;
double Eval(double step, double xyz[3]=0, double mom[3]=0)
Evaluate params with given step along helix.
void Backward()
Change direction.
const double * Pos() const
distance and DCAxy and DCAz to given space point (with error matrix)
void Backward()
Change direction.
double Move(double step, double F[5][5]=0)
Move along helix.
double Path(const double point[3], double xyz[3]=0, double mom[3]=0)
Distance to nearest point to given space point.
double Dca(const double point[3], double *dcaErr=0)
DCA to given space point (with error matrix)