11 #include "StHelixHelper.h"
15 #if ROOT_VERSION_CODE < 331013
18 # include "TCernLib.h"
21 #include "TVirtualPad.h"
25 #include "THelixTrack.h"
26 #include "StPhysicalHelixD.hh"
39 fTHlx[0]=0; fTHlx[1]=0;
43 StHelixHelper::StHelixHelper() : TObject(),fLength(-1)
45 fHelx[0] = fHelx[1] = 0;
46 fTHlx[0] = fTHlx[1] = 0;
50 StHelixHelper::StHelixHelper(
const StHelixHelper &helper) : TObject (helper)
51 ,fLength(helper.fLength)
56 fTHlx[0] = helper.fTHlx[0] ?
new THelixTrack(*helper.fTHlx[0]) : 0;
57 fTHlx[1] = helper.fTHlx[1] ?
new THelixTrack(*helper.fTHlx[1]) : 0;
62 StHelixHelper::~StHelixHelper()
64 delete fHelx[0];
delete fHelx[1];
65 delete fTHlx[0];
delete fTHlx[1];
68 float StHelixHelper::GetLength()
const {
return fLength;}
78 double curv = evHlx->curvature();
79 double phase = evHlx->
phase();
80 double dip = evHlx->dipAngle();
84 myDir[0]= -sin(phase)*cos(dip);
85 myDir[1]= cos(phase)*cos(dip);
87 if (h<0) {myDir[0]=-myDir[0]; myDir[1]=-myDir[1];}
93 myHlx->Set(myX,myDir,curv*h);
97 THelixTrack *StHelixHelper::GetTHelix(
int idx)
const
100 fTHlx[idx] = StHelixHelper::MyHelix(fTHlx[idx],hlx);
110 static int ndebug=0; ndebug++;
112 double len,len0,len1;
119 GetHelix(0); GetHelix(1);
120 for (
int i=0;i<2;i++) {fTHlx[i] = StHelixHelper::MyHelix(fTHlx[i],fHelx[i]);}
122 len0 = fTHlx[0]->Path(fTHlx[1]->Pos());
123 double rho0 = fTHlx[0]->GetRho();
129 npoints = abs(
int(len*fTHlx[0]->GetCos()*rho0*90))+2;
130 double step = 1./(npoints-1);
131 len0 = fTHlx[0]->Path(fTHlx[1]->Pos());
132 len1 = fTHlx[1]->Path(fTHlx[0]->Pos());
133 float *arr =
new Float_t[npoints*3];
135 for (
int i =0;i<npoints;i++)
139 fTHlx[0]->
Eval(s0*len0,xyz[0]);
140 fTHlx[1]->
Eval(s1*len1,xyz[1]);
141 s0 = s0*s0*s0; s1 = s1*s1*s1;
144 TCL::vlinco(xyz[0],s1,xyz[1],s0,xyz[2],3);
145 TCL::ucopy(xyz[2],arr+i*3,3);
double Eval(double step, double *xyz, double *dir, double &rho) const
Evaluate params with given step along helix.
int h() const
y-center of circle in xy-plane
double x(double s) const
coordinates of helix at point s
void Backward()
Change direction.
virtual Float_t * GetPoints(int &npoints) const
double phase() const
1/R in xy-plane