Logo ROOT  
Reference Guide
TGeoHelix.h
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 28/04/04
3
4/*************************************************************************
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 *************************************************************************/
11
12#ifndef ROOT_TGeoHelix
13#define ROOT_TGeoHelix
14
15
16#include "TObject.h"
17
18class TGeoHMatrix;
19
20class TGeoHelix : public TObject
21{
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{nullptr}; // transformation of local helix frame to MARS
34
35 TGeoHelix(const TGeoHelix&) = delete;
36 TGeoHelix &operator=(const TGeoHelix&) = delete;
37public:
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();
48
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);
53
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
61
62 void ResetStep();
64// Double_t *StepToPlane(Double_t a, Double_t b, Double_t c);
65
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);
70
71 void Step(Double_t step);
72
73 void UpdateHelix();
74
75 ClassDef(TGeoHelix, 1) // helix class
76};
77
78#endif
79
int Int_t
Definition: RtypesCore.h:43
const Bool_t kFALSE
Definition: RtypesCore.h:90
bool Bool_t
Definition: RtypesCore.h:61
double Double_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassDef(name, id)
Definition: Rtypes.h:322
#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
TGeoHelix & operator=(const TGeoHelix &)=delete
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
Double_t fB[3]
Definition: TGeoHelix.h:31
TGeoHelix()
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()
Destructor.
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
EGeoHelixTypes
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
TGeoHelix(const TGeoHelix &)=delete
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