57 #include "StThreeVector.hh"
58 #include "SystemOfUnits.h"
59 #if !defined(ST_NO_NAMESPACES)
75 double dipAngle()
const;
76 double curvature()
const;
87 double x(
double s)
const;
88 double y(
double s)
const;
89 double z(
double s)
const;
94 double cx(
double s)
const;
95 double cy(
double s)
const;
96 double cz(
double s = 0)
const;
104 pair<double, double>
pathLength(
double r)
const;
107 pair<double, double>
pathLength(
double r,
double x,
double y);
121 double minStepSize = 10*micrometer,
122 double minRange = 10*centimeter)
const;
128 bool valid(
double world = 1.e+5)
const {
return !bad(world);}
129 int bad(
double world = 1.e+5)
const;
134 static const double NoSolution;
139 void setCurvature(
double);
141 void setDipAngle(
double);
169 ostream& operator<<(ostream&,
const StHelix&);
176 inline double StHelix::dipAngle()
const {
return mDipAngle;}
178 inline double StHelix::curvature()
const {
return mCurvature;}
185 return mOrigin.x() - s*mCosDipAngle*mSinPhase;
187 return mOrigin.x() + (cos(mPhase + s*mH*mCurvature*mCosDipAngle)-mCosPhase)/mCurvature;
190 inline double StHelix::y(
double s)
const
193 return mOrigin.y() + s*mCosDipAngle*mCosPhase;
195 return mOrigin.y() + (sin(mPhase + s*mH*mCurvature*mCosDipAngle)-mSinPhase)/mCurvature;
198 inline double StHelix::z(
double s)
const
200 return mOrigin.z() + s*mSinDipAngle;
206 return -mCosDipAngle*mSinPhase;
208 return -sin(mPhase + s*mH*mCurvature*mCosDipAngle)*mH*mCosDipAngle;
211 inline double StHelix::cy(
double s)
const
214 return mCosDipAngle*mCosPhase;
216 return cos(mPhase + s*mH*mCurvature*mCosDipAngle)*mH*mCosDipAngle;
219 inline double StHelix::cz(
double )
const
240 inline int StHelix::bad(
double WorldSize)
const
244 if (!::finite(mDipAngle ))
return 11;
245 if (!::finite(mCurvature ))
return 12;
247 ierr = mOrigin.bad(WorldSize);
248 if (ierr)
return 3+ierr*100;
250 if (::fabs(mDipAngle) >1.58)
return 21;
251 double qwe = ::fabs(::fabs(mDipAngle)-M_PI/2);
252 if (qwe < 1./WorldSize )
return 31;
254 if (::fabs(mCurvature) > WorldSize)
return 22;
255 if (mCurvature < 0 )
return 32;
257 if (abs(mH) != 1 )
return 24;
void setParameters(double c, double dip, double phase, const StThreeVector< double > &o, int h)
starting point
bool valid(double world=1.e+5) const
checks for valid parametrization
int h() const
y-center of circle in xy-plane
pair< double, double > pathLengths(const StHelix &, double minStepSize=10 *micrometer, double minRange=10 *centimeter) const
path lengths at dca between two helices
double x(double s) const
coordinates of helix at point s
double distance(const StThreeVector< double > &p, bool scanPeriods=true) const
minimal distance between point and helix
double cx(double s) const
pointing vector of helix at point s
double fudgePathLength(const StThreeVector< double > &) const
value of S where distance in x-y plane is minimal
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
double ycenter() const
x-center of circle in xy-plane
const StThreeVector< double > & origin() const
-sign(q*B);
void setPhase(double)
performs also various checks
virtual void moveOrigin(double s)
move the origin along the helix to s which becomes then s=0
double period() const
returns period length of helix
double xcenter() const
aziumth in xy-plane measured from ring center
double phase() const
1/R in xy-plane