TGeoHelix.h

Go to the documentation of this file.
00001 // @(#)root/geom:$Id: TGeoHelix.h 21425 2007-12-17 15:59:27Z brun $
00002 // Author: Andrei Gheata   28/04/04
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TGeoHelix
00013 #define ROOT_TGeoHelix
00014 
00015 
00016 #ifndef ROOT_TObject
00017 #include "TObject.h"
00018 #endif
00019 
00020 class TGeoHMatrix;
00021 
00022 ////////////////////////////////////////////////////////////////////////////
00023 //                                                                        //
00024 // TGeoHelix - A helix defined by:                                        //
00025 //     x = (1/c) * COS(phi)                                               //
00026 //     y = (1/c) * SIN(phi)                                               //
00027 //     z = s * alfa                                                       //
00028 // where:                                                                 //
00029 //     c = 1/Rxy  - curvature in XY plane                                 //
00030 //     phi        - phi angle                                             //
00031 //     S = 2*PI*s - vertical separation between helix loops               //
00032 //                                                                        //
00033 ////////////////////////////////////////////////////////////////////////////
00034 
00035 class TGeoHelix  : public TObject
00036 {
00037 private :
00038    Double_t           fC;              // curvature in XY plane
00039    Double_t           fS;              // Z step of the helix / 2*PI
00040    Double_t           fStep;           // current step
00041    Double_t           fPhi;            // phi angle
00042    Double_t           fPointInit[3];   // initial point
00043    Double_t           fDirInit[3];     // normalized initial direction
00044    Double_t           fPoint[3];       // point after a step
00045    Double_t           fDir[3];         // direction after a step
00046    Double_t           fB[3];           // normalized direction for magnetic field
00047    Int_t              fQ;              // right/left-handed (+/- 1) - "charge"
00048    TGeoHMatrix       *fMatrix;         // transformation of local helix frame to MARS   
00049  
00050 public:
00051    enum EGeoHelixTypes {
00052       kHelixNeedUpdate =   BIT(16),
00053       kHelixStraigth   =   BIT(17),
00054       kHelixCircle     =   BIT(18)
00055    };
00056    // constructors
00057    TGeoHelix();
00058    TGeoHelix(Double_t curvature, Double_t step, Int_t charge=1);
00059    // destructor
00060    virtual ~TGeoHelix();
00061 
00062    void            InitPoint(Double_t x0, Double_t y0, Double_t z0);
00063    void            InitPoint(Double_t *point);
00064    void            InitDirection(Double_t dirx, Double_t diry, Double_t dirz, Bool_t is_normalized=kTRUE);
00065    void            InitDirection(Double_t *dir, Bool_t is_normalized=kTRUE);
00066    
00067    Double_t        ComputeSafeStep(Double_t epsil=1E-6) const;
00068    const Double_t *GetCurrentPoint() const {return fPoint;}
00069    const Double_t *GetCurrentDirection() const {return fDir;}
00070    Double_t        GetXYcurvature() const {return fC;}
00071    Double_t        GetStep() const {return fStep;}
00072    Double_t        GetTotalCurvature() const;
00073    Bool_t          IsRightHanded() const {return (fQ>0)?kFALSE:kTRUE;} // a positive charge in B field makes a left-handed helix
00074 
00075    void            ResetStep();
00076    Double_t        StepToPlane(Double_t *point, Double_t *norm);
00077 //   Double_t       *StepToPlane(Double_t a, Double_t b, Double_t c);
00078    
00079    void            SetCharge(Int_t charge);
00080    void            SetXYcurvature(Double_t curvature);
00081    void            SetField(Double_t bx, Double_t by, Double_t bz, Bool_t is_normalized=kTRUE);
00082    void            SetHelixStep(Double_t hstep);
00083    
00084    void            Step(Double_t step);
00085    
00086    void            UpdateHelix();
00087 
00088    ClassDef(TGeoHelix, 1)              // helix class
00089 };
00090 
00091 #endif
00092 

Generated on Tue Jul 5 14:12:15 2011 for ROOT_528-00b_version by  doxygen 1.5.1