# class TGeoHype: public TGeoTube

``` TGeoHype - Hyperboloid class defined by 5 parameters. Bounded by:
- Two z planes at z=+/-dz
- Inner and outer lateral surfaces. These represent the surfaces
described by the revolution of 2 hyperbolas about the Z axis:
r^2 - (t*z)^2 = a^2

r = distance between hyperbola and Z axis at coordinate z
t = tangent of the stereo angle (angle made by hyperbola
asimptotic lines and Z axis). t=0 means cylindrical surface.
a = distance between hyperbola and Z axis at z=0

The inner hyperbolic surface is described by:
r^2 - (tin*z)^2 = rin^2
- absence of the inner surface (filled hyperboloid can be forced
by rin=0 and sin=0
The outer hyperbolic surface is described by:
r^2 - (tout*z)^2 = rout^2
TGeoHype parameters: dz[cm], rin[cm], sin[deg], rout[cm], sout[deg].
MANDATORY conditions:
- rin < rout
- rout > 0
- rin^2 + (tin*dz)^2 > rout^2 + (tout*dz)^2
SUPPORTED CASES:
- rin = 0, tin != 0     => inner surface conical
- tin=0 AND/OR tout=0   => corresponding surface(s) cyllindrical
e.g. tin=0 AND tout=0 => shape becomes a tube with: rmin,rmax,dz

```

## Function Members (Methods)

