ROOT  6.06/09
Reference Guide
TGeoPcon.h
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 24/10/01
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_TGeoPcon
13 #define ROOT_TGeoPcon
14 
15 #ifndef ROOT_TGeoBBox
16 #include "TGeoBBox.h"
17 #endif
18 
19 
20 //////////////////////////////////////////////////////////////////////////////
21 // //
22 // TGeoPcon - a composite polycone. It has at least 9 parameters : //
23 // - the lower phi limit; //
24 // - the range in phi; //
25 // - the number of z planes (at least two) where the inner/outer //
26 // radii are changing; //
27 // - z coordinate, inner and outer radius for each z plane //
28 // //
29 //////////////////////////////////////////////////////////////////////////////
30 
31 class TGeoPcon : public TGeoBBox
32 {
33 protected:
34  // data members
35  Int_t fNz; // number of z planes (at least two)
36  Double_t fPhi1; // lower phi limit (converted to [0,2*pi)
37  Double_t fDphi; // phi range
38  Double_t *fRmin; //[fNz] pointer to array of inner radii
39  Double_t *fRmax; //[fNz] pointer to array of outer radii
40  Double_t *fZ; //[fNz] pointer to array of Z planes positions
41  Bool_t fFullPhi; //! Full phi range flag
42  Double_t fC1; //! Cosine of phi1
43  Double_t fS1; //! Sine of phi1
44  Double_t fC2; //! Cosine of phi1+dphi
45  Double_t fS2; //! Sine of phi1+dphi
46  Double_t fCm; //! Cosine of (phi1+phi2)/2
47  Double_t fSm; //! Sine of (phi1+phi2)/2
48  Double_t fCdphi; //! Cosine of dphi
49 
50  // methods
51  TGeoPcon(const TGeoPcon&);
52  TGeoPcon& operator=(const TGeoPcon&);
53 
54 public:
55  // constructors
56  TGeoPcon();
57  TGeoPcon(Double_t phi, Double_t dphi, Int_t nz);
58  TGeoPcon(const char *name, Double_t phi, Double_t dphi, Int_t nz);
59  TGeoPcon(Double_t *params);
60  // destructor
61  virtual ~TGeoPcon();
62  // methods
63  virtual Double_t Capacity() const;
64  virtual void ComputeBBox();
65  virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm);
66  virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize);
67  virtual Bool_t Contains(const Double_t *point) const;
68  virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const;
69  virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax);
70  virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1,
71  Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
72  virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
73  virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1,
74  Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
75  virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
76  Double_t DistToSegZ(const Double_t *point, const Double_t *dir, Int_t &iz) const;
77  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
78  virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv,
79  Double_t start, Double_t step);
80  virtual const char *GetAxisName(Int_t iaxis) const;
81  virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
82  virtual void GetBoundingCylinder(Double_t *param) const;
83  virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
84  virtual Int_t GetByteCount() const {return 60+12*fNz;}
85  Double_t GetPhi1() const {return fPhi1;}
86  Double_t GetDphi() const {return fDphi;}
87  Int_t GetNz() const {return fNz;}
88  virtual Int_t GetNsegments() const;
89  Double_t *GetRmin() const {return fRmin;}
90  Double_t GetRmin(Int_t ipl) const;
91  Double_t *GetRmax() const {return fRmax;}
92  Double_t GetRmax(Int_t ipl) const;
93  Double_t *GetZ() const {return fZ;}
94  Double_t GetZ(Int_t ipl) const;
95  virtual TGeoShape *GetMakeRuntimeShape(TGeoShape * /*mother*/, TGeoMatrix * /*mat*/) const {return 0;}
96  virtual Int_t GetNmeshVertices() const;
97  virtual Bool_t GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const {return kFALSE;}
98  virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
99  virtual void InspectShape() const;
100  virtual Bool_t IsCylType() const {return kTRUE;}
101  virtual TBuffer3D *MakeBuffer3D() const;
102  Double_t &Phi1() {return fPhi1;}
103  Double_t &Dphi() {return fDphi;}
104  Double_t &Rmin(Int_t ipl) {return fRmin[ipl];}
105  Double_t &Rmax(Int_t ipl) {return fRmax[ipl];}
106  Double_t &Z(Int_t ipl) {return fZ[ipl];}
107  virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const;
108  virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const;
109  Double_t SafetyToSegment(const Double_t *point, Int_t ipl, Bool_t in=kTRUE, Double_t safmin=TGeoShape::Big()) const;
110  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
111  virtual void SetDimensions(Double_t *param);
112  virtual void SetPoints(Double_t *points) const;
113  virtual void SetPoints(Float_t *points) const;
114  virtual void SetSegsAndPols(TBuffer3D &buff) const;
115  virtual void Sizeof3D() const;
116 
117  ClassDef(TGeoPcon, 1) // polycone class
118 };
119 
120 #endif
virtual Int_t GetNsegments() const
Returns number of segments on each mesh circle segment.
Definition: TGeoPcon.cxx:650
Double_t fC2
Sine of phi1.
Definition: TGeoPcon.h:44
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this shape check total z range
Definition: TGeoPcon.cxx:414
Double_t fDphi
Definition: TGeoPcon.h:37
virtual void SetDimensions(Double_t *param)
Set polycone dimensions starting from an array.
Definition: TGeoPcon.cxx:1203
Double_t fC1
Full phi range flag.
Definition: TGeoPcon.h:42
float Float_t
Definition: RtypesCore.h:53
virtual void SetPoints(Double_t *points) const
create polycone mesh points
Definition: TGeoPcon.cxx:1241
const char Option_t
Definition: RtypesCore.h:62
Double_t fS2
Cosine of phi1+dphi.
Definition: TGeoPcon.h:45
virtual ~TGeoPcon()
destructor
Definition: TGeoPcon.cxx:249
virtual Int_t GetByteCount() const
Definition: TGeoPcon.h:84
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
Definition: TGeoPcon.cxx:352
Double_t & Rmin(Int_t ipl)
Definition: TGeoPcon.h:104
Double_t GetPhi1() const
Definition: TGeoPcon.h:85
int Int_t
Definition: RtypesCore.h:41
Double_t fS1
Cosine of phi1.
Definition: TGeoPcon.h:43
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
Double_t & Phi1()
Definition: TGeoPcon.h:102
TGeoPcon & operator=(const TGeoPcon &)
assignment operator
Definition: TGeoPcon.cxx:224
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
Definition: TGeoPcon.cxx:456
Double_t & Dphi()
Definition: TGeoPcon.h:103
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
Definition: TGeoPcon.cxx:862
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 specisied by dirs. Store output in dist...
Definition: TGeoPcon.cxx:1426
Double_t SafetyToSegment(const Double_t *point, Int_t ipl, Bool_t in=kTRUE, Double_t safmin=TGeoShape::Big()) const
Compute safety from POINT to segment between planes ipl, ipl+1 within safmin.
Definition: TGeoPcon.cxx:1062
#define ClassDef(name, id)
Definition: Rtypes.h:254
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: TGeoPcon.cxx:1400
virtual TGeoShape * GetMakeRuntimeShape(TGeoShape *, TGeoMatrix *) const
In case shape has some negative parameters, these has to be computed in order to fit the mother...
Definition: TGeoPcon.h:95
virtual void InspectShape() const
print shape parameters
Definition: TGeoPcon.cxx:846
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 specisied by dirs. Store output in dist...
Definition: TGeoPcon.cxx:1418
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPcon.cxx:1182
virtual Bool_t IsCylType() const
Definition: TGeoPcon.h:100
Double_t fCm
Sine of phi1+dphi.
Definition: TGeoPcon.h:46
char * out
Definition: TBase64.cxx:29
point * points
Definition: X3DBuffer.c:20
Double_t GetDphi() const
Definition: TGeoPcon.h:86
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: TGeoPcon.cxx:1325
Bool_t fFullPhi
Definition: TGeoPcon.h:41
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 tube
Definition: TGeoPcon.cxx:570
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: TGeoPcon.h:97
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
Definition: TGeoPcon.cxx:764
virtual const char * GetAxisName(Int_t iaxis) const
Returns name of axis IAXIS.
Definition: TGeoPcon.cxx:747
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
— Divide this polycone shape belonging to volume "voldiv" into ndiv volumes called divname...
Definition: TGeoPcon.cxx:663
Double_t fPhi1
Definition: TGeoPcon.h:36
Double_t DistToSegZ(const Double_t *point, const Double_t *dir, Int_t &iz) const
compute distance to a pcon Z slice. Segment iz must be valid
Definition: TGeoPcon.cxx:530
Int_t fNz
Definition: TGeoPcon.h:35
virtual void ComputeBBox()
compute bounding box of the pcon Check if the sections are in increasing Z order
Definition: TGeoPcon.cxx:282
Double_t * GetZ() const
Definition: TGeoPcon.h:93
Generic 3D primitive description class.
Definition: TBuffer3D.h:19
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
Definition: TGeoPcon.cxx:1338
Double_t * fZ
Definition: TGeoPcon.h:40
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: TGeoPcon.cxx:1436
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: TGeoPcon.cxx:1095
virtual void GetBoundingCylinder(Double_t *param) const
— Fill vector param[4] with the bounding cylinder parameters.
Definition: TGeoPcon.cxx:788
Double_t * GetRmin() const
Definition: TGeoPcon.h:89
double Double_t
Definition: RtypesCore.h:55
static Double_t Big()
Definition: TGeoShape.h:98
#define name(a, b)
Definition: linkTestLib0.cpp:5
Double_t & Z(Int_t ipl)
Definition: TGeoPcon.h:106
virtual void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
Definition: TGeoPcon.cxx:890
Double_t * GetRmax() const
Definition: TGeoPcon.h:91
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
Definition: TGeoPcon.cxx:1298
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Definition: TGeoPcon.cxx:259
virtual void Sizeof3D() const
Definition: TGeoPcon.cxx:1318
Double_t * fRmax
Definition: TGeoPcon.h:39
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 polycone
Definition: TGeoPcon.cxx:466
virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax)
Defines z position of a section plane, rmin and rmax at this z.
Definition: TGeoPcon.cxx:615
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: TGeoPcon.cxx:1410
Double_t & Rmax(Int_t ipl)
Definition: TGeoPcon.h:105
const Bool_t kTRUE
Definition: Rtypes.h:91
Double_t * fRmin
Definition: TGeoPcon.h:38
double norm(double *x, double *p)
Definition: unuranDistr.cxx:40
Double_t fSm
Cosine of (phi1+phi2)/2.
Definition: TGeoPcon.h:47
Double_t fCdphi
Sine of (phi1+phi2)/2.
Definition: TGeoPcon.h:48
Int_t GetNz() const
Definition: TGeoPcon.h:87