TGeoCone.h

Go to the documentation of this file.
00001 // @(#)root/geom:$Id: TGeoCone.h 24870 2008-07-17 16:30:58Z 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_TGeoCone
00013 #define ROOT_TGeoCone
00014 
00015 #ifndef ROOT_TGeoBBox
00016 #include "TGeoBBox.h"
00017 #endif
00018 
00019 
00020 
00021 ////////////////////////////////////////////////////////////////////////////
00022 //                                                                        //
00023 // TGeoCone - conical tube  class. It has 5 parameters :                  //
00024 //            dz - half length in z                                       //
00025 //            Rmin1, Rmax1 - inside and outside radii at -dz              //
00026 //            Rmin2, Rmax2 - inside and outside radii at +dz              //
00027 //                                                                        //
00028 ////////////////////////////////////////////////////////////////////////////
00029 
00030 
00031 class TGeoCone : public TGeoBBox
00032 {
00033 protected :
00034 // data members
00035    Double_t              fDz;    // half length
00036    Double_t              fRmin1; // inner radius at -dz
00037    Double_t              fRmax1; // outer radius at -dz
00038    Double_t              fRmin2; // inner radius at +dz
00039    Double_t              fRmax2; // outer radius at +dz
00040 // methods
00041 public:
00042    // constructors
00043    TGeoCone();
00044    TGeoCone(Double_t dz, Double_t rmin1, Double_t rmax1,
00045             Double_t rmin2, Double_t rmax2);
00046    TGeoCone(const char *name, Double_t dz, Double_t rmin1, Double_t rmax1,
00047             Double_t rmin2, Double_t rmax2);
00048    TGeoCone(Double_t *params);
00049    // destructor
00050    virtual ~TGeoCone();
00051    // methods
00052 
00053    virtual Double_t      Capacity() const;
00054    static  Double_t      Capacity(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
00055    virtual void          ComputeBBox();
00056    virtual void          ComputeNormal(Double_t *point, Double_t *dir, Double_t *norm);
00057    static  void          ComputeNormalS(Double_t *point, Double_t *dir, Double_t *norm,
00058                                         Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
00059    virtual Bool_t        Contains(Double_t *point) const;
00060    virtual Int_t         DistancetoPrimitive(Int_t px, Int_t py);
00061    static  void          DistToCone(Double_t *point, Double_t *dir, Double_t dz, Double_t r1, Double_t r2, Double_t &b, Double_t &delta);   
00062    static  Double_t      DistFromInsideS(Double_t *point, Double_t *dir, Double_t dz,
00063                                     Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
00064    virtual Double_t      DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1, 
00065                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00066    static  Double_t      DistFromOutsideS(Double_t *point, Double_t *dir, Double_t dz,
00067                                    Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
00068    virtual Double_t      DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1, 
00069                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00070    virtual TGeoVolume   *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, 
00071                                 Double_t start, Double_t step);
00072 
00073    virtual const char   *GetAxisName(Int_t iaxis) const;
00074    virtual Double_t      GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
00075    virtual void          GetBoundingCylinder(Double_t *param) const;
00076    virtual Int_t         GetByteCount() const {return 56;}
00077    virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
00078    virtual Double_t      GetDz() const    {return fDz;}
00079    virtual TGeoShape    *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
00080    virtual void          GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
00081    virtual Int_t         GetNmeshVertices() const;
00082    virtual Bool_t        GetPointsOnSegments(Int_t npoints, Double_t *array) const;
00083    virtual Double_t      GetRmin1() const {return fRmin1;}
00084    virtual Double_t      GetRmax1() const {return fRmax1;}
00085    virtual Double_t      GetRmin2() const {return fRmin2;}
00086    virtual Double_t      GetRmax2() const {return fRmax2;}
00087    
00088    virtual void          InspectShape() const;
00089    virtual Bool_t        IsCylType() const {return kTRUE;}
00090    virtual TBuffer3D    *MakeBuffer3D() const;
00091    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
00092    static  Double_t      SafetyS(Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1,
00093                                  Double_t rmin2, Double_t rmax2, Int_t skipz=0);
00094    virtual void          SavePrimitive(ostream &out, Option_t *option = "");
00095    void                  SetConeDimensions(Double_t dz, Double_t rmin1, Double_t rmax1,
00096                                        Double_t rmin2, Double_t rmax2);
00097    virtual void          SetDimensions(Double_t *param);
00098    virtual void          SetPoints(Double_t *points) const;
00099    virtual void          SetPoints(Float_t *points) const;
00100    virtual void          SetSegsAndPols(TBuffer3D &buffer) const;
00101    virtual void          Sizeof3D() const;
00102 
00103    ClassDef(TGeoCone, 1)         // conical tube class
00104 
00105 };
00106 
00107 ////////////////////////////////////////////////////////////////////////////
00108 //                                                                        //
00109 // TGeoConeSeg - a phi segment of a conical tube. Has 7 parameters :      //
00110 //            - the same 5 as a cone;                                     //
00111 //            - first phi limit (in degrees)                              //
00112 //            - second phi limit                                          //
00113 //                                                                        //
00114 ////////////////////////////////////////////////////////////////////////////
00115 
00116 class TGeoConeSeg : public TGeoCone
00117 {
00118 protected:
00119    // data members
00120    Double_t              fPhi1;  // first phi limit 
00121    Double_t              fPhi2;  // second phi limit 
00122     
00123 public:
00124    // constructors
00125    TGeoConeSeg();
00126    TGeoConeSeg(Double_t dz, Double_t rmin1, Double_t rmax1,
00127                Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2);
00128    TGeoConeSeg(const char *name, Double_t dz, Double_t rmin1, Double_t rmax1,
00129                Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2);
00130    TGeoConeSeg(Double_t *params);
00131    // destructor
00132    virtual ~TGeoConeSeg();
00133    // methods
00134    virtual Double_t      Capacity() const;
00135    static  Double_t      Capacity(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2);
00136    virtual void          ComputeBBox();
00137    virtual void          ComputeNormal(Double_t *point, Double_t *dir, Double_t *norm);
00138    static  void          ComputeNormalS(Double_t *point, Double_t *dir, Double_t *norm,
00139                                         Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2,
00140                                         Double_t c1, Double_t s1, Double_t c2, Double_t s2);
00141    virtual Bool_t        Contains(Double_t *point) const;
00142 
00143    
00144    virtual Int_t         DistancetoPrimitive(Int_t px, Int_t py);
00145    static  Double_t      DistToCons(Double_t *point, Double_t *dir, Double_t r1, Double_t z1, Double_t r2, Double_t z2, Double_t phi1, Double_t phi2);
00146    static  Double_t      DistFromInsideS(Double_t *point, Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, 
00147                                    Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi);
00148    virtual Double_t      DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1, 
00149                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00150    static  Double_t      DistFromOutsideS(Double_t *point, Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, 
00151                                    Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi);   
00152    virtual Double_t      DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1, 
00153                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00154    virtual TGeoVolume   *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, 
00155                                 Double_t start, Double_t step);
00156    virtual Double_t      GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
00157    virtual void          GetBoundingCylinder(Double_t *param) const;
00158    virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
00159    virtual Int_t         GetByteCount() const {return 64;}
00160    virtual TGeoShape    *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
00161    virtual void          GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
00162    virtual Int_t         GetNmeshVertices() const;
00163    virtual Bool_t        GetPointsOnSegments(Int_t npoints, Double_t *array) const;
00164    Double_t              GetPhi1() const {return fPhi1;}
00165    Double_t              GetPhi2() const {return fPhi2;}
00166    virtual void          InspectShape() const;
00167    virtual TBuffer3D    *MakeBuffer3D() const;
00168    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
00169    static  Double_t      SafetyS(Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1,
00170                                  Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2, Int_t skipz=0);
00171    virtual void          SavePrimitive(ostream &out, Option_t *option = "");
00172    void                  SetConsDimensions(Double_t dz, Double_t rmin1, Double_t rmax1,
00173                                        Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2);
00174    virtual void          SetDimensions(Double_t *param);
00175    virtual void          SetPoints(Double_t *points) const;
00176    virtual void          SetPoints(Float_t *points) const;
00177    virtual void          SetSegsAndPols(TBuffer3D &buffer) const;
00178    virtual void          Sizeof3D() const;
00179 
00180    ClassDef(TGeoConeSeg, 1)         // conical tube segment class 
00181 };
00182 
00183 #endif

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