TPCON.h

Go to the documentation of this file.
00001 // @(#)root/g3d:$Id: TPCON.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Nenad Buncic   29/09/95
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_TPCON
00013 #define ROOT_TPCON
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////////////
00017 //                                                                        //
00018 // TPCON                                                                  //
00019 //                                                                        //
00020 // PCON is a polycone. It has at least 9 parameters, the lower phi limit, //
00021 // the range in phi, the number (at least two) of z planes where the      //
00022 // radius is changing for each z boundary and the z coordinate, the       //
00023 // minimum radius and the maximum radius.                                 //
00024 //                                                                        //
00025 ////////////////////////////////////////////////////////////////////////////
00026 
00027 #ifndef ROOT_TShape
00028 #include "TShape.h"
00029 #endif
00030 
00031 
00032 const Int_t kDiv = 20;               //default number of divisions
00033 
00034 
00035 class TPCON : public TShape {
00036 protected:
00037    // Internal cache
00038    mutable Double_t   *fSiTab;       //! Table of sin(fPhi1) .... sin(fPhil+fDphi1)
00039    mutable Double_t   *fCoTab;       //! Table of cos(fPhi1) .... cos(fPhil+fDphi1)
00040 
00041    Float_t     fPhi1;        // lower phi limit
00042    Float_t     fDphi1;       // range in phi
00043    Int_t       fNdiv;        // number of divisions
00044    Int_t       fNz;          // number of z segments
00045    Float_t    *fRmin;        //[fNz] pointer to array of inside radiuses
00046    Float_t    *fRmax;        //[fNz] pointer to array of outside radiuses
00047    Float_t    *fDz;          //[fNz] pointer to array of half lengths in z
00048         
00049    TPCON(const TPCON&); 
00050    TPCON& operator=(const TPCON&);
00051 
00052    virtual void    MakeTableOfCoSin() const;  // Create the table of the fSiTab; fCoTab
00053    virtual void    FillTableOfCoSin(Double_t phi, Double_t angstep,Int_t n) const; // Fill the table of cosin
00054    virtual void    SetPoints(Double_t *points) const;
00055    virtual Bool_t  SetSegsAndPols(TBuffer3D & buffer) const;
00056 
00057 public:
00058    TPCON();
00059    TPCON(const char *name, const char *title, const char *material, Float_t phi1, Float_t dphi1, Int_t nz);
00060    virtual ~TPCON();
00061 
00062    virtual void     DefineSection(Int_t secNum, Float_t z, Float_t rmin, Float_t rmax);
00063    virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
00064    virtual const TBuffer3D &GetBuffer3D(Int_t reqSections) const;
00065    virtual Int_t    GetNumberOfDivisions () const {if (fNdiv) return fNdiv; else return kDiv;}
00066    virtual Float_t  GetPhi1() const  {return fPhi1;}
00067    virtual Float_t  GetDhi1() const  {return fDphi1;}
00068    virtual Int_t    GetNz() const    {return fNz;}
00069    virtual Float_t *GetRmin() const  {return fRmin;}
00070    virtual Float_t *GetRmax() const  {return fRmax;}
00071    virtual Float_t *GetDz() const    {return fDz;}
00072    virtual Int_t    GetNdiv() const  {return fNdiv;}
00073    virtual void     SetNumberOfDivisions (Int_t p);
00074    virtual void     Sizeof3D() const;
00075 
00076    ClassDef(TPCON,2)  //PCON shape
00077 };
00078 
00079 #endif

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