Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
17class TGeoHype : public TGeoTube
18{
19protected :
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
27private :
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 TGeoHype(const TGeoHype&) = delete;
35 TGeoHype& operator=(const TGeoHype&) = delete;
36
37public:
38 // constructors
39 TGeoHype();
40 TGeoHype(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
41 TGeoHype(const char *name, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
42 TGeoHype(Double_t *params);
43 // destructor
44 virtual ~TGeoHype();
45 // methods
46
47 virtual Double_t Capacity() const;
48 virtual void ComputeBBox();
49 virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm);
50 virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize);
51 virtual Bool_t Contains(const Double_t *point) const;
52 virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const;
53 virtual Double_t DistFromInside(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 DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
56 virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1,
57 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
58 virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
59 Int_t DistToHype(const Double_t *point, const Double_t *dir, Double_t *s, Bool_t inner, Bool_t in) const;
60 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
61 virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv,
62 Double_t start, Double_t step);
63 virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
64 virtual void GetBoundingCylinder(Double_t *param) const;
65 virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
66 virtual Int_t GetByteCount() const {return 64;}
67 virtual Bool_t GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const {return kFALSE;}
68 virtual TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
69 virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
70 virtual Int_t GetNmeshVertices() const;
71 Double_t GetStIn() const {return fStIn;}
72 Double_t GetStOut() const {return fStOut;}
74 Double_t RadiusHypeSq(Double_t z, Bool_t inner) const;
75 Double_t ZHypeSq(Double_t r, Bool_t inner) const;
76 virtual void InspectShape() const;
77 virtual Bool_t IsCylType() const {return kTRUE;}
78 virtual TBuffer3D *MakeBuffer3D() const;
79 //virtual void Paint(Option_t *option);
80 virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const;
81 virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const;
82 Double_t SafetyToHype(const Double_t *point, Bool_t inner, Bool_t in) const;
83 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
84 void SetHypeDimensions(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz);
85 virtual void SetDimensions(Double_t *param);
86 virtual void SetPoints(Double_t *points) const;
87 virtual void SetPoints(Float_t *points) const;
88 virtual void SetSegsAndPols(TBuffer3D &buff) const;
89 virtual void Sizeof3D() const;
90
91 ClassDef(TGeoHype, 1) // hyperboloid class
92
93};
94
95#endif
ROOT::R::TRInterface & r
Definition Object.C:4
int Int_t
Definition RtypesCore.h:45
const Bool_t kFALSE
Definition RtypesCore.h:101
bool Bool_t
Definition RtypesCore.h:63
double Double_t
Definition RtypesCore.h:59
float Float_t
Definition RtypesCore.h:57
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
point * points
Definition X3DBuffer.c:22
Generic 3D primitive description class.
Definition TBuffer3D.h:18
A hyperboloid is represented as a solid limited by two planes perpendicular to the Z axis (top and bo...
Definition TGeoHype.h:18
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:398
virtual void SetPoints(Double_t *points) const
create tube mesh points
Definition TGeoHype.cxx:852
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:67
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:764
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:723
TGeoHype(const TGeoHype &)=delete
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:451
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.
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
Definition TGeoHype.cxx:977
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:707
virtual Int_t GetByteCount() const
Definition TGeoHype.h:66
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:948
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Definition TGeoHype.cxx:157
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...
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
Definition TGeoHype.cxx:437
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:347
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
Definition TGeoHype.cxx:239
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:741
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
Definition TGeoHype.cxx:488
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.
virtual void SetDimensions(Double_t *param)
Set dimensions of the hyperboloid starting from an array.
Definition TGeoHype.cxx:839
TGeoHype()
Default constructor.
Definition TGeoHype.cxx:92
Double_t fStIn
Definition TGeoHype.h:24
Double_t fToutsq
Definition TGeoHype.h:32
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...
virtual void InspectShape() const
print shape parameters
Definition TGeoHype.cxx:471
virtual ~TGeoHype()
destructor
Definition TGeoHype.cxx:150
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition TGeoHype.cxx:800
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
Definition TGeoHype.cxx:960
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this tube
Definition TGeoHype.cxx:224
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:816
Double_t GetStIn() const
Definition TGeoHype.h:71
Double_t fStOut
Definition TGeoHype.h:25
virtual void ComputeBBox()
Compute bounding box of the hyperboloid.
Definition TGeoHype.cxx:167
Double_t fTinsq
Definition TGeoHype.h:31
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
Definition TGeoHype.cxx:187
virtual Bool_t IsCylType() const
Definition TGeoHype.h:77
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...
TGeoHype & operator=(const TGeoHype &)=delete
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:408
Double_t fTout
Definition TGeoHype.h:30
Double_t GetStOut() const
Definition TGeoHype.h:72
virtual void Sizeof3D() const
fill size of this 3-D object
Definition TGeoHype.cxx:970
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:248
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:288
Double_t fTin
Definition TGeoHype.h:29
virtual void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
Definition TGeoHype.cxx:510
Bool_t HasInner() const
Definition TGeoHype.h:73
Geometrical transformation package.
Definition TGeoMatrix.h:41
Base abstract class for all shapes.
Definition TGeoShape.h:26
static Double_t Big()
Definition TGeoShape.h:88
Bool_t TestShapeBit(UInt_t f) const
Definition TGeoShape.h:163
Cylindrical tube class.
Definition TGeoTube.h:18
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:49