TGeoTorus.h

Go to the documentation of this file.
00001 // @(#)root/base:$Id: TGeoTorus.h 24879 2008-07-18 08:04:40Z brun $
00002 // Author: Andrei Gheata   28/07/03
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_TGeoTorus
00013 #define ROOT_TGeoTorus
00014 
00015 #ifndef ROOT_TGeoBBox
00016 #include "TGeoBBox.h"
00017 #endif
00018 
00019 ////////////////////////////////////////////////////////////////////////////
00020 //                                                                        //
00021 // TGeoTorus - Torus segment class. A torus has 5 parameters :            //
00022 //            R    - axial radius                                         //
00023 //            Rmin - inner radius                                         //
00024 //            Rmax - outer radius                                         //
00025 //            Phi1 - starting phi                                         //
00026 //            Dphi - phi extent                                           //
00027 //                                                                        //
00028 ////////////////////////////////////////////////////////////////////////////
00029 
00030 class TGeoTorus : public TGeoBBox
00031 {
00032 protected :
00033 // data members
00034    Double_t              fR;    // axial radius
00035    Double_t              fRmin; // inner radius
00036    Double_t              fRmax; // outer radius
00037    Double_t              fPhi1; // starting phi
00038    Double_t              fDphi; // phi extent
00039 // methods
00040 
00041 public:
00042    virtual Double_t      Capacity() const;
00043    Double_t              Daxis(Double_t *pt, Double_t *dir, Double_t t) const;
00044    Double_t              DDaxis(Double_t *pt, Double_t *dir, Double_t t) const;
00045    Double_t              DDDaxis(Double_t *pt, Double_t *dir, Double_t t) const;
00046    Double_t              ToBoundary(Double_t *pt, Double_t *dir, Double_t r) const;
00047    Int_t                 SolveCubic(Double_t a, Double_t b, Double_t c, Double_t *x) const;
00048    Int_t                 SolveQuartic(Double_t a, Double_t b, Double_t c, Double_t d, Double_t *x) const;
00049 public:
00050    // constructors
00051    TGeoTorus();
00052    TGeoTorus(Double_t r, Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360);
00053    TGeoTorus(const char * name, Double_t r, Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360);
00054    TGeoTorus(Double_t *params);
00055    // destructor
00056    virtual ~TGeoTorus() {}
00057    // methods
00058 
00059    virtual void          ComputeBBox();
00060    virtual void          ComputeNormal(Double_t *point, Double_t *dir, Double_t *norm);
00061    virtual Bool_t        Contains(Double_t *point) const;
00062    virtual Double_t      DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1, 
00063                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00064    virtual Double_t      DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1, 
00065                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00066    virtual Int_t         DistancetoPrimitive(Int_t px, Int_t py);
00067    virtual TGeoVolume   *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, 
00068                                 Double_t start, Double_t step);
00069    virtual const char   *GetAxisName(Int_t iaxis) const;
00070    virtual Double_t      GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
00071    virtual void          GetBoundingCylinder(Double_t *param) const;
00072    virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
00073    virtual Int_t         GetByteCount() const {return 56;}
00074    virtual TGeoShape    *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
00075    virtual void          GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
00076    virtual Int_t         GetNmeshVertices() const;
00077    virtual Bool_t        GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const {return kFALSE;}
00078    Double_t              GetR() const    {return fR;}
00079    Double_t              GetRmin() const {return fRmin;}
00080    Double_t              GetRmax() const {return fRmax;}
00081    Double_t              GetPhi1() const {return fPhi1;}
00082    Double_t              GetDphi() const {return fDphi;}
00083    virtual void          InspectShape() const;
00084    virtual Bool_t        IsCylType() const {return kTRUE;}
00085    virtual TBuffer3D    *MakeBuffer3D() const;
00086    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
00087    virtual void          SavePrimitive(ostream &out, Option_t *option = "");
00088    void                  SetTorusDimensions(Double_t r, Double_t rmin, Double_t rmax, Double_t phi1, Double_t dphi);
00089    virtual void          SetDimensions(Double_t *param);
00090    virtual void          SetPoints(Double_t *points) const;
00091    virtual void          SetPoints(Float_t *points) const;
00092    virtual void          SetSegsAndPols(TBuffer3D &buff) const;
00093    virtual void          Sizeof3D() const;
00094 
00095    ClassDef(TGeoTorus, 1)         // torus class
00096 
00097 };
00098 
00099 #endif

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