25 #include "SystemOfUnits.h"
27 #include "StarClassLibrary/SystemOfUnits.h"
31 #if !defined(ST_NO_NAMESPACES)
47 const TVector3& o, Int_t
h=-1);
63 Double_t
phase()
const;
72 const TVector3&
origin()
const;
75 void setParameters(Double_t c, Double_t dip, Double_t phase,
const TVector3& o, Int_t h);
78 Double_t
x(Double_t s)
const;
79 Double_t y(Double_t s)
const;
80 Double_t z(Double_t s)
const;
81 TVector3 at(Double_t s)
const;
84 Double_t
cx(Double_t s)
const;
85 Double_t cy(Double_t s)
const;
86 Double_t cz(Double_t s = 0)
const;
87 TVector3 cat(Double_t s)
const;
93 pair<Double_t, Double_t>
pathLength(Double_t r)
const;
96 pair<Double_t, Double_t>
pathLength(Double_t r, Double_t x, Double_t y);
99 Double_t
pathLength(
const TVector3& p, Bool_t scanPeriods =
true)
const;
103 const TVector3& n)
const;
106 Double_t
pathLength(Double_t x, Double_t y)
const;
110 Double_t minStepSize = 10*micrometer,
111 Double_t minRange = 10*centimeter)
const;
114 Double_t
distance(
const TVector3& p, Bool_t scanPeriods =
true)
const;
117 Bool_t
valid(Double_t world = 1.e+5)
const {
return !bad(world); }
118 Int_t bad(Double_t world = 1.e+5)
const;
123 static const Double_t NoSolution;
167 std::ostream& operator<<(std::ostream&,
const StPicoHelix&);
187 inline Double_t StPicoHelix::y(Double_t s)
const {
194 inline Double_t StPicoHelix::z(Double_t s)
const {
205 inline Double_t StPicoHelix::cy(Double_t s)
const {
212 inline Double_t StPicoHelix::cz(Double_t )
const {
return mSinDipAngle; }
214 inline TVector3 StPicoHelix::at(Double_t s)
const {
return TVector3(
x(s), y(s), z(s)); }
215 inline TVector3 StPicoHelix::cat(Double_t s)
const {
return TVector3(
cx(s), cy(s), cz(s)); }
218 inline Int_t StPicoHelix::bad(Double_t WorldSize)
const {
232 for(Int_t iIter=0; iIter<3; iIter++) {
237 case 0: tmpVal =
mOrigin.X();
break;
238 case 1: tmpVal =
mOrigin.Y();
break;
239 case 2: tmpVal =
mOrigin.Z();
break;
240 default: tmpVal = NAN;
243 if ( !std::isfinite( tmpVal ) ) {
246 if ( ::fabs( tmpVal ) > WorldSize ) {
258 Double_t qwe = ::fabs( ::fabs(
mDipAngle) - M_PI/2 );
259 if ( qwe < 1./WorldSize ) {
Double_t xcenter() const
Return x-center of circle in xy-plane.
pair< Double_t, Double_t > pathLengths(const StPicoHelix &, Double_t minStepSize=10 *micrometer, Double_t minRange=10 *centimeter) const
path lengths at dca between two helices
Double_t x(Double_t s) const
coordinates of helix at point s
Double_t curvature() const
Return curvature: 1/R in xy-plane.
Double_t mCurvature
Curvature = 1/R.
Bool_t valid(Double_t world=1.e+5) const
checks for valid parametrization
Double_t mSinDipAngle
Sin of dip angle.
virtual ~StPicoHelix()
Destructor.
Double_t fudgePathLength(const TVector3 &) const
Value of S where distance in x-y plane is minimal.
Double_t dipAngle() const
Return dip angle.
Int_t h() const
Return -sign(q*B);.
Double_t mCosPhase
Cos of phase.
TVector3 mOrigin
starting point of a helix
pair< Double_t, Double_t > pathLength(Double_t r) const
path length at given r (cylindrical r)
const TVector3 & origin() const
Return origin of the helix = starting point.
Double_t period() const
returns period length of helix
virtual void moveOrigin(Double_t s)
Move the origin along the helix to s which becomes then s=0.
void setPhase(Double_t)
Set phase of the helix.
void setParameters(Double_t c, Double_t dip, Double_t phase, const TVector3 &o, Int_t h)
Set helix parameters.
void setDipAngle(Double_t)
Set dip angle of the helix.
Double_t distance(const TVector3 &p, Bool_t scanPeriods=true) const
minimal distance between point and helix
Double_t mDipAngle
Dip angle.
Helix parametrization that uses ROOT TVector3.
Double_t phase() const
Return phase: aziumth in xy-plane measured from ring center.
Bool_t mSingularity
true for straight line case (B=0)
Double_t mCosDipAngle
Cos of dip angle.
Double_t ycenter() const
Return y-center of circle in xy-plane.
void setCurvature(Double_t)
Set curvature of the helix.
StPicoHelix()
Default constructor.
Double_t cx(Double_t s) const
pointing vector of helix at point s