Logo ROOT   6.08/07
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 class TGeoHelix : public TObject
23 {
24 private :
25  Double_t fC; // curvature in XY plane
26  Double_t fS; // Z step of the helix / 2*PI
27  Double_t fStep; // current step
28  Double_t fPhi; // phi angle
29  Double_t fPointInit[3]; // initial point
30  Double_t fDirInit[3]; // normalized initial direction
31  Double_t fPoint[3]; // point after a step
32  Double_t fDir[3]; // direction after a step
33  Double_t fB[3]; // normalized direction for magnetic field
34  Int_t fQ; // right/left-handed (+/- 1) - "charge"
35  TGeoHMatrix *fMatrix; // transformation of local helix frame to MARS
36 
37  TGeoHelix(const TGeoHelix&); // Not implemented
38  TGeoHelix &operator=(const TGeoHelix&); // Not implemented
39 public:
44  };
45  // constructors
46  TGeoHelix();
47  TGeoHelix(Double_t curvature, Double_t step, Int_t charge=1);
48  // destructor
49  virtual ~TGeoHelix();
50 
51  void InitPoint(Double_t x0, Double_t y0, Double_t z0);
52  void InitPoint(Double_t *point);
53  void InitDirection(Double_t dirx, Double_t diry, Double_t dirz, Bool_t is_normalized=kTRUE);
54  void InitDirection(Double_t *dir, Bool_t is_normalized=kTRUE);
55 
56  Double_t ComputeSafeStep(Double_t epsil=1E-6) const;
57  const Double_t *GetCurrentPoint() const {return fPoint;}
58  const Double_t *GetCurrentDirection() const {return fDir;}
59  Double_t GetXYcurvature() const {return fC;}
60  Double_t GetStep() const {return fStep;}
62  Bool_t IsRightHanded() const {return (fQ>0)?kFALSE:kTRUE;} // a positive charge in B field makes a left-handed helix
63 
64  void ResetStep();
66 // Double_t *StepToPlane(Double_t a, Double_t b, Double_t c);
67 
68  void SetCharge(Int_t charge);
69  void SetXYcurvature(Double_t curvature);
70  void SetField(Double_t bx, Double_t by, Double_t bz, Bool_t is_normalized=kTRUE);
71  void SetHelixStep(Double_t hstep);
72 
73  void Step(Double_t step);
74 
75  void UpdateHelix();
76 
77  ClassDef(TGeoHelix, 1) // helix class
78 };
79 
80 #endif
81 
Double_t GetTotalCurvature() const
Compute helix total curvature.
Definition: TGeoHelix.cxx:166
void SetCharge(Int_t charge)
Positive charge means left-handed helix.
Definition: TGeoHelix.cxx:192
#define BIT(n)
Definition: Rtypes.h:120
void UpdateHelix()
Update the local helix matrix.
Definition: TGeoHelix.cxx:339
Matrix class used for computing global transformations Should NOT be used for node definition...
Definition: TGeoMatrix.h:410
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:221
const Bool_t kFALSE
Definition: Rtypes.h:92
TGeoHelix()
Dummy constructor.
Definition: TGeoHelix.cxx:62
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 StepToPlane(Double_t *point, Double_t *norm)
Propagate initial point up to a given Z position in MARS.
Definition: TGeoHelix.cxx:285
Double_t fB[3]
Definition: TGeoHelix.h:33
Double_t fPhi
Definition: TGeoHelix.h:28
Double_t fPoint[3]
Definition: TGeoHelix.h:31
#define ClassDef(name, id)
Definition: Rtypes.h:254
Bool_t IsRightHanded() const
Definition: TGeoHelix.h:62
virtual ~TGeoHelix()
Destructor.
Definition: TGeoHelix.cxx:105
Int_t fQ
Definition: TGeoHelix.h:34
Double_t fC
Definition: TGeoHelix.h:25
Double_t fStep
Definition: TGeoHelix.h:27
Double_t GetXYcurvature() const
Definition: TGeoHelix.h:59
void ResetStep()
Reset current point/direction to initial values.
Definition: TGeoHelix.cxx:235
EGeoHelixTypes
Definition: TGeoHelix.h:40
Double_t E()
Definition: TMath.h:54
Double_t fS
Definition: TGeoHelix.h:26
void SetXYcurvature(Double_t curvature)
Set XY curvature: c = 1/Rxy.
Definition: TGeoHelix.cxx:175
Double_t fDir[3]
Definition: TGeoHelix.h:32
const Double_t * GetCurrentDirection() const
Definition: TGeoHelix.h:58
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
Class representing a helix curve.
Definition: TGeoHelix.h:22
double Double_t
Definition: RtypesCore.h:55
TGeoHelix & operator=(const TGeoHelix &)
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t fPointInit[3]
Definition: TGeoHelix.h:29
TGeoHMatrix * fMatrix
Definition: TGeoHelix.h:35
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 GetStep() const
Definition: TGeoHelix.h:60
const Double_t * GetCurrentPoint() const
Definition: TGeoHelix.h:57
void InitPoint(Double_t x0, Double_t y0, Double_t z0)
Initialize coordinates of a point on the helix.
Definition: TGeoHelix.cxx:125
const Bool_t kTRUE
Definition: Rtypes.h:91
double norm(double *x, double *p)
Definition: unuranDistr.cxx:40
Double_t fDirInit[3]
Definition: TGeoHelix.h:30