Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:19

0001 // @(#)root/g3d:$Id$
0002 // Author: Nenad Buncic   29/09/95
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_TPCON
0013 #define ROOT_TPCON
0014 
0015 
0016 ////////////////////////////////////////////////////////////////////////////
0017 //                                                                        //
0018 // TPCON                                                                  //
0019 //                                                                        //
0020 // PCON is a polycone. It has at least 9 parameters, the lower phi limit, //
0021 // the range in phi, the number (at least two) of z planes where the      //
0022 // radius is changing for each z boundary and the z coordinate, the       //
0023 // minimum radius and the maximum radius.                                 //
0024 //                                                                        //
0025 ////////////////////////////////////////////////////////////////////////////
0026 
0027 #include "TShape.h"
0028 
0029 
0030 const Int_t kDiv = 20;               //default number of divisions
0031 
0032 
0033 class TPCON : public TShape {
0034 protected:
0035    // Internal cache
0036    mutable Double_t   *fSiTab;       //! Table of sin(fPhi1) .... sin(fPhil+fDphi1)
0037    mutable Double_t   *fCoTab;       //! Table of cos(fPhi1) .... cos(fPhil+fDphi1)
0038 
0039    Float_t     fPhi1;        // lower phi limit
0040    Float_t     fDphi1;       // range in phi
0041    Int_t       fNdiv;        // number of divisions
0042    Int_t       fNz;          // number of z segments
0043    Float_t    *fRmin;        //[fNz] pointer to array of inside radiuses
0044    Float_t    *fRmax;        //[fNz] pointer to array of outside radiuses
0045    Float_t    *fDz;          //[fNz] pointer to array of half lengths in z
0046 
0047    TPCON(const TPCON&);
0048    TPCON& operator=(const TPCON&);
0049 
0050    virtual void    MakeTableOfCoSin() const;  // Create the table of the fSiTab; fCoTab
0051    virtual void    FillTableOfCoSin(Double_t phi, Double_t angstep,Int_t n) const; // Fill the table of cosin
0052    void    SetPoints(Double_t *points) const override;
0053    virtual Bool_t  SetSegsAndPols(TBuffer3D & buffer) const;
0054 
0055 public:
0056    TPCON();
0057    TPCON(const char *name, const char *title, const char *material, Float_t phi1, Float_t dphi1, Int_t nz);
0058    ~TPCON() override;
0059 
0060    virtual void     DefineSection(Int_t secNum, Float_t z, Float_t rmin, Float_t rmax);
0061    Int_t    DistancetoPrimitive(Int_t px, Int_t py) override;
0062    const TBuffer3D &GetBuffer3D(Int_t reqSections) const override;
0063    virtual Int_t    GetNumberOfDivisions () const {if (fNdiv) return fNdiv; else return kDiv;}
0064    virtual Float_t  GetPhi1() const  {return fPhi1;}
0065    virtual Float_t  GetDhi1() const  {return fDphi1;}
0066    virtual Int_t    GetNz() const    {return fNz;}
0067    virtual Float_t *GetRmin() const  {return fRmin;}
0068    virtual Float_t *GetRmax() const  {return fRmax;}
0069    virtual Float_t *GetDz() const    {return fDz;}
0070    virtual Int_t    GetNdiv() const  {return fNdiv;}
0071    virtual void     SetNumberOfDivisions (Int_t p);
0072    void     Sizeof3D() const override;
0073 
0074    ClassDefOverride(TPCON,2)  //PCON shape
0075 };
0076 
0077 #endif