Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
18 class TGeoHMatrix;
19 
20 class TGeoHelix : public TObject
21 {
22 private :
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
34 
35  TGeoHelix(const TGeoHelix&); // Not implemented
36  TGeoHelix &operator=(const TGeoHelix&); // Not implemented
37 public:
38  enum EGeoHelixTypes {
39  kHelixNeedUpdate = BIT(16),
40  kHelixStraight = BIT(17),
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;}
59  Double_t GetTotalCurvature() const;
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();
63  Double_t StepToPlane(Double_t *point, Double_t *norm);
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