public:
 TGeoHype() TGeoHype(Double_t* params) TGeoHype(const TGeoHype&) TGeoHype(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz) TGeoHype(const char* name, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz) virtual ~TGeoHype() void TObject::AbstractMethod(const char* method) const virtual void TObject::AppendPad(Option_t* option = "") static Bool_t TGeoBBox::AreOverlapping(const TGeoBBox* box1, const TGeoMatrix* mat1, const TGeoBBox* box2, const TGeoMatrix* mat2) static Double_t TGeoShape::Big() virtual void TObject::Browse(TBrowser* b) virtual Double_t Capacity() const static TClass* Class() virtual const char* TObject::ClassName() const virtual void TNamed::Clear(Option_t* option = "") virtual TObject* TNamed::Clone(const char* newname = "") const virtual Int_t TNamed::Compare(const TObject* obj) const virtual void ComputeBBox() virtual void ComputeNormal(Double_t* point, Double_t* dir, Double_t* norm) static void TGeoTube::ComputeNormalS(Double_t* point, Double_t* dir, Double_t* norm, Double_t rmin, Double_t rmax, Double_t dz) virtual Bool_t Contains(Double_t* point) const virtual void TNamed::Copy(TObject& named) const virtual Bool_t TGeoBBox::CouldBeCrossed(Double_t* point, Double_t* dir) const virtual void TObject::Delete(Option_t* option = "") virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) virtual Double_t DistFromInside(Double_t* point, Double_t* dir, Int_t iact = 1, Double_t step = TGeoShape::Big(), Double_t* safe = 0) const static Double_t TGeoTube::DistFromInsideS(Double_t* point, Double_t* dir, Double_t rmin, Double_t rmax, Double_t dz) virtual Double_t DistFromOutside(Double_t* point, Double_t* dir, Int_t iact = 1, Double_t step = TGeoShape::Big(), Double_t* safe = 0) const static Double_t TGeoTube::DistFromOutsideS(Double_t* point, Double_t* dir, Double_t rmin, Double_t rmax, Double_t dz) Int_t DistToHype(Double_t* point, Double_t* dir, Double_t* s, Bool_t inner) const static Double_t TGeoShape::DistToPhiMin(Double_t* point, Double_t* dir, Double_t s1, Double_t c1, Double_t s2, Double_t c2, Double_t sm, Double_t cm, Bool_t in = kTRUE) static void TGeoTube::DistToTube(Double_t rsq, Double_t nsq, Double_t rdotn, Double_t radius, Double_t& b, Double_t& delta) virtual TGeoVolume* Divide(TGeoVolume* voldiv, const char* divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) virtual void TGeoShape::Draw(Option_t* option = "") virtual void TObject::DrawClass() const virtual TObject* TObject::DrawClone(Option_t* option = "") const virtual void TObject::Dump() const virtual void TObject::Error(const char* method, const char* msgfmt) const virtual void TObject::Execute(const char* method, const char* params, Int_t* error = 0) virtual void TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) virtual void TGeoShape::ExecuteEvent(Int_t event, Int_t px, Int_t py) virtual void TObject::Fatal(const char* method, const char* msgfmt) const virtual void TNamed::FillBuffer(char*& buffer) virtual TObject* TObject::FindObject(const char* name) const virtual TObject* TObject::FindObject(const TObject* obj) const virtual const char* TGeoTube::GetAxisName(Int_t iaxis) const virtual Double_t GetAxisRange(Int_t iaxis, Double_t& xlo, Double_t& xhi) const virtual void GetBoundingCylinder(Double_t* param) const virtual const TBuffer3D& GetBuffer3D(Int_t reqSections, Bool_t localFrame) const virtual Int_t GetByteCount() const virtual Option_t* TObject::GetDrawOption() const static Long_t TObject::GetDtorOnly() virtual Double_t TGeoBBox::GetDX() const virtual Double_t TGeoBBox::GetDY() const virtual Double_t TGeoTube::GetDz() const virtual Double_t TGeoBBox::GetDZ() const virtual Int_t TGeoBBox::GetFittingBox(const TGeoBBox* parambox, TGeoMatrix* mat, Double_t& dx, Double_t& dy, Double_t& dz) const virtual const char* TObject::GetIconName() const Int_t TGeoShape::GetId() const virtual TGeoShape* GetMakeRuntimeShape(TGeoShape* mother, TGeoMatrix* mat) const virtual void GetMeshNumbers(Int_t& nvert, Int_t& nsegs, Int_t& npols) const virtual const char* TGeoShape::GetName() const virtual Int_t GetNmeshVertices() const virtual char* TObject::GetObjectInfo(Int_t px, Int_t py) const static Bool_t TObject::GetObjectStat() virtual Option_t* TObject::GetOption() const virtual const Double_t* TGeoBBox::GetOrigin() const char* TGeoShape::GetPointerName() const virtual Double_t TGeoTube::GetRmax() const virtual Double_t TGeoTube::GetRmin() const Double_t GetStIn() const Double_t GetStOut() const virtual const char* TNamed::GetTitle() const static TGeoMatrix* TGeoShape::GetTransform() virtual UInt_t TObject::GetUniqueID() const virtual Bool_t TObject::HandleTimer(TTimer* timer) virtual ULong_t TNamed::Hash() const Bool_t HasInner() const Bool_t TGeoTube::HasRmin() const virtual void TObject::Info(const char* method, const char* msgfmt) const virtual Bool_t TObject::InheritsFrom(const char* classname) const virtual Bool_t TObject::InheritsFrom(const TClass* cl) const virtual void TObject::Inspect() const virtual void InspectShape() const void TObject::InvertBit(UInt_t f) void TGeoShape::InvertShapeBit(UInt_t f) virtual TClass* IsA() const static Bool_t TGeoShape::IsCloseToPhi(Double_t epsil, Double_t* point, Double_t c1, Double_t s1, Double_t c2, Double_t s2) virtual Bool_t TGeoShape::IsComposite() const static Bool_t TGeoShape::IsCrossingSemiplane(Double_t* point, Double_t* dir, Double_t cphi, Double_t sphi, Double_t& snext, Double_t& rxy) virtual Bool_t IsCylType() const virtual Bool_t TObject::IsEqual(const TObject* obj) const virtual Bool_t TObject::IsFolder() const static Bool_t TGeoShape::IsInPhiRange(Double_t* point, Double_t phi1, Double_t phi2) virtual Bool_t TGeoBBox::IsNullBox() const Bool_t TObject::IsOnHeap() const virtual Bool_t TGeoShape::IsReflected() const Bool_t TGeoShape::IsRunTimeShape() const virtual Bool_t TNamed::IsSortable() const Bool_t TGeoShape::IsValid() const virtual Bool_t TGeoBBox::IsValidBox() const Bool_t TObject::IsZombie() const virtual void TNamed::ls(Option_t* option = "") const virtual TBuffer3D* MakeBuffer3D() const void TObject::MayNotUse(const char* method) const static void TGeoShape::NormalPhi(Double_t* point, Double_t* dir, Double_t* norm, Double_t c1, Double_t s1, Double_t c2, Double_t s2) virtual Bool_t TObject::Notify() static void TObject::operator delete(void* ptr) static void TObject::operator delete(void* ptr, void* vp) static void TObject::operator delete[](void* ptr) static void TObject::operator delete[](void* ptr, void* vp) void* TObject::operator new(size_t sz) void* TObject::operator new(size_t sz, void* vp) void* TObject::operator new[](size_t sz) void* TObject::operator new[](size_t sz, void* vp) TGeoHype& operator=(const TGeoHype&) virtual void TGeoShape::Paint(Option_t* option = "") virtual void TObject::Pop() virtual void TNamed::Print(Option_t* option = "") const Double_t RadiusHypeSq(Double_t z, Bool_t inner) const virtual Int_t TObject::Read(const char* name) virtual void TObject::RecursiveRemove(TObject* obj) void TObject::ResetBit(UInt_t f) void TGeoShape::ResetShapeBit(UInt_t f) virtual Double_t Safety(Double_t* point, Bool_t in = kTRUE) const static Double_t TGeoShape::SafetyPhi(Double_t* point, Bool_t in, Double_t phi1, Double_t phi2) static Double_t TGeoTube::SafetyS(Double_t* point, Bool_t in, Double_t rmin, Double_t rmax, Double_t dz, Int_t skipz = 0) Double_t SafetyToHype(Double_t* point, Bool_t inner, Bool_t in) const virtual void TObject::SaveAs(const char* filename = "", Option_t* option = "") const virtual void SavePrimitive(ostream& out, Option_t* option = "") void TObject::SetBit(UInt_t f) void TObject::SetBit(UInt_t f, Bool_t set) void TGeoBBox::SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t* origin = 0) void TGeoBBox::SetBoxPoints(Double_t* points) const virtual void SetDimensions(Double_t* param) virtual void TObject::SetDrawOption(Option_t* option = "") static void TObject::SetDtorOnly(void* obj) void SetHypeDimensions(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz) void TGeoShape::SetId(Int_t id) virtual void TNamed::SetName(const char* name) virtual void TNamed::SetNameTitle(const char* name, const char* title) static void TObject::SetObjectStat(Bool_t stat) virtual void SetPoints(Double_t* points) const virtual void SetPoints(Float_t* points) const void TGeoShape::SetRuntime(Bool_t flag = kTRUE) virtual void SetSegsAndPols(TBuffer3D& buff) const void TGeoShape::SetShapeBit(UInt_t f) void TGeoShape::SetShapeBit(UInt_t f, Bool_t set) virtual void TNamed::SetTitle(const char* title = "") static void TGeoShape::SetTransform(TGeoMatrix* matrix) void TGeoTube::SetTubeDimensions(Double_t rmin, Double_t rmax, Double_t dz) virtual void TObject::SetUniqueID(UInt_t uid) Int_t TGeoShape::ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual Int_t TNamed::Sizeof() const virtual void Sizeof3D() const virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual void TObject::SysError(const char* method, const char* msgfmt) const Bool_t TObject::TestBit(UInt_t f) const Int_t TObject::TestBits(UInt_t f) const Bool_t TGeoShape::TestShapeBit(UInt_t f) const Int_t TGeoShape::TestShapeBits(UInt_t f) const static Double_t TGeoShape::Tolerance() virtual void TObject::UseCurrentStyle() virtual void TObject::Warning(const char* method, const char* msgfmt) const virtual Int_t TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) virtual Int_t TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const Double_t ZHypeSq(Double_t r, Bool_t inner) const
