Logo ROOT  
Reference Guide
TGeoHype.h
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Mihaela Gheata 20/11/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGeoHype
13 #define ROOT_TGeoHype
14 
15 #include "TGeoTube.h"
16 
17 class TGeoHype : public TGeoTube
18 {
19 protected :
20 // data members inherited from TGeoTube:
21 // Double_t fRmin; // inner radius at z=0
22 // Double_t fRmax; // outer radius at z=0
23 // Double_t fDz; // half length
24  Double_t fStIn; // Stereo angle for inner surface
25  Double_t fStOut; // Stereo angle for inner surface
26 
27 private :
28 // Precomputed parameters:
29  Double_t fTin; // Tangent of stereo angle for inner surface
30  Double_t fTout; // Tangent of stereo angle for outer surface
31  Double_t fTinsq; // Squared tangent of stereo angle for inner surface
32  Double_t fToutsq; // Squared tangent of stereo angle for outer surface
33 
34 public:
35  // constructors
37  TGeoHype(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
38  TGeoHype(const char *name, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
39  TGeoHype(Double_t *params);
40  // destructor
41  virtual ~TGeoHype();
42  // methods
43 
44  virtual Double_t Capacity() const;
45  virtual void ComputeBBox();
46  virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm);
47  virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize);
48  virtual Bool_t Contains(const Double_t *point) const;
49  virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const;
50  virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1,
51  Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
52  virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
53  virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1,
54  Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
55  virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
56  Int_t DistToHype(const Double_t *point, const Double_t *dir, Double_t *s, Bool_t inner, Bool_t in) const;
57  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
58  virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv,
59  Double_t start, Double_t step);
60  virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
61  virtual void GetBoundingCylinder(Double_t *param) const;
62  virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
63  virtual Int_t GetByteCount() const {return 64;}
64  virtual Bool_t GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const {return kFALSE;}
65  virtual TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
66  virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
67  virtual Int_t GetNmeshVertices() const;
68  Double_t GetStIn() const {return fStIn;}
69  Double_t GetStOut() const {return fStOut;}
70  Bool_t HasInner() const {return !TestShapeBit(kGeoRSeg);}
71  Double_t RadiusHypeSq(Double_t z, Bool_t inner) const;
72  Double_t ZHypeSq(Double_t r, Bool_t inner) const;
73  virtual void InspectShape() const;
74  virtual Bool_t IsCylType() const {return kTRUE;}
75  virtual TBuffer3D *MakeBuffer3D() const;
76  //virtual void Paint(Option_t *option);
77  virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const;
78  virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const;
79  Double_t SafetyToHype(const Double_t *point, Bool_t inner, Bool_t in) const;
80  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
81  void SetHypeDimensions(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
82  virtual void SetDimensions(Double_t *param);
83  virtual void SetPoints(Double_t *points) const;
84  virtual void SetPoints(Float_t *points) const;
85  virtual void SetSegsAndPols(TBuffer3D &buff) const;
86  virtual void Sizeof3D() const;
87 
88  ClassDef(TGeoHype, 1) // hyperboloid class
89 
90 };
91 
92 #endif
TGeoHype::SetPoints
virtual void SetPoints(Double_t *points) const
create tube mesh points
Definition: TGeoHype.cxx:824
TGeoHype::ComputeNormal_v
virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize)
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
Definition: TGeoHype.cxx:993
TGeoShape::kGeoRSeg
@ kGeoRSeg
Definition: TGeoShape.h:35
TGeoHype::fTout
Double_t fTout
Definition: TGeoHype.h:36
TGeoHype::GetPointsOnSegments
virtual Bool_t GetPointsOnSegments(Int_t, Double_t *) const
Fills array with n random points located on the line segments of the shape mesh.
Definition: TGeoHype.h:70
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGeoHype::GetStOut
Double_t GetStOut() const
Definition: TGeoHype.h:75
TGeoHype::Safety_v
virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
Compute safe distance from each of the points in the input array.
Definition: TGeoHype.cxx:1019
TGeoHype::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoHype.cxx:772
TGeoHype
Definition: TGeoHype.h:17
TGeoHype::IsCylType
virtual Bool_t IsCylType() const
Definition: TGeoHype.h:80
TGeoHype::GetBoundingCylinder
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
Definition: TGeoHype.cxx:408
TGeoHype::ZHypeSq
Double_t ZHypeSq(Double_t r, Bool_t inner) const
Compute z^2 at a given r^2, for either inner or outer hyperbolas.
Definition: TGeoHype.cxx:695
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TGeoHype::DistFromOutside
virtual Double_t DistFromOutside(const Double_t *point, const 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.
Definition: TGeoHype.cxx:258
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeoHype::fTin
Double_t fTin
Definition: TGeoHype.h:35
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
Int_t
int Int_t
Definition: RtypesCore.h:45
TGeoHype::Sizeof3D
virtual void Sizeof3D() const
fill size of this 3-D object
Definition: TGeoHype.cxx:942
TGeoHype::SetHypeDimensions
void SetHypeDimensions(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
Set dimensions of the hyperboloid.
Definition: TGeoHype.cxx:788
TGeoHype::ComputeBBox
virtual void ComputeBBox()
Compute bounding box of the hyperboloid.
Definition: TGeoHype.cxx:137
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGeoHype::SetDimensions
virtual void SetDimensions(Double_t *param)
Set dimensions of the hyperboloid starting from an array.
Definition: TGeoHype.cxx:811
bool
TGeoShape::TestShapeBit
Bool_t TestShapeBit(UInt_t f) const
Definition: TGeoShape.h:163
TGeoHype::Divide
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Cannot divide hyperboloids.
Definition: TGeoHype.cxx:369
TGeoHype::Contains_v
virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const
Check the inside status for each of the points in the array.
Definition: TGeoHype.cxx:983
TGeoHype::GetMakeRuntimeShape
virtual 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
Definition: TGeoHype.cxx:422
TBuffer3D
Definition: TBuffer3D.h:17
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TGeoHype::GetBuffer3D
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
Definition: TGeoHype.cxx:949
TGeoShape
Definition: TGeoShape.h:25
TGeoHype::DistancetoPrimitive
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
Definition: TGeoHype.cxx:209
TGeoHype::TGeoHype
TGeoHype()
Default constructor.
Definition: TGeoHype.cxx:62
TGeoHype::SafetyToHype
Double_t SafetyToHype(const 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.
Definition: TGeoHype.cxx:736
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGeoHype::RadiusHypeSq
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.
Definition: TGeoHype.cxx:679
TGeoTube
Definition: TGeoTube.h:17
TGeoHype::fTinsq
Double_t fTinsq
Definition: TGeoHype.h:37
TGeoHype::SetSegsAndPols
virtual void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
Definition: TGeoHype.cxx:482
TGeoHype::GetMeshNumbers
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
Definition: TGeoHype.cxx:920
TGeoHype::fToutsq
Double_t fToutsq
Definition: TGeoHype.h:38
TGeoHype::Safety
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape, according to option.
Definition: TGeoHype.cxx:713
TGeoHype::GetAxisRange
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
Definition: TGeoHype.cxx:379
TGeoHype::Contains
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this tube
Definition: TGeoHype.cxx:194
TGeoHype::fStIn
Double_t fStIn
Definition: TGeoHype.h:30
Double_t
double Double_t
Definition: RtypesCore.h:59
TGeoHype::DistFromInside
virtual Double_t DistFromInside(const Double_t *point, const 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.
Definition: TGeoHype.cxx:218
TGeoMatrix
Definition: TGeoMatrix.h:40
TGeoHype::MakeBuffer3D
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
Definition: TGeoHype.cxx:460
points
point * points
Definition: X3DBuffer.c:22
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGeoHype::GetByteCount
virtual Int_t GetByteCount() const
Definition: TGeoHype.h:69
name
char name[80]
Definition: TGX11.cxx:110
TGeoHype::~TGeoHype
virtual ~TGeoHype()
destructor
Definition: TGeoHype.cxx:120
TGeoHype::ComputeNormal
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
Definition: TGeoHype.cxx:157
TGeoHype::Capacity
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Definition: TGeoHype.cxx:127
TGeoShape::Big
static Double_t Big()
Definition: TGeoShape.h:88
TGeoTube.h
TGeoHype::fStOut
Double_t fStOut
Definition: TGeoHype.h:31
TGeoHype::GetNmeshVertices
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
Definition: TGeoHype.cxx:932
TGeoHype::DistFromOutside_v
virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
Definition: TGeoHype.cxx:1009
TGeoHype::InspectShape
virtual void InspectShape() const
print shape parameters
Definition: TGeoHype.cxx:443
TGeoHype::HasInner
Bool_t HasInner() const
Definition: TGeoHype.h:76
TGeoHype::DistToHype
Int_t DistToHype(const Double_t *point, const Double_t *dir, Double_t *s, Bool_t inner, Bool_t in) const
Compute distance from an arbitrary point to inner/outer surface of hyperboloid.
Definition: TGeoHype.cxx:318
TGeoVolume
Definition: TGeoVolume.h:44
TGeoHype::DistFromInside_v
virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
Definition: TGeoHype.cxx:1001
TGeoHype::GetStIn
Double_t GetStIn() const
Definition: TGeoHype.h:74
int