58 fPointInit[0] = fPointInit[1] = fPointInit[2] = 0.;
59 fDirInit[0] = fDirInit[1] = fDirInit[2] = 0.;
60 fPoint[0] = fPoint[1] = fPoint[2] = 0.;
61 fDir[0] = fDir[1] = fDir[2] = 0.;
62 fB[0] = fB[1] = fB[2] = 0.;
85 fB[0] =
fB[1] =
fB[2] = 0.;
140 if (is_normalized)
return;
170 Error(
"SetXYcurvature",
"Curvature %f not valid. Must be positive.",
fC);
174 Warning(
"SetXYcurvature",
"Curvature is zero. Helix is a straigth line.");
185 Error(
"ctor",
"charge cannot be 0 - define it positive for a left-handed helix, negative otherwise");
203 if (is_normalized)
return;
205 for (
Int_t i=0; i<3; i++)
fB[i] *= norm;
214 Error(
"ctor",
"Z step %f not valid. Must be positive.", step);
248 for (i=0; i<3; i++) {
250 fDir[i] = fDirInit[i];
282 dx = point[0] -
fPoint[0];
283 dy = point[1] - fPoint[1];
284 dz = point[2] - fPoint[2];
285 pdn = dx*norm[0]+dy*norm[1]+dz*norm[2];
289 if ((pdn*ddn) <= 0)
return snext;
301 if (approaching) snext = pdn/ddn;
302 else if (safety > 2.*r)
return snext;
303 while (snext > safestep) {
307 dx = point[0] - fPoint[0];
308 dy = point[1] - fPoint[1];
309 dz = point[2] - fPoint[2];
310 pdn = dx*norm[0]+dy*norm[1]+dz*norm[2];
315 if (approaching) snext = pdn/ddn;
316 else if (safety > 2.*r) {
350 rot[1] = fy*(
fDirInit[0]-fB[0]*ddb);
351 rot[4] = fy*(
fDirInit[1]-fB[1]*ddb);
352 rot[7] = fy*(
fDirInit[2]-fB[2]*ddb);
354 rot[0] = rot[4]*rot[8] - rot[7]*rot[5];
355 rot[3] = rot[7]*rot[2] - rot[1]*rot[8];
356 rot[6] = rot[1]*rot[5] - rot[4]*rot[2];
double dist(Rotation3D const &r1, Rotation3D const &r2)
#define snext(osub1, osub2)
Float_t Normalize(Float_t v[3])
Normalize a vector v in place.
void SetCharge(Int_t charge)
Positive charge means left-handed helix.
void SetTranslation(const Double_t *vect)
void UpdateHelix()
Update the local helix matrix.
Double_t GetTotalCurvature() const
Compute helix total curvature.
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 ...
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 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()
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...
virtual ~TGeoHelix()
Destructor.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void ResetStep()
Reset current point/direction to initial values.
void Clear(Option_t *option="")
clear the data for this matrix
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
Bool_t TestBit(UInt_t f) const
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)
Short_t Max(Short_t a, Short_t b)
void SetRotation(const Double_t *matrix)
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)
ClassImp(TGeoHelix) TGeoHelix
Dummy constructor.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.