protected:
 virtual void TObject::DoError(int level, const char* location, const char* fmt, va_list va) const virtual void TGeoBBox::FillBuffer3D(TBuffer3D& buffer, Int_t reqSections, Bool_t localFrame) const Int_t TGeoShape::GetBasicColor() const void TObject::MakeZombie() void TGeoShape::SetOnBoundary(Bool_t) void TGeoShape::TransformPoints(Double_t* points, UInt_t NbPoints) const

## Data Members

public:
 enum TGeoShape::EShapeType { kBitMask32 kGeoNoShape kGeoBad kGeoRSeg kGeoPhiSeg kGeoThetaSeg kGeoVisX kGeoVisY kGeoVisZ kGeoRunTimeShape kGeoInvalidShape kGeoTorus kGeoBox kGeoPara kGeoSph kGeoTube kGeoTubeSeg kGeoCone kGeoConeSeg kGeoPcon kGeoPgon kGeoArb8 kGeoEltu kGeoTrap kGeoCtub kGeoTrd1 kGeoTrd2 kGeoComb kGeoClosedShape kGeoXtru kGeoParaboloid kGeoHalfSpace kGeoHype kGeoSavePrimitive }; enum TObject::EStatusBits { kCanDelete kMustCleanup kObjInCanvas kIsReferenced kHasUUID kCannotPick kNoContextMenu kInvalidObject }; enum TObject::[unnamed] { kIsOnHeap kNotDeleted kZombie kBitMask kSingleKey kOverwrite kWriteDelete };
protected:
 Double_t TGeoBBox::fDX X half-length Double_t TGeoBBox::fDY Y half-length Double_t TGeoBBox::fDZ Z half-length Double_t TGeoTube::fDz half length TString TNamed::fName object identifier Double_t TGeoBBox::fOrigin[3] box origin Double_t TGeoTube::fRmax outer radius Double_t TGeoTube::fRmin inner radius UInt_t TGeoShape::fShapeBits shape bits Int_t TGeoShape::fShapeId shape id Double_t fStIn Stereo angle for inner surface Double_t fStOut Stereo angle for inner surface TString TNamed::fTitle object title
private:
 Double_t fTin Tangent of stereo angle for inner surface Double_t fTinsq Squared tangent of stereo angle for inner surface Double_t fTout Tangent of stereo angle for outer surface Double_t fToutsq Squared tangent of stereo angle for outer surface

