TGeoHype.h

Go to the documentation of this file.
00001 // @(#)root/geom:$Id: TGeoHype.h 24879 2008-07-18 08:04:40Z brun $
00002 // Author: Mihaela Gheata   20/11/04
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_TGeoHype
00013 #define ROOT_TGeoHype
00014 
00015 #ifndef ROOT_TGeoTube
00016 #include "TGeoTube.h"
00017 #endif
00018 
00019 ///////////////////////////////////////////////////////////////////////////////
00020 //                                                                        
00021 // TGeoHype - Hyperboloid class defined by 5 parameters. Bounded by:
00022 //            - Two z planes at z=+/-dz
00023 //            - Inner and outer lateral surfaces. These represent the surfaces 
00024 //              described by the revolution of 2 hyperbolas about the Z axis:
00025 //               r^2 - (t*z)^2 = a^2
00026 //
00027 //            r = distance between hyperbola and Z axis at coordinate z
00028 //            t = tangent of the stereo angle (angle made by hyperbola
00029 //                asimptotic lines and Z axis). t=0 means cylindrical surface.
00030 //            a = distance between hyperbola and Z axis at z=0
00031 //
00032 //          The inner hyperbolic surface is described by:
00033 //              r^2 - (tin*z)^2 = rin^2 
00034 //           - absence of the inner surface (filled hyperboloid can be forced 
00035 //             by rin=0 and sin=0
00036 //          The outer hyperbolic surface is described by:
00037 //              r^2 - (tout*z)^2 = rout^2
00038 //  TGeoHype parameters: dz[cm], rin[cm], sin[deg], rout[cm], sout[deg].
00039 //    MANDATORY conditions:
00040 //           - rin < rout
00041 //           - rout > 0
00042 //           - rin^2 + (tin*dz)^2 > rout^2 + (tout*dz)^2
00043 //                                                                        
00044 ///////////////////////////////////////////////////////////////////////////////
00045 
00046 
00047 class TGeoHype : public TGeoTube
00048 {
00049 protected :
00050 // data members inherited from TGeoTube:
00051 //   Double_t              fRmin; // inner radius at z=0
00052 //   Double_t              fRmax; // outer radius at z=0
00053 //   Double_t              fDz;   // half length
00054    Double_t              fStIn;   // Stereo angle for inner surface
00055    Double_t              fStOut;  // Stereo angle for inner surface
00056 
00057 private :
00058 // Precomputed parameters:
00059    Double_t              fTin;    // Tangent of stereo angle for inner surface
00060    Double_t              fTout;   // Tangent of stereo angle for outer surface
00061    Double_t              fTinsq;  // Squared tangent of stereo angle for inner surface
00062    Double_t              fToutsq; // Squared tangent of stereo angle for outer surface
00063 
00064 public:
00065    // constructors
00066    TGeoHype();
00067    TGeoHype(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
00068    TGeoHype(const char *name, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
00069    TGeoHype(Double_t *params);
00070    // destructor
00071    virtual ~TGeoHype();
00072    // methods
00073 
00074    virtual Double_t      Capacity() const;
00075    virtual void          ComputeBBox();
00076    virtual void          ComputeNormal(Double_t *point, Double_t *dir, Double_t *norm);
00077    virtual Bool_t        Contains(Double_t *point) const;
00078    virtual Double_t      DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1, 
00079                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00080    virtual Double_t      DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1, 
00081                                    Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00082    Int_t                 DistToHype(Double_t *point, Double_t *dir, Double_t *s, Bool_t inner) const;
00083    virtual Int_t         DistancetoPrimitive(Int_t px, Int_t py);
00084    virtual TGeoVolume   *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, 
00085                                 Double_t start, Double_t step);
00086    virtual Double_t      GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
00087    virtual void          GetBoundingCylinder(Double_t *param) const;
00088    virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
00089    virtual Int_t         GetByteCount() const {return 64;}
00090    virtual Bool_t        GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const {return kFALSE;}
00091    virtual TGeoShape    *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
00092    virtual void          GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
00093    virtual Int_t         GetNmeshVertices() const;
00094    Double_t              GetStIn() const {return fStIn;}
00095    Double_t              GetStOut() const {return fStOut;}
00096    Bool_t                HasInner() const {return !TestShapeBit(kGeoRSeg);}
00097    Double_t              RadiusHypeSq(Double_t z, Bool_t inner) const;
00098    Double_t              ZHypeSq(Double_t r, Bool_t inner) const;
00099    virtual void          InspectShape() const;
00100    virtual Bool_t        IsCylType() const {return kTRUE;}
00101    virtual TBuffer3D    *MakeBuffer3D() const;
00102    //virtual void          Paint(Option_t *option);
00103    virtual Double_t      Safety(Double_t *point, Bool_t in=kTRUE) const;
00104    Double_t              SafetyToHype(Double_t *point, Bool_t inner, Bool_t in) const;
00105    virtual void          SavePrimitive(ostream &out, Option_t *option = "");
00106    void                  SetHypeDimensions(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
00107    virtual void          SetDimensions(Double_t *param);
00108    virtual void          SetPoints(Double_t *points) const;
00109    virtual void          SetPoints(Float_t *points) const;
00110    virtual void          SetSegsAndPols(TBuffer3D &buff) const;
00111    virtual void          Sizeof3D() const;
00112 
00113    ClassDef(TGeoHype, 1)         // hyperboloid class
00114 
00115 };
00116 
00117 #endif

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