Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TGeoBBox.h"
16
17class TGeoPcon : public TGeoBBox
18{
19protected:
20 // data members
21 Int_t fNz = 0; // number of z planes (at least two)
22 Double_t fPhi1 = 0; // lower phi limit (converted to [0,2*pi)
23 Double_t fDphi = 0; // phi range
24 Double_t *fRmin = nullptr; //[fNz] pointer to array of inner radii
25 Double_t *fRmax = nullptr; //[fNz] pointer to array of outer radii
26 Double_t *fZ = nullptr; //[fNz] pointer to array of Z planes positions
27 Bool_t fFullPhi = false; //! Full phi range flag
28 Double_t fC1 = 0; //! Cosine of phi1
29 Double_t fS1 = 0; //! Sine of phi1
30 Double_t fC2 = 0; //! Cosine of phi1+dphi
31 Double_t fS2 = 0; //! Sine of phi1+dphi
32 Double_t fCm = 0; //! Cosine of (phi1+phi2)/2
33 Double_t fSm = 0; //! Sine of (phi1+phi2)/2
34 Double_t fCdphi = 0; //! Cosine of dphi
35
36 // methods
37 TGeoPcon(const TGeoPcon&) = delete;
38 TGeoPcon& operator=(const TGeoPcon&) = delete;
39
41 void SetSegsAndPolsNoInside(TBuffer3D &buff) const;
42
43public:
44 // constructors
45 TGeoPcon();
46 TGeoPcon(const char *name) : TGeoBBox(name, 0, 0, 0) {}
47 TGeoPcon(Double_t phi, Double_t dphi, Int_t nz);
48 TGeoPcon(const char *name, Double_t phi, Double_t dphi, Int_t nz);
49 TGeoPcon(Double_t *params);
50 // destructor
51 virtual ~TGeoPcon();
52 // methods
53 virtual Double_t Capacity() const;
54 virtual void ComputeBBox();
55 virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm);
56 virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize);
57 virtual Bool_t Contains(const Double_t *point) const;
58 virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const;
59 virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax);
60 virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1,
61 Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const;
62 virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
63 virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1,
64 Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const;
65 virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
66 Double_t DistToSegZ(const Double_t *point, const Double_t *dir, Int_t &iz) const;
67 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
68 virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv,
69 Double_t start, Double_t step);
70 virtual const char *GetAxisName(Int_t iaxis) const;
71 virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
72 virtual void GetBoundingCylinder(Double_t *param) const;
73 virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
74 virtual Int_t GetByteCount() const {return 60+12*fNz;}
75 Double_t GetPhi1() const {return fPhi1;}
76 Double_t GetDphi() const {return fDphi;}
77 Int_t GetNz() const {return fNz;}
78 virtual Int_t GetNsegments() const;
79 Double_t *GetRmin() const {return fRmin;}
80 Double_t GetRmin(Int_t ipl) const;
81 Double_t *GetRmax() const {return fRmax;}
82 Double_t GetRmax(Int_t ipl) const;
83 Double_t *GetZ() const {return fZ;}
84 Double_t GetZ(Int_t ipl) const;
85 virtual TGeoShape *GetMakeRuntimeShape(TGeoShape * /*mother*/, TGeoMatrix * /*mat*/) const {return nullptr;}
86 virtual Int_t GetNmeshVertices() const;
87 virtual Bool_t GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const {return kFALSE;}
88 virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
89 virtual void InspectShape() const;
90 virtual Bool_t IsCylType() const {return kTRUE;}
91 virtual TBuffer3D *MakeBuffer3D() const;
92 Double_t &Phi1() {return fPhi1;}
93 Double_t &Dphi() {return fDphi;}
94 Double_t &Rmin(Int_t ipl) {return fRmin[ipl];}
95 Double_t &Rmax(Int_t ipl) {return fRmax[ipl];}
96 Double_t &Z(Int_t ipl) {return fZ[ipl];}
97 virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const;
98 virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const;
99 Double_t SafetyToSegment(const Double_t *point, Int_t ipl, Bool_t in=kTRUE, Double_t safmin=TGeoShape::Big()) const;
100 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
101 virtual void SetDimensions(Double_t *param);
102 virtual void SetPoints(Double_t *points) const;
103 virtual void SetPoints(Float_t *points) const;
104 virtual void SetSegsAndPols(TBuffer3D &buff) const;
105 virtual void Sizeof3D() const;
106
107 ClassDef(TGeoPcon, 1) // polycone class
108};
109
110#endif
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:337
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
char name[80]
Definition TGX11.cxx:110
Generic 3D primitive description class.
Definition TBuffer3D.h:18
Box class.
Definition TGeoBBox.h:18
Geometrical transformation package.
Definition TGeoMatrix.h:41
A polycone is represented by a sequence of tubes/cones, glued together at defined Z planes.
Definition TGeoPcon.h:18
Double_t fSm
Cosine of (phi1+phi2)/2.
Definition TGeoPcon.h:33
virtual const char * GetAxisName(Int_t iaxis) const
Returns name of axis IAXIS.
Definition TGeoPcon.cxx:747
Double_t * GetRmax() const
Definition TGeoPcon.h:81
virtual void SetDimensions(Double_t *param)
Set polycone dimensions starting from an array.
Double_t & Rmin(Int_t ipl)
Definition TGeoPcon.h:94
Double_t GetDphi() const
Definition TGeoPcon.h:76
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const
compute distance from outside point to surface of the tube
Definition TGeoPcon.cxx:568
Double_t & Rmax(Int_t ipl)
Definition TGeoPcon.h:95
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.
Double_t * fRmax
Definition TGeoPcon.h:25
virtual void Sizeof3D() const
fill size of this 3-D object
virtual void SetPoints(Double_t *points) const
create polycone mesh points
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:87
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const
compute distance from inside point to surface of the polycone
Definition TGeoPcon.cxx:458
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 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:85
virtual void ComputeBBox()
compute bounding box of the pcon Check if the sections are in increasing Z order
Definition TGeoPcon.cxx:274
Double_t * fRmin
Definition TGeoPcon.h:24
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
Definition TGeoPcon.cxx:344
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
Definition TGeoPcon.cxx:448
Int_t fNz
Definition TGeoPcon.h:21
Double_t * fZ
Definition TGeoPcon.h:26
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
Double_t fC1
Full phi range flag.
Definition TGeoPcon.h:28
Double_t fCdphi
Sine of (phi1+phi2)/2.
Definition TGeoPcon.h:34
Bool_t fFullPhi
Definition TGeoPcon.h:27
Double_t fS1
Cosine of phi1.
Definition TGeoPcon.h:29
virtual void InspectShape() const
print shape parameters
Definition TGeoPcon.cxx:846
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
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 void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
Definition TGeoPcon.cxx:882
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this shape check total z range
Definition TGeoPcon.cxx:406
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
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:528
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Definition TGeoPcon.cxx:251
Double_t fCm
Sine of phi1+dphi.
Definition TGeoPcon.h:32
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
TGeoPcon & operator=(const TGeoPcon &)=delete
TGeoPcon(const TGeoPcon &)=delete
Cosine of dphi.
virtual Bool_t IsCylType() const
Definition TGeoPcon.h:90
Double_t & Z(Int_t ipl)
Definition TGeoPcon.h:96
Double_t * GetZ() const
Definition TGeoPcon.h:83
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 TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
Definition TGeoPcon.cxx:862
TGeoPcon(const char *name)
Definition TGeoPcon.h:46
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...
Bool_t HasInsideSurface() const
Returns true when pgon has internal surface It will be only disabled when all Rmin values are 0.
virtual Int_t GetNsegments() const
Returns number of segments on each mesh circle segment.
Definition TGeoPcon.cxx:650
Double_t fPhi1
Definition TGeoPcon.h:22
Double_t & Phi1()
Definition TGeoPcon.h:92
Double_t & Dphi()
Definition TGeoPcon.h:93
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
Double_t fS2
Cosine of phi1+dphi.
Definition TGeoPcon.h:31
virtual ~TGeoPcon()
destructor
Definition TGeoPcon.cxx:241
void SetSegsAndPolsNoInside(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons, when no inner surface exists.
Double_t fDphi
Definition TGeoPcon.h:23
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...
Double_t fC2
Sine of phi1.
Definition TGeoPcon.h:30
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Int_t GetNz() const
Definition TGeoPcon.h:77
virtual Int_t GetByteCount() const
Definition TGeoPcon.h:74
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
Definition TGeoPcon.cxx:788
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.
Double_t * GetRmin() const
Definition TGeoPcon.h:79
TGeoPcon()
dummy ctor
Definition TGeoPcon.cxx:104
Double_t GetPhi1() const
Definition TGeoPcon.h:75
Base abstract class for all shapes.
Definition TGeoShape.h:26
static Double_t Big()
Definition TGeoShape.h:88
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:49