Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TObject.h"
16
17class TGeoHMatrix;
18
19class TGeoHelix : public TObject {
20private:
21 Double_t fC; // curvature in XY plane
22 Double_t fS; // Z step of the helix / 2*PI
23 Double_t fStep; // current step
24 Double_t fPhi; // phi angle
25 Double_t fPointInit[3]; // initial point
26 Double_t fDirInit[3]; // normalized initial direction
27 Double_t fPoint[3]; // point after a step
28 Double_t fDir[3]; // direction after a step
29 Double_t fB[3]; // normalized direction for magnetic field
30 Int_t fQ; // right/left-handed (+/- 1) - "charge"
31 TGeoHMatrix *fMatrix{nullptr}; // transformation of local helix frame to MARS
32
33 TGeoHelix(const TGeoHelix &) = delete;
34 TGeoHelix &operator=(const TGeoHelix &) = delete;
35
36public:
38 // constructors
39 TGeoHelix();
40 TGeoHelix(Double_t curvature, Double_t step, Int_t charge = 1);
41 // destructor
42 ~TGeoHelix() override;
43
44 void InitPoint(Double_t x0, Double_t y0, Double_t z0);
45 void InitPoint(Double_t *point);
46 void InitDirection(Double_t dirx, Double_t diry, Double_t dirz, Bool_t is_normalized = kTRUE);
47 void InitDirection(Double_t *dir, Bool_t is_normalized = kTRUE);
48
49 Double_t ComputeSafeStep(Double_t epsil = 1E-6) const;
50 const Double_t *GetCurrentPoint() const { return fPoint; }
51 const Double_t *GetCurrentDirection() const { return fDir; }
52 Double_t GetXYcurvature() const { return fC; }
53 Double_t GetStep() const { return fStep; }
56 {
57 return (fQ > 0) ? kFALSE : kTRUE;
58 } // a positive charge in B field makes a left-handed helix
59
60 void ResetStep();
62 // Double_t *StepToPlane(Double_t a, Double_t b, Double_t c);
63
64 void SetCharge(Int_t charge);
65 void SetXYcurvature(Double_t curvature);
66 void SetField(Double_t bx, Double_t by, Double_t bz, Bool_t is_normalized = kTRUE);
67 void SetHelixStep(Double_t hstep);
68
69 void Step(Double_t step);
70
71 void UpdateHelix();
72
73 ClassDefOverride(TGeoHelix, 1) // helix class
74};
75
76#endif
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define BIT(n)
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition TGeoMatrix.h:458
Class representing a helix curve.
Definition TGeoHelix.h:19
Double_t GetXYcurvature() const
Definition TGeoHelix.h:52
TGeoHMatrix * fMatrix
Definition TGeoHelix.h:31
Double_t GetStep() const
Definition TGeoHelix.h:53
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...
~TGeoHelix() override
Destructor.
Double_t fB[3]
Definition TGeoHelix.h:29
TGeoHelix()
Dummy constructor.
Definition TGeoHelix.cxx:61
Double_t fDir[3]
Definition TGeoHelix.h:28
Double_t fS
Definition TGeoHelix.h:22
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.
void SetXYcurvature(Double_t curvature)
Set XY curvature: c = 1/Rxy.
Double_t fPointInit[3]
Definition TGeoHelix.h:25
void SetHelixStep(Double_t hstep)
Set Z step of the helix on a complete turn. Positive or null.
const Double_t * GetCurrentDirection() const
Definition TGeoHelix.h:51
@ kHelixNeedUpdate
Definition TGeoHelix.h:37
@ kHelixCircle
Definition TGeoHelix.h:37
@ kHelixStraight
Definition TGeoHelix.h:37
Bool_t IsRightHanded() const
Definition TGeoHelix.h:55
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 fDirInit[3]
Definition TGeoHelix.h:26
Double_t fStep
Definition TGeoHelix.h:23
void SetCharge(Int_t charge)
Positive charge means left-handed helix.
const Double_t * GetCurrentPoint() const
Definition TGeoHelix.h:50
Double_t fPoint[3]
Definition TGeoHelix.h:27
void InitPoint(Double_t x0, Double_t y0, Double_t z0)
Initialize coordinates of a point on the helix.
Double_t fC
Definition TGeoHelix.h:21
TGeoHelix(const TGeoHelix &)=delete
Double_t fPhi
Definition TGeoHelix.h:24
Int_t fQ
Definition TGeoHelix.h:30
void UpdateHelix()
Update the local helix matrix.
void ResetStep()
Reset current point/direction to initial values.
Mother of all ROOT objects.
Definition TObject.h:41