Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoCone.h
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 31/01/02
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_TGeoCone
13#define ROOT_TGeoCone
14
15#include "TGeoBBox.h"
16
17class TGeoCone : public TGeoBBox {
18protected:
19 // data members
20 Double_t fDz; // half length
21 Double_t fRmin1; // inner radius at -dz
22 Double_t fRmax1; // outer radius at -dz
23 Double_t fRmin2; // inner radius at +dz
24 Double_t fRmax2; // outer radius at +dz
25 // methods
26 TGeoCone(const TGeoCone &) = delete;
27 TGeoCone &operator=(const TGeoCone &) = delete;
28
29public:
30 // constructors
32 TGeoCone(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
33 TGeoCone(const char *name, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
35 // destructor
36 ~TGeoCone() override;
37 // methods
38
39 Double_t Capacity() const override;
40 static Double_t Capacity(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
41 void ComputeBBox() override;
42 void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override;
43 void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
44 static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1,
45 Double_t rmax1, Double_t rmin2, Double_t rmax2);
46 Bool_t Contains(const Double_t *point) const override;
47 void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override;
49 static void DistToCone(const Double_t *point, const Double_t *dir, Double_t dz, Double_t r1, Double_t r2,
50 Double_t &b, Double_t &delta);
51 static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1,
52 Double_t rmax1, Double_t rmin2, Double_t rmax2);
53 Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
54 Double_t *safe = nullptr) const override;
55 void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
56 Double_t *step) const override;
57 static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1,
58 Double_t rmax1, Double_t rmin2, Double_t rmax2);
59 Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
60 Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
61 void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
62 Double_t *step) const override;
64 Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
65
66 const char *GetAxisName(Int_t iaxis) const override;
67 Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
68 void GetBoundingCylinder(Double_t *param) const override;
69 Int_t GetByteCount() const override { return 56; }
70 const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
71 virtual Double_t GetDz() const { return fDz; }
72 TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override;
73 void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
74 Int_t GetNmeshVertices() const override;
75 Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override;
76 virtual Double_t GetRmin1() const { return fRmin1; }
77 virtual Double_t GetRmax1() const { return fRmax1; }
78 virtual Double_t GetRmin2() const { return fRmin2; }
79 virtual Double_t GetRmax2() const { return fRmax2; }
80
81 void InspectShape() const override;
82 Bool_t IsCylType() const override { return kTRUE; }
83 TBuffer3D *MakeBuffer3D() const override;
84 Double_t Safety(const Double_t *point, Bool_t in = kTRUE) const override;
85 void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override;
86 static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1,
87 Double_t rmin2, Double_t rmax2, Int_t skipz = 0);
88 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
89 void SetConeDimensions(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
90 void SetDimensions(Double_t *param) override;
91 void SetPoints(Double_t *points) const override;
92 void SetPoints(Float_t *points) const override;
93 void SetSegsAndPols(TBuffer3D &buffer) const override;
94 void Sizeof3D() const override;
95
96 ClassDefOverride(TGeoCone, 1) // conical tube class
97};
98
99class TGeoConeSeg : public TGeoCone {
100protected:
101 // data members
102 Double_t fPhi1; // first phi limit
103 Double_t fPhi2; // second phi limit
104 // Transient trigonometric data
105 Double_t fS1; // sin(phi1)
106 Double_t fC1; // cos(phi1)
107 Double_t fS2; // sin(phi2)
108 Double_t fC2; // cos(phi2)
109 Double_t fSm; // sin(0.5*(phi1+phi2))
110 Double_t fCm; // cos(0.5*(phi1+phi2))
111 Double_t fCdfi; // cos(0.5*(phi1-phi2))
112
114
115public:
116 // constructors
118 TGeoConeSeg(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1,
119 Double_t phi2);
120 TGeoConeSeg(const char *name, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2,
121 Double_t phi1, Double_t phi2);
123 // destructor
124 ~TGeoConeSeg() override;
125 // methods
126 void AfterStreamer() override;
127 Double_t Capacity() const override;
128 static Double_t
129 Capacity(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2);
130 void ComputeBBox() override;
131 void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override;
132 void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
133 static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1,
134 Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2,
135 Double_t s2);
136 Bool_t Contains(const Double_t *point) const override;
137 void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override;
138
140 static Double_t DistToCons(const Double_t *point, const Double_t *dir, Double_t r1, Double_t z1, Double_t r2,
141 Double_t z2, Double_t phi1, Double_t phi2);
142 static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1,
143 Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1,
144 Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi);
145 Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
146 Double_t *safe = nullptr) const override;
147 void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
148 Double_t *step) const override;
149 static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1,
150 Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1,
151 Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi);
152 Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
153 Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
154 void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
155 Double_t *step) const override;
156 TGeoVolume *
157 Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
158 Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
159 void GetBoundingCylinder(Double_t *param) const override;
160 const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
161 Int_t GetByteCount() const override { return 64; }
162 TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override;
163 void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
164 Int_t GetNmeshVertices() const override;
165 Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override;
166 Double_t GetPhi1() const { return fPhi1; }
167 Double_t GetPhi2() const { return fPhi2; }
168 void InspectShape() const override;
169 TBuffer3D *MakeBuffer3D() const override;
170 Double_t Safety(const Double_t *point, Bool_t in = kTRUE) const override;
171 void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override;
172 static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1,
173 Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2, Int_t skipz = 0);
174 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
175 void SetConsDimensions(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1,
176 Double_t phi2);
177 void SetDimensions(Double_t *param) override;
178 void SetPoints(Double_t *points) const override;
179 void SetPoints(Float_t *points) const override;
180 void SetSegsAndPols(TBuffer3D &buffer) const override;
181 void Sizeof3D() const override;
182
183 ClassDefOverride(TGeoConeSeg, 2) // conical tube segment class
184};
185
186#endif
#define b(i)
Definition RSha256.hxx:100
#define s1(x)
Definition RSha256.hxx:91
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
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
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 override
void InspectShape() const override
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
Double_t fCdfi
Definition TGeoCone.h:111
Double_t Capacity() const override
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi)
void Sizeof3D() const override
Double_t fCm
Definition TGeoCone.h:110
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2, Int_t skipz=0)
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TGeoConeSeg(const char *name, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
static Double_t Capacity(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Double_t GetPhi1() const
Definition TGeoCone.h:166
void ComputeBBox() override
Bool_t Contains(const Double_t *point) const override
Double_t fC1
Definition TGeoCone.h:106
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
void SetSegsAndPols(TBuffer3D &buffer) const override
Int_t GetByteCount() const override
Definition TGeoCone.h:161
void InitTrigonometry()
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Int_t GetNmeshVertices() const override
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Stub implementation to avoid forcing implementation at this stage.
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Double_t fPhi1
Definition TGeoCone.h:102
void SetConsDimensions(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
void SetPoints(Float_t *points) const override
Double_t fS2
Definition TGeoCone.h:107
void AfterStreamer() override
static Double_t DistToCons(const Double_t *point, const Double_t *dir, Double_t r1, Double_t z1, Double_t r2, Double_t z2, Double_t phi1, Double_t phi2)
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
~TGeoConeSeg() override
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 override
Double_t fS1
Definition TGeoCone.h:105
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi)
Double_t GetPhi2() const
Definition TGeoCone.h:167
TGeoConeSeg(Double_t *params)
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
Double_t fSm
Definition TGeoCone.h:109
Double_t fPhi2
Definition TGeoCone.h:103
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
Double_t fC2
Definition TGeoCone.h:108
TGeoConeSeg(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override
void SetPoints(Double_t *points) const override
void SetDimensions(Double_t *param) override
void GetBoundingCylinder(Double_t *param) const override
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
TBuffer3D * MakeBuffer3D() const override
TGeoCone(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
void SetDimensions(Double_t *param) override
Double_t Capacity() const override
TGeoCone(const char *name, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
const char * GetAxisName(Int_t iaxis) const override
virtual Double_t GetRmax2() const
Definition TGeoCone.h:79
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
static void DistToCone(const Double_t *point, const Double_t *dir, Double_t dz, Double_t r1, Double_t r2, Double_t &b, Double_t &delta)
static Double_t Capacity(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Int_t GetByteCount() const override
Definition TGeoCone.h:69
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override
void SetConeDimensions(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
~TGeoCone() override
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
virtual Double_t GetDz() const
Definition TGeoCone.h:71
Double_t fRmax1
Definition TGeoCone.h:22
Double_t fRmax2
Definition TGeoCone.h:24
void SetPoints(Float_t *points) const override
void SetPoints(Double_t *points) const override
Bool_t IsCylType() const override
Definition TGeoCone.h:82
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
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 override
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
void ComputeBBox() override
virtual Double_t GetRmin2() const
Definition TGeoCone.h:78
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Double_t fDz
Definition TGeoCone.h:20
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Int_t skipz=0)
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
TGeoCone & operator=(const TGeoCone &)=delete
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override
TGeoCone(const TGeoCone &)=delete
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
TGeoCone(Double_t *params)
Bool_t Contains(const Double_t *point) const override
virtual Double_t GetRmin1() const
Definition TGeoCone.h:76
void Sizeof3D() const override
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
TBuffer3D * MakeBuffer3D() const override
void InspectShape() const override
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Stub implementation to avoid forcing implementation at this stage.
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Int_t GetNmeshVertices() const override
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 override
Double_t fRmin1
Definition TGeoCone.h:21
Double_t fRmin2
Definition TGeoCone.h:23
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void GetBoundingCylinder(Double_t *param) const override
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
virtual Double_t GetRmax1() const
Definition TGeoCone.h:77
void SetSegsAndPols(TBuffer3D &buffer) const override
Geometrical transformation package.
Definition TGeoMatrix.h:38
Base abstract class for all shapes.
Definition TGeoShape.h:25
static Double_t Big()
Definition TGeoShape.h:87
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
return c1
Definition legend1.C:41
return c2
Definition legend2.C:14