Logo ROOT   6.16/01
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
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
34public:
35 // constructors
36 TGeoHype();
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;}
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
ROOT::R::TRInterface & r
Definition: Object.C:4
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
point * points
Definition: X3DBuffer.c:22
Generic 3D primitive description class.
Definition: TBuffer3D.h:18
Hyperboloid class defined by 5 parameters.
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:370
virtual void SetPoints(Double_t *points) const
create tube mesh points
Definition: TGeoHype.cxx:825
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:64
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:737
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:696
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:423
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:1020
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
Definition: TGeoHype.cxx:950
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:680
virtual Int_t GetByteCount() const
Definition: TGeoHype.h:63
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:921
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Definition: TGeoHype.cxx:128
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:1002
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
Definition: TGeoHype.cxx:409
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:319
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
Definition: TGeoHype.cxx:210
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:714
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
Definition: TGeoHype.cxx:461
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:984
virtual void SetDimensions(Double_t *param)
Set dimensions of the hyperboloid starting from an array.
Definition: TGeoHype.cxx:812
TGeoHype()
Default constructor.
Definition: TGeoHype.cxx:63
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...
Definition: TGeoHype.cxx:994
virtual void InspectShape() const
print shape parameters
Definition: TGeoHype.cxx:444
virtual ~TGeoHype()
destructor
Definition: TGeoHype.cxx:121
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoHype.cxx:773
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
Definition: TGeoHype.cxx:933
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this tube
Definition: TGeoHype.cxx:195
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:789
Double_t GetStIn() const
Definition: TGeoHype.h:68
Double_t fStOut
Definition: TGeoHype.h:25
virtual void ComputeBBox()
Compute bounding box of the hyperboloid.
Definition: TGeoHype.cxx:138
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:158
virtual Bool_t IsCylType() const
Definition: TGeoHype.h:74
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:1010
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:380
Double_t fTout
Definition: TGeoHype.h:30
Double_t GetStOut() const
Definition: TGeoHype.h:69
virtual void Sizeof3D() const
fill size of this 3-D object
Definition: TGeoHype.cxx:943
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:219
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:259
Double_t fTin
Definition: TGeoHype.h:29
virtual void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
Definition: TGeoHype.cxx:483
Bool_t HasInner() const
Definition: TGeoHype.h:70
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
@ kGeoRSeg
Definition: TGeoShape.h:35
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:53
static constexpr double s