ROOT  6.06/09
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 #ifndef ROOT_TObject
17 #include "TObject.h"
18 #endif
19 
20 class TGeoHMatrix;
21 
22 ////////////////////////////////////////////////////////////////////////////
23 // //
24 // TGeoHelix - A helix defined by: //
25 // x = (1/c) * COS(phi) //
26 // y = (1/c) * SIN(phi) //
27 // z = s * alfa //
28 // where: //
29 // c = 1/Rxy - curvature in XY plane //
30 // phi - phi angle //
31 // S = 2*PI*s - vertical separation between helix loops //
32 // //
33 ////////////////////////////////////////////////////////////////////////////
34 
35 class TGeoHelix : public TObject
36 {
37 private :
38  Double_t fC; // curvature in XY plane
39  Double_t fS; // Z step of the helix / 2*PI
40  Double_t fStep; // current step
41  Double_t fPhi; // phi angle
42  Double_t fPointInit[3]; // initial point
43  Double_t fDirInit[3]; // normalized initial direction
44  Double_t fPoint[3]; // point after a step
45  Double_t fDir[3]; // direction after a step
46  Double_t fB[3]; // normalized direction for magnetic field
47  Int_t fQ; // right/left-handed (+/- 1) - "charge"
48  TGeoHMatrix *fMatrix; // transformation of local helix frame to MARS
49 
50  TGeoHelix(const TGeoHelix&); // Not implemented
51  TGeoHelix &operator=(const TGeoHelix&); // Not implemented
52 public:
57  };
58  // constructors
59  TGeoHelix();
60  TGeoHelix(Double_t curvature, Double_t step, Int_t charge=1);
61  // destructor
62  virtual ~TGeoHelix();
63 
64  void InitPoint(Double_t x0, Double_t y0, Double_t z0);
65  void InitPoint(Double_t *point);
66  void InitDirection(Double_t dirx, Double_t diry, Double_t dirz, Bool_t is_normalized=kTRUE);
67  void InitDirection(Double_t *dir, Bool_t is_normalized=kTRUE);
68 
69  Double_t ComputeSafeStep(Double_t epsil=1E-6) const;
70  const Double_t *GetCurrentPoint() const {return fPoint;}
71  const Double_t *GetCurrentDirection() const {return fDir;}
72  Double_t GetXYcurvature() const {return fC;}
73  Double_t GetStep() const {return fStep;}
75  Bool_t IsRightHanded() const {return (fQ>0)?kFALSE:kTRUE;} // a positive charge in B field makes a left-handed helix
76 
77  void ResetStep();
79 // Double_t *StepToPlane(Double_t a, Double_t b, Double_t c);
80 
81  void SetCharge(Int_t charge);
82  void SetXYcurvature(Double_t curvature);
83  void SetField(Double_t bx, Double_t by, Double_t bz, Bool_t is_normalized=kTRUE);
84  void SetHelixStep(Double_t hstep);
85 
86  void Step(Double_t step);
87 
88  void UpdateHelix();
89 
90  ClassDef(TGeoHelix, 1) // helix class
91 };
92 
93 #endif
94 
const Double_t * GetCurrentDirection() const
Definition: TGeoHelix.h:71
void SetCharge(Int_t charge)
Positive charge means left-handed helix.
Definition: TGeoHelix.cxx:182
#define BIT(n)
Definition: Rtypes.h:120
void UpdateHelix()
Update the local helix matrix.
Definition: TGeoHelix.cxx:329
Double_t GetTotalCurvature() const
Compute helix total curvature.
Definition: TGeoHelix.cxx:156
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void SetHelixStep(Double_t hstep)
Set Z step of the helix on a complete turn. Positive or null.
Definition: TGeoHelix.cxx:211
const Bool_t kFALSE
Definition: Rtypes.h:92
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:243
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:197
Double_t StepToPlane(Double_t *point, Double_t *norm)
Propagate initial point up to a given Z position in MARS.
Definition: TGeoHelix.cxx:275
Double_t fB[3]
Definition: TGeoHelix.h:46
Double_t GetStep() const
Definition: TGeoHelix.h:73
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:104
Double_t fPhi
Definition: TGeoHelix.h:41
Double_t fPoint[3]
Definition: TGeoHelix.h:44
#define ClassDef(name, id)
Definition: Rtypes.h:254
const Double_t * GetCurrentPoint() const
Definition: TGeoHelix.h:70
virtual ~TGeoHelix()
Destructor.
Definition: TGeoHelix.cxx:95
Int_t fQ
Definition: TGeoHelix.h:47
Double_t fC
Definition: TGeoHelix.h:38
Double_t fStep
Definition: TGeoHelix.h:40
void ResetStep()
Reset current point/direction to initial values.
Definition: TGeoHelix.cxx:225
EGeoHelixTypes
Definition: TGeoHelix.h:53
Bool_t IsRightHanded() const
Definition: TGeoHelix.h:75
Double_t E()
Definition: TMath.h:54
Double_t fS
Definition: TGeoHelix.h:39
void SetXYcurvature(Double_t curvature)
Set XY curvature: c = 1/Rxy.
Definition: TGeoHelix.cxx:165
Double_t fDir[3]
Definition: TGeoHelix.h:45
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:134
double Double_t
Definition: RtypesCore.h:55
TGeoHelix & operator=(const TGeoHelix &)
Mother of all ROOT objects.
Definition: TObject.h:58
Double_t fPointInit[3]
Definition: TGeoHelix.h:42
TGeoHMatrix * fMatrix
Definition: TGeoHelix.h:48
void InitPoint(Double_t x0, Double_t y0, Double_t z0)
Initialize coordinates of a point on the helix.
Definition: TGeoHelix.cxx:115
const Bool_t kTRUE
Definition: Rtypes.h:91
double norm(double *x, double *p)
Definition: unuranDistr.cxx:40
Double_t GetXYcurvature() const
Definition: TGeoHelix.h:72
Double_t fDirInit[3]
Definition: TGeoHelix.h:43