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++) {
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) {
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];
Matrix class used for computing global transformations Should NOT be used for node definition.
void SetRotation(const Double_t *matrix)
void Clear(Option_t *option="")
clear the data for this matrix
void SetTranslation(const Double_t *vect)
Class representing a helix curve.
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...
TGeoHelix()
Dummy constructor.
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)
Double_t StepToPlane(Double_t *point, Double_t *norm)
Propagate initial point up to a given Z position in MARS.
Double_t GetTotalCurvature() const
Compute helix total curvature.
virtual ~TGeoHelix()
Destructor.
void SetXYcurvature(Double_t curvature)
Set XY curvature: c = 1/Rxy.
void SetHelixStep(Double_t hstep)
Set Z step of the helix on a complete turn. Positive or null.
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)
void SetCharge(Int_t charge)
Positive charge means left-handed helix.
void InitPoint(Double_t x0, Double_t y0, Double_t z0)
Initialize coordinates of a point on the helix.
void UpdateHelix()
Update the local helix matrix.
void ResetStep()
Reset current point/direction to initial values.
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
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
static Double_t Tolerance()
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
double dist(Rotation3D const &r1, Rotation3D const &r2)
Short_t Max(Short_t a, Short_t b)
Float_t Normalize(Float_t v[3])
Normalize a vector v in place.
Double_t Sqrt(Double_t x)
#define snext(osub1, osub2)