Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TSPHE.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: Rene Brun   13/06/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_TSPHE
0013 #define ROOT_TSPHE
0014 
0015 
0016 ////////////////////////////////////////////////////////////////////////////
0017 //                                                                        //
0018 // TSPHE                                                                  //
0019 //                                                                        //
0020 // SPHE is Sphere. Not implemented yet.                                   //
0021 //                                                                        //
0022 ////////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TShape.h"
0025 
0026 // const Int_t kDiv = 30;               //default number of z segments for semi-sphere
0027 
0028 class TSPHE : public TShape {
0029 private:
0030    // Internal cache
0031    mutable Double_t  *fSiTab;       //! Table of sin(fPhimin) .... sin(Phi)
0032    mutable Double_t  *fCoTab;       //! Table of cos(fPhimin) .... cos(Phi)
0033    mutable Double_t  *fCoThetaTab;  //! Table of sin(gThemin) .... cos(Theta)
0034    Int_t      fNdiv;        // number of divisions
0035    Int_t      fNz;          //! number of sections
0036    Float_t    fAspectRatio; // Relation between asumth and grid size (by default 1.0)
0037 
0038 protected:
0039    Float_t fRmin;    // minimum radius
0040    Float_t fRmax;    // maximum radius
0041    Float_t fThemin;  // minimum theta
0042    Float_t fThemax;  // maximum theta
0043    Float_t fPhimin;  // minimum phi
0044    Float_t fPhimax;  // maximum phi
0045    Float_t faX;      // Coeff along Ox
0046    Float_t faY;      // Coeff along Oy
0047    Float_t faZ;      // Coeff along Oz
0048 
0049    virtual void    MakeTableOfCoSin() const;  // Create the table of the fSiTab; fCoTab
0050    void    SetPoints(Double_t *points) const override;
0051 
0052 public:
0053    TSPHE();
0054    TSPHE(const char *name, const char *title, const char *material, Float_t rmin, Float_t rmax, Float_t themin,
0055          Float_t themax, Float_t phimin, Float_t phimax);
0056    TSPHE(const char *name, const char *title, const char *material, Float_t rmax);
0057    ~TSPHE() override;
0058    Int_t   DistancetoPrimitive(Int_t px, Int_t py) override;
0059    const TBuffer3D &GetBuffer3D(Int_t reqSections) const override;
0060    virtual Float_t GetRmin() const {return fRmin;}
0061    virtual Float_t GetRmax() const {return fRmax;}
0062    virtual Float_t GetThemin() const {return fThemin;}
0063    virtual Float_t GetThemax() const {return fThemax;}
0064    virtual Float_t GetPhimin() const {return fPhimin;}
0065    virtual Float_t GetPhimax() const {return fPhimax;}
0066    virtual Float_t GetAspectRatio() const { return fAspectRatio;}
0067    virtual Int_t   GetNumberOfDivisions () const {return fNdiv;}
0068    virtual void    SetAspectRatio(Float_t factor=1.0){ fAspectRatio = factor; MakeTableOfCoSin();}
0069    virtual void    SetEllipse(const Float_t *factors);
0070    virtual void    SetNumberOfDivisions (Int_t p);
0071    void    Sizeof3D() const override;
0072 
0073    ClassDefOverride(TSPHE,3)  //SPHE shape
0074 };
0075 
0076 #endif