Logo ROOT  
Reference Guide
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 28/04/04
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
12#ifndef ROOT_TGeoHelix
13#define ROOT_TGeoHelix
16#include "TObject.h"
18class TGeoHMatrix;
20class TGeoHelix : public TObject
22private :
23 Double_t fC; // curvature in XY plane
24 Double_t fS; // Z step of the helix / 2*PI
25 Double_t fStep; // current step
26 Double_t fPhi; // phi angle
27 Double_t fPointInit[3]; // initial point
28 Double_t fDirInit[3]; // normalized initial direction
29 Double_t fPoint[3]; // point after a step
30 Double_t fDir[3]; // direction after a step
31 Double_t fB[3]; // normalized direction for magnetic field
32 Int_t fQ; // right/left-handed (+/- 1) - "charge"
33 TGeoHMatrix *fMatrix; // transformation of local helix frame to MARS
35 TGeoHelix(const TGeoHelix&); // Not implemented
36 TGeoHelix &operator=(const TGeoHelix&); // Not implemented
41 kHelixCircle = BIT(18)
42 };
43 // constructors
44 TGeoHelix();
45 TGeoHelix(Double_t curvature, Double_t step, Int_t charge=1);
46 // destructor
47 virtual ~TGeoHelix();
49 void InitPoint(Double_t x0, Double_t y0, Double_t z0);
50 void InitPoint(Double_t *point);
51 void InitDirection(Double_t dirx, Double_t diry, Double_t dirz, Bool_t is_normalized=kTRUE);
52 void InitDirection(Double_t *dir, Bool_t is_normalized=kTRUE);
54 Double_t ComputeSafeStep(Double_t epsil=1E-6) const;
55 const Double_t *GetCurrentPoint() const {return fPoint;}
56 const Double_t *GetCurrentDirection() const {return fDir;}
57 Double_t GetXYcurvature() const {return fC;}
58 Double_t GetStep() const {return fStep;}
60 Bool_t IsRightHanded() const {return (fQ>0)?kFALSE:kTRUE;} // a positive charge in B field makes a left-handed helix
62 void ResetStep();
64// Double_t *StepToPlane(Double_t a, Double_t b, Double_t c);
66 void SetCharge(Int_t charge);
67 void SetXYcurvature(Double_t curvature);
68 void SetField(Double_t bx, Double_t by, Double_t bz, Bool_t is_normalized=kTRUE);
69 void SetHelixStep(Double_t hstep);
71 void Step(Double_t step);
73 void UpdateHelix();
75 ClassDef(TGeoHelix, 1) // helix class
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
#define BIT(n)
Definition: Rtypes.h:83
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition: TGeoMatrix.h:421
Class representing a helix curve.
Definition: TGeoHelix.h:21
Double_t GetXYcurvature() const
Definition: TGeoHelix.h:57
TGeoHMatrix * fMatrix
Definition: TGeoHelix.h:33
Double_t GetStep() const
Definition: TGeoHelix.h:58
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...
Definition: TGeoHelix.cxx:114
TGeoHelix & operator=(const TGeoHelix &)
TGeoHelix(const TGeoHelix &)
Double_t fB[3]
Definition: TGeoHelix.h:31
Dummy constructor.
Definition: TGeoHelix.cxx:62
Double_t fDir[3]
Definition: TGeoHelix.h:30
Double_t fS
Definition: TGeoHelix.h:24
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)
Definition: TGeoHelix.cxx:144
Double_t StepToPlane(Double_t *point, Double_t *norm)
Propagate initial point up to a given Z position in MARS.
Definition: TGeoHelix.cxx:285
Double_t GetTotalCurvature() const
Compute helix total curvature.
Definition: TGeoHelix.cxx:166
virtual ~TGeoHelix()
Definition: TGeoHelix.cxx:105
void SetXYcurvature(Double_t curvature)
Set XY curvature: c = 1/Rxy.
Definition: TGeoHelix.cxx:175
Double_t fPointInit[3]
Definition: TGeoHelix.h:27
void SetHelixStep(Double_t hstep)
Set Z step of the helix on a complete turn. Positive or null.
Definition: TGeoHelix.cxx:221
const Double_t * GetCurrentDirection() const
Definition: TGeoHelix.h:56
Definition: TGeoHelix.h:38
@ kHelixNeedUpdate
Definition: TGeoHelix.h:39
@ kHelixCircle
Definition: TGeoHelix.h:41
@ kHelixStraight
Definition: TGeoHelix.h:40
Bool_t IsRightHanded() const
Definition: TGeoHelix.h:60
void Step(Double_t step)
Make a step from current point along the helix and compute new point, direction and angle To reach a ...
Definition: TGeoHelix.cxx:253
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)
Definition: TGeoHelix.cxx:207
Double_t fDirInit[3]
Definition: TGeoHelix.h:28
Double_t fStep
Definition: TGeoHelix.h:25
void SetCharge(Int_t charge)
Positive charge means left-handed helix.
Definition: TGeoHelix.cxx:192
const Double_t * GetCurrentPoint() const
Definition: TGeoHelix.h:55
Double_t fPoint[3]
Definition: TGeoHelix.h:29
void InitPoint(Double_t x0, Double_t y0, Double_t z0)
Initialize coordinates of a point on the helix.
Definition: TGeoHelix.cxx:125
Double_t fC
Definition: TGeoHelix.h:23
Double_t fPhi
Definition: TGeoHelix.h:26
Int_t fQ
Definition: TGeoHelix.h:32
void UpdateHelix()
Update the local helix matrix.
Definition: TGeoHelix.cxx:339
void ResetStep()
Reset current point/direction to initial values.
Definition: TGeoHelix.cxx:235
Mother of all ROOT objects.
Definition: TObject.h:37
constexpr Double_t E()
Base of natural log:
Definition: TMath.h:97