Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGeoHelix.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/geom:$Id$
0002 // Author: Andrei Gheata   28/04/04
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGeoHelix
0013 #define ROOT_TGeoHelix
0014 
0015 #include "TObject.h"
0016 
0017 class TGeoHMatrix;
0018 
0019 class TGeoHelix : public TObject {
0020 private:
0021    Double_t fC;                   // curvature in XY plane
0022    Double_t fS;                   // Z step of the helix / 2*PI
0023    Double_t fStep;                // current step
0024    Double_t fPhi;                 // phi angle
0025    Double_t fPointInit[3];        // initial point
0026    Double_t fDirInit[3];          // normalized initial direction
0027    Double_t fPoint[3];            // point after a step
0028    Double_t fDir[3];              // direction after a step
0029    Double_t fB[3];                // normalized direction for magnetic field
0030    Int_t fQ;                      // right/left-handed (+/- 1) - "charge"
0031    TGeoHMatrix *fMatrix{nullptr}; // transformation of local helix frame to MARS
0032 
0033    TGeoHelix(const TGeoHelix &) = delete;
0034    TGeoHelix &operator=(const TGeoHelix &) = delete;
0035 
0036 public:
0037    enum EGeoHelixTypes { kHelixNeedUpdate = BIT(16), kHelixStraight = BIT(17), kHelixCircle = BIT(18) };
0038    // constructors
0039    TGeoHelix();
0040    TGeoHelix(Double_t curvature, Double_t step, Int_t charge = 1);
0041    // destructor
0042    ~TGeoHelix() override;
0043 
0044    void InitPoint(Double_t x0, Double_t y0, Double_t z0);
0045    void InitPoint(Double_t *point);
0046    void InitDirection(Double_t dirx, Double_t diry, Double_t dirz, Bool_t is_normalized = kTRUE);
0047    void InitDirection(Double_t *dir, Bool_t is_normalized = kTRUE);
0048 
0049    Double_t ComputeSafeStep(Double_t epsil = 1E-6) const;
0050    const Double_t *GetCurrentPoint() const { return fPoint; }
0051    const Double_t *GetCurrentDirection() const { return fDir; }
0052    Double_t GetXYcurvature() const { return fC; }
0053    Double_t GetStep() const { return fStep; }
0054    Double_t GetTotalCurvature() const;
0055    Bool_t IsRightHanded() const
0056    {
0057       return (fQ > 0) ? kFALSE : kTRUE;
0058    } // a positive charge in B field makes a left-handed helix
0059 
0060    void ResetStep();
0061    Double_t StepToPlane(Double_t *point, Double_t *norm);
0062    //   Double_t       *StepToPlane(Double_t a, Double_t b, Double_t c);
0063 
0064    void SetCharge(Int_t charge);
0065    void SetXYcurvature(Double_t curvature);
0066    void SetField(Double_t bx, Double_t by, Double_t bz, Bool_t is_normalized = kTRUE);
0067    void SetHelixStep(Double_t hstep);
0068 
0069    void Step(Double_t step);
0070 
0071    void UpdateHelix();
0072 
0073    ClassDefOverride(TGeoHelix, 1) // helix class
0074 };
0075 
0076 #endif