THelix.h

Go to the documentation of this file.
00001 // @(#)root/g3d:$Id: THelix.h 21901 2008-01-29 10:22:44Z couet $
00002 // Author: Ping Yeh   19/12/97
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_THelix
00013 #define ROOT_THelix
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // THelix                                                               //
00019 //                                                                      //
00020 // A Helix with axis // z-axis:                                         //
00021 //                                                                      //
00022 //  X(t) = X0 - vt / w sin(-wt+phi0)                                    //
00023 //  Y(t) = Y0 + vt / w cos(-wt+phi0)                                    //
00024 //  Z(t) = Z0 + vz t                                                    //
00025 //                                                                      //
00026 //////////////////////////////////////////////////////////////////////////
00027 
00028 #ifndef ROOT_TPolyLine3D
00029 #include "TPolyLine3D.h"
00030 #endif
00031 #ifndef ROOT_TRotMatrix
00032 #include "TRotMatrix.h"
00033 #endif
00034 
00035 enum EHelixRangeType {
00036    kHelixT, kHelixX, kHelixY, kHelixZ, kLabX, kLabY, kLabZ, kUnchanged
00037 };
00038 
00039 
00040 class THelix : public TPolyLine3D {
00041 
00042 protected:
00043    Double_t     fX0;       //Pivot's x position (see parametrization in class doc)
00044    Double_t     fY0;       //Pivot's y position (see parametrization in class doc)
00045    Double_t     fZ0;       //Pivot's z position (see parametrization in class doc)
00046    Double_t     fVt;       //Transverse velocity (constant of motion)
00047    Double_t     fPhi0;     //Initial phase, so vx0 = fVt*cos(fPhi0)
00048    Double_t     fVz;       //Z velocity (constant of motion)
00049    Double_t     fW;        //Angular frequency
00050    Double_t     fAxis[3];  //Direction unit vector of the helix axis
00051    TRotMatrix  *fRotMat;   //Rotation matrix: axis // z  -->  axis // fAxis
00052    Double_t     fRange[2]; //Range of helix parameter t
00053 
00054    THelix& operator=(const THelix&);
00055 
00056    void         SetRotMatrix();    //Set rotation matrix
00057    Double_t     FindClosestPhase(Double_t phi0,  Double_t cosine);
00058 
00059    static Int_t fgMinNSeg;   //minimal number of segments in polyline
00060 
00061 public:
00062    THelix();
00063    THelix(Double_t x,  Double_t y,  Double_t z,
00064           Double_t vx, Double_t vy, Double_t vz,
00065           Double_t w);
00066    THelix(Double_t * xyz, Double_t * v, Double_t w,
00067           Double_t * range=0, EHelixRangeType rtype=kHelixZ,
00068           Double_t * axis=0);
00069    THelix(const THelix &helix);
00070    virtual ~THelix();
00071 
00072    virtual void    Copy(TObject &helix) const;
00073    virtual void    Draw(Option_t *option="");
00074    Option_t       *GetOption() const {return fOption.Data();}
00075    virtual void    Print(Option_t *option="") const;
00076    virtual void    SavePrimitive(ostream &out, Option_t *option = "");
00077    virtual void    SetOption(Option_t *option="") {fOption = option;}
00078    virtual void    SetAxis(Double_t * axis);       //Define new axis
00079    virtual void    SetAxis(Double_t x, Double_t y, Double_t z);
00080    virtual void    SetRange(Double_t * range, EHelixRangeType rtype=kHelixZ);
00081    virtual void    SetRange(Double_t r1, Double_t r2, EHelixRangeType rtype=kHelixZ);
00082    void            SetHelix(Double_t *xyz,  Double_t *v, Double_t w,
00083                             Double_t *range=0, EHelixRangeType type=kUnchanged,
00084                             Double_t *axis=0);
00085 
00086    ClassDef(THelix,2)  //A Helix drawn as a PolyLine3D
00087 };
00088 
00089 #endif

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