TGeoSphere.h

Go to the documentation of this file.
00001 // @(#)root/geom:$Id: TGeoSphere.h 24879 2008-07-18 08:04:40Z brun $
00002 // Author: Andrei Gheata   31/01/02
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_TGeoSphere
00013 #define ROOT_TGeoSphere
00014 
00015 #ifndef ROOT_TGeoBBox
00016 #include "TGeoBBox.h"
00017 #endif
00018 
00019 ////////////////////////////////////////////////////////////////////////////
00020 //                                                                        //
00021 // TGeoSphere - spherical shell class. It takes 6 parameters :            //
00022 //           - inner and outer radius Rmin, Rmax                          //
00023 //           - the theta limits Tmin, Tmax                                //
00024 //           - the phi limits Pmin, Pmax (the sector in phi is considered //
00025 //             starting from Pmin to Pmax counter-clockwise               //
00026 //                                                                        //
00027 ////////////////////////////////////////////////////////////////////////////
00028 
00029 class TGeoSphere : public TGeoBBox
00030 {
00031 protected :
00032 // data members
00033    Int_t                 fNz;     // number of z planes for drawing
00034    Int_t                 fNseg;   // number of segments for drawing
00035    Double_t              fRmin;   // inner radius
00036    Double_t              fRmax;   // outer radius
00037    Double_t              fTheta1; // lower theta limit
00038    Double_t              fTheta2; // higher theta limit
00039    Double_t              fPhi1;   // lower phi limit
00040    Double_t              fPhi2;   // higher phi limit
00041 // methods
00042 
00043 public:
00044    // constructors
00045    TGeoSphere();
00046    TGeoSphere(Double_t rmin, Double_t rmax, Double_t theta1=0, Double_t theta2=180,
00047               Double_t phi1=0, Double_t phi2=360);
00048    TGeoSphere(const char *name, Double_t rmin, Double_t rmax, Double_t theta1=0, Double_t theta2=180,
00049               Double_t phi1=0, Double_t phi2=360);
00050    TGeoSphere(Double_t *param, Int_t nparam=6);
00051    // destructor
00052    virtual ~TGeoSphere();
00053    // methods
00054    virtual Double_t      Capacity() const;
00055    virtual void          ComputeBBox();
00056    virtual void          ComputeNormal(Double_t *point, Double_t *dir, Double_t *norm);
00057    virtual Bool_t        Contains(Double_t *point) const;
00058    virtual Int_t         DistancetoPrimitive(Int_t px, Int_t py);
00059    virtual Double_t      DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1, 
00060                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00061    virtual Double_t      DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1, 
00062                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00063    Double_t              DistToSphere(Double_t *point, Double_t *dir, Double_t rsph, Bool_t check=kTRUE, Bool_t firstcross=kTRUE) const;
00064    virtual TGeoVolume   *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, 
00065                                 Double_t start, Double_t step);
00066    virtual const char   *GetAxisName(Int_t iaxis) const;
00067    virtual Double_t      GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
00068    virtual void          GetBoundingCylinder(Double_t *param) const;
00069    virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
00070    virtual Int_t         GetByteCount() const {return 42;}
00071    virtual TGeoShape    *GetMakeRuntimeShape(TGeoShape * /*mother*/, TGeoMatrix * /*mat*/) const {return 0;}
00072    virtual void          GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
00073    virtual Int_t         GetNmeshVertices() const;
00074    Int_t                 GetNumberOfDivisions() const {return fNseg;}
00075    virtual Bool_t        GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const {return kFALSE;}
00076    Int_t                 GetNz() const   {return fNz;}
00077    virtual Double_t      GetRmin() const {return fRmin;}
00078    virtual Double_t      GetRmax() const {return fRmax;}
00079    Double_t              GetTheta1() const {return fTheta1;}
00080    Double_t              GetTheta2() const {return fTheta2;}
00081    Double_t              GetPhi1() const {return fPhi1;}
00082    Double_t              GetPhi2() const {return fPhi2;}
00083    virtual void          InspectShape() const;
00084    virtual Bool_t        IsCylType() const {return kFALSE;}
00085    Int_t                 IsOnBoundary(Double_t *point) const;
00086    Bool_t                IsPointInside(Double_t *point, Bool_t checkR=kTRUE, Bool_t checkTh=kTRUE, Bool_t checkPh=kTRUE) const;
00087    virtual TBuffer3D    *MakeBuffer3D() const;
00088    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
00089    virtual void          SavePrimitive(ostream &out, Option_t *option = "");
00090    void                  SetSphDimensions(Double_t rmin, Double_t rmax, Double_t theta1,
00091                                        Double_t theta2, Double_t phi1, Double_t phi2);
00092    virtual void          SetNumberOfDivisions(Int_t p);
00093    virtual void          SetDimensions(Double_t *param);
00094    virtual void          SetPoints(Double_t *points) const;
00095    virtual void          SetPoints(Float_t *points) const;
00096    virtual void          SetSegsAndPols(TBuffer3D &buff) const;
00097    virtual void          Sizeof3D() const;
00098 
00099    ClassDef(TGeoSphere, 1)         // sphere class
00100 };
00101 
00102 #endif

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