68 fPointInit[0] = fPointInit[1] = fPointInit[2] = 0.;
69 fDirInit[0] = fDirInit[1] = fDirInit[2] = 0.;
70 fPoint[0] = fPoint[1] = fPoint[2] = 0.;
71 fDir[0] = fDir[1] = fDir[2] = 0.;
72 fB[0] = fB[1] = fB[2] = 0.;
95 fB[0] =
fB[1] =
fB[2] = 0.;
150 if (is_normalized)
return;
180 Error(
"SetXYcurvature",
"Curvature %f not valid. Must be positive.",
fC);
184 Warning(
"SetXYcurvature",
"Curvature is zero. Helix is a straight line.");
195 Error(
"ctor",
"charge cannot be 0 - define it positive for a left-handed helix, negative otherwise");
213 if (is_normalized)
return;
215 for (
Int_t i=0; i<3; i++)
fB[i] *= norm;
224 Error(
"ctor",
"Z step %f not valid. Must be positive.", step);
258 for (i=0; i<3; i++) {
260 fDir[i] = fDirInit[i];
292 dx = point[0] -
fPoint[0];
293 dy = point[1] - fPoint[1];
294 dz = point[2] - fPoint[2];
295 pdn = dx*norm[0]+dy*norm[1]+dz*norm[2];
299 if ((pdn*ddn) <= 0)
return snext;
311 if (approaching) snext = pdn/ddn;
312 else if (safety > 2.*r)
return snext;
313 while (snext > safestep) {
317 dx = point[0] - fPoint[0];
318 dy = point[1] - fPoint[1];
319 dz = point[2] - fPoint[2];
320 pdn = dx*norm[0]+dy*norm[1]+dz*norm[2];
325 if (approaching) snext = pdn/ddn;
326 else if (safety > 2.*r) {
360 rot[1] = fy*(
fDirInit[0]-fB[0]*ddb);
361 rot[4] = fy*(
fDirInit[1]-fB[1]*ddb);
362 rot[7] = fy*(
fDirInit[2]-fB[2]*ddb);
364 rot[0] = rot[4]*rot[8] - rot[7]*rot[5];
365 rot[3] = rot[7]*rot[2] - rot[1]*rot[8];
366 rot[6] = rot[1]*rot[5] - rot[4]*rot[2];
double dist(Rotation3D const &r1, Rotation3D const &r2)
#define snext(osub1, osub2)
Double_t GetTotalCurvature() const
Compute helix total curvature.
Float_t Normalize(Float_t v[3])
Normalize a vector v in place.
void SetCharge(Int_t charge)
Positive charge means left-handed helix.
Bool_t TestBit(UInt_t f) const
void SetTranslation(const Double_t *vect)
void UpdateHelix()
Update the local helix matrix.
Matrix class used for computing global transformations Should NOT be used for node definition...
void SetHelixStep(Double_t hstep)
Set Z step of the helix on a complete turn. Positive or null.
TGeoHelix()
Dummy constructor.
void Step(Double_t step)
Make a step from current point along the helix and compute new point, direction and angle To reach a ...
void SetField(Double_t bx, Double_t by, Double_t bz, Bool_t is_normalized=kTRUE)
Initialize particle direction (tangent on the helix in initial point)
Double_t StepToPlane(Double_t *point, Double_t *norm)
Propagate initial point up to a given Z position in MARS.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
static Double_t Tolerance()
virtual ~TGeoHelix()
Destructor.
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
void ResetStep()
Reset current point/direction to initial values.
void Clear(Option_t *option="")
clear the data for this matrix
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
void SetXYcurvature(Double_t curvature)
Set XY curvature: c = 1/Rxy.
void InitDirection(Double_t dirx, Double_t diry, Double_t dirz, Bool_t is_normalized=kTRUE)
Initialize particle direction (tangent on the helix in initial point)
Class representing a helix curve.
Short_t Max(Short_t a, Short_t b)
void SetRotation(const Double_t *matrix)
Double_t ComputeSafeStep(Double_t epsil=1E-6) const
Compute safe linear step that can be made such that the error between linear-helix extrapolation is l...
void InitPoint(Double_t x0, Double_t y0, Double_t z0)
Initialize coordinates of a point on the helix.
Double_t Sqrt(Double_t x)
double norm(double *x, double *p)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.