## Function documentation

TGeoHype()
``` Default constructor
```
TGeoHype(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
``` Constructor specifying hyperboloid parameters.
```
TGeoHype(const char* name, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
``` Constructor specifying parameters and name.
```
TGeoHype(Double_t *param)
``` Default constructor specifying a list of parameters
param[0] = dz
param[1] = rin
param[2] = stin
param[3] = rout
param[4] = stout
```

``` destructor
```

``` Computes capacity of the shape in [length^3]
```
void ComputeBBox()
``` Compute bounding box of the hyperboloid
```
void ComputeNormal(Double_t* point, Double_t* dir, Double_t* norm)
``` Compute normal to closest surface from POINT.
```
Bool_t Contains(Double_t* point) const
``` test if point is inside this tube
```

``` compute closest distance from point px,py to each corner
```
Double_t DistFromInside(Double_t* point, Double_t* dir, Int_t iact = 1, Double_t step = TGeoShape::Big(), Double_t* safe = 0) const
``` Compute distance from inside point to surface of the hyperboloid.
```
Double_t DistFromOutside(Double_t* point, Double_t* dir, Int_t iact = 1, Double_t step = TGeoShape::Big(), Double_t* safe = 0) const
``` compute distance from outside point to surface of the hyperboloid.
```
Int_t DistToHype(Double_t* point, Double_t* dir, Double_t* s, Bool_t inner) const
``` Compute distance from an arbitrary point to inner/outer surface of hyperboloid.
Returns number of positive solutions. S[2] contains the solutions.
```
TGeoVolume * Divide(TGeoVolume* voldiv, const char* divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
``` Cannot divide hyperboloids.
```
Double_t GetAxisRange(Int_t iaxis, Double_t& xlo, Double_t& xhi) const
``` Get range of shape for a given axis.
```
void GetBoundingCylinder(Double_t* param) const
```--- Fill vector param[4] with the bounding cylinder parameters. The order
is the following : Rmin, Rmax, Phi1, Phi2, dZ
```
TGeoShape * GetMakeRuntimeShape(TGeoShape* mother, TGeoMatrix* mat) const
``` in case shape has some negative parameters, these has to be computed
in order to fit the mother
```
void InspectShape()
``` print shape parameters
```

``` Creates a TBuffer3D describing *this* shape.
Coordinates are in local reference frame.
```
void SetSegsAndPols(TBuffer3D& buff) const
``` Fill TBuffer3D structure for segments and polygons.
```
Double_t RadiusHypeSq(Double_t z, Bool_t inner) const
``` Compute r^2 = x^2 + y^2 at a given z coordinate, for either inner or outer hyperbolas.
```
Double_t ZHypeSq(Double_t r, Bool_t inner) const
``` Compute z^2 at a given  r^2, for either inner or outer hyperbolas.
```
Double_t Safety(Double_t* point, Bool_t in = kTRUE) const
``` computes the closest distance from given point to this shape, according
to option. The matching point on the shape is stored in spoint.
```
Double_t SafetyToHype(Double_t* point, Bool_t inner, Bool_t in) const
``` Compute an underestimate of the closest distance from a point to inner or
outer infinite hyperbolas.
```
void SavePrimitive(ostream& out, Option_t* option = "")
``` Save a primitive as a C++ statement(s) on output stream "out".
```
void SetHypeDimensions(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
``` Set dimensions of the hyperboloid.
```
void SetDimensions(Double_t* param)
``` Set dimensions of the hyperboloid starting from an array.
param[0] = dz
param[1] = rin
param[2] = stin
param[3] = rout
param[4] = stout
```
void SetPoints(Double_t *points)
``` create tube mesh points
```
void SetPoints(Float_t *points)
``` create tube mesh points
```
void GetMeshNumbers(Int_t& nvert, Int_t& nsegs, Int_t& npols) const
``` Returns numbers of vertices, segments and polygons composing the shape mesh.
```

``` Return number of vertices of the mesh representation
```
void Sizeof3D()
``` fill size of this 3-D object
TVirtualGeoPainter *painter = gGeoManager->GetGeomPainter();
if (!painter) return;
Int_t n = gGeoManager->GetNsegments();
Int_t numPoints = n*4;
Int_t numSegs   = n*8;
Int_t numPolys  = n*4;
```
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
``` Fills a static 3D buffer and returns a reference.
```
TGeoHype()
``` constructors
```

`{return 64;}`

`{return fStIn;}`

`{return fStOut;}`

`{return !TestShapeBit(kGeoRSeg);}`

`{return kTRUE;}`

Author: Mihaela Gheata 20/11/04
Last update: root/geom:\$Id: TGeoHype.h 21425 2007-12-17 15:59:27Z brun \$