Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/g3d:$Id$
0002 // Author: Ping Yeh   19/12/97
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_THelix
0013 #define ROOT_THelix
0014 
0015 #include "TPolyLine3D.h"
0016 #include "TRotMatrix.h"
0017 
0018 enum EHelixRangeType {
0019    kHelixT, kHelixX, kHelixY, kHelixZ, kLabX, kLabY, kLabZ, kUnchanged
0020 };
0021 
0022 
0023 class THelix : public TPolyLine3D {
0024 
0025 protected:
0026    Double_t     fX0;       //Pivot's x position (see parametrization in class doc)
0027    Double_t     fY0;       //Pivot's y position (see parametrization in class doc)
0028    Double_t     fZ0;       //Pivot's z position (see parametrization in class doc)
0029    Double_t     fVt;       //Transverse velocity (constant of motion)
0030    Double_t     fPhi0;     //Initial phase, so vx0 = fVt*cos(fPhi0)
0031    Double_t     fVz;       //Z velocity (constant of motion)
0032    Double_t     fW;        //Angular frequency
0033    Double_t     fAxis[3];  //Direction unit vector of the helix axis
0034    TRotMatrix  *fRotMat;   //Rotation matrix: axis // z  -->  axis // fAxis
0035    Double_t     fRange[2]; //Range of helix parameter t
0036 
0037    THelix& operator=(const THelix&);
0038 
0039    void         SetRotMatrix();    //Set rotation matrix
0040    Double_t     FindClosestPhase(Double_t phi0,  Double_t cosine);
0041 
0042    static Int_t fgMinNSeg;   //minimal number of segments in polyline
0043 
0044 public:
0045    THelix();
0046    THelix(Double_t x,  Double_t y,  Double_t z,
0047           Double_t vx, Double_t vy, Double_t vz,
0048           Double_t w);
0049    THelix(Double_t const* xyz, Double_t const* v, Double_t w,
0050           Double_t const* range=nullptr, EHelixRangeType rtype=kHelixZ,
0051           Double_t const* axis=nullptr);
0052    THelix(const THelix &helix);
0053    ~THelix() override;
0054 
0055    void    Copy(TObject &helix) const override;
0056    void    Draw(Option_t *option="") override;
0057    Option_t       *GetOption() const override {return fOption.Data();}
0058    void    Print(Option_t *option="") const override;
0059    void    SavePrimitive(std::ostream &out, Option_t *option = "") override;
0060    void    SetOption(Option_t *option="") override {fOption = option;}
0061    virtual void    SetAxis(Double_t const* axis);       //Define new axis
0062    virtual void    SetAxis(Double_t x, Double_t y, Double_t z);
0063    virtual void    SetRange(Double_t * range, EHelixRangeType rtype=kHelixZ);
0064    virtual void    SetRange(Double_t r1, Double_t r2, EHelixRangeType rtype=kHelixZ);
0065    void            SetHelix(Double_t const* xyz,  Double_t const* v, Double_t w,
0066                             Double_t const* range=nullptr, EHelixRangeType type=kUnchanged,
0067                             Double_t const* axis=nullptr);
0068 
0069    ClassDefOverride(THelix,2)  //A Helix drawn as a PolyLine3D
0070 };
0071 
0072 #endif