1 #include "StTrackChair.h"
3 const Char_t *StTrackChair::trackTableList[] = {
"tpt_track_st",
"dst_track_st"};
7 static Int_t CheckName(const Char_t *key, const Char_t **values, Int_t length)
10 for (i=0;i<length && strcmp(key,values[i]);i++);
11 if (i == length) i=-1;
15 StTrackChair::StTrackChair(
TTable *table) :
TChair(table) {
17 mR0 = table->GetOffset(
"r0");
18 mPhi0 = table->GetOffset(
"phi0");
19 mZ0 = table->GetOffset(
"z0");
20 mPsi = table->GetOffset(
"psi");
21 mTanl = table->GetOffset(
"tanl");
22 mCurvature = table->GetOffset(
"curvature");
23 mLength = table->GetOffset(
"length");
24 if (strcmp(table->
GetType(),
"tpt_track_st")) {
25 mInvpt = table->GetOffset(
"invpt") ;
26 mCharge = table->GetOffset(
"icharge");
28 mInvpt = table->GetOffset(
"invp");
29 mCharge = table->GetOffset(
"q");
34 StHelixD *StTrackChair::MakeHelix(Int_t i,
float bField)
const
37 const float pi2 = 3.1415926/2.;
38 const float rad = pi2/90.;
39 const void *point = At(i);
40 Float_t angle = (*(Float_t*)GetOffset(point,mPhi0)) * rad;
41 int h = (*(Int_t *)GetOffset(point,mCharge))*bField > 0 ? -1 : 1;
42 Float_t ro = *(Float_t *)GetOffset(point,mR0);
44 StThreeVectorD vector(ro*cos(angle),ro*sin(angle),*(Float_t *)GetOffset(point,mZ0));
46 Float_t curv = *(Float_t *)GetOffset(point,mCurvature);
47 Float_t tanl = *(Float_t *)GetOffset(point,mTanl);
48 Float_t psi = *(Float_t *)GetOffset(point,mPsi);
55 Int_t StTrackChair::IsTrack(
TTable *table){
57 return CheckName(table->
GetType(),trackTableList,
sizeof(trackTableList)/
sizeof(Char_t *));
63 if (CheckName(table->
GetType(),trackTableList,
sizeof(trackTableList)/
sizeof(Char_t *))>=0)
TDataSet * Instance() const
virtual const Char_t * GetType() const
Returns the type of the wrapped C-structure kept as the TNamed title.