Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoVGShape.cxx
Go to the documentation of this file.
1// Author: Mihaela Gheata 30/03/16
2/*************************************************************************
3 * Copyright (C) 1995-2016, Rene Brun and Fons Rademakers. *
4 * All rights reserved. *
5 * *
6 * For the licensing terms see $ROOTSYS/LICENSE. *
7 * For the list of contributors see $ROOTSYS/README/CREDITS. *
8 *************************************************************************/
9
10/** \class TGeoVGShape
11\ingroup Geometry_classes
12
13Bridge class for using a VecGeom solid as TGeoShape.
14*/
15
16#include "TGeoVGShape.h"
17
18#include "VecGeom/volumes/PlacedVolume.h"
19#include "VecGeom/volumes/UnplacedVolume.h"
20#include "VecGeom/volumes/UnplacedBox.h"
21#include "VecGeom/volumes/UnplacedTube.h"
22#include "VecGeom/volumes/UnplacedCone.h"
23#include "VecGeom/volumes/UnplacedParaboloid.h"
24#include "VecGeom/volumes/UnplacedParallelepiped.h"
25#include "VecGeom/volumes/UnplacedPolyhedron.h"
26#include "VecGeom/volumes/UnplacedTrd.h"
27#include "VecGeom/volumes/UnplacedOrb.h"
28#include "VecGeom/volumes/UnplacedSphere.h"
29#include "VecGeom/volumes/UnplacedBooleanVolume.h"
30#include "VecGeom/volumes/UnplacedTorus2.h"
31#include "VecGeom/volumes/UnplacedTrapezoid.h"
32#include "VecGeom/volumes/UnplacedPolycone.h"
33#include "VecGeom/volumes/UnplacedScaledShape.h"
34#include "VecGeom/volumes/UnplacedGenTrap.h"
35#include "VecGeom/volumes/UnplacedSExtruVolume.h"
36#include "VecGeom/volumes/UnplacedTessellated.h"
37#include "VecGeom/volumes/UnplacedEllipticalTube.h"
38#include "VecGeom/volumes/UnplacedHype.h"
39#include "VecGeom/volumes/UnplacedCutTube.h"
40
41#include "TError.h"
42#include "TGeoManager.h"
43#include "TGeoMaterial.h"
44#include "TGeoMedium.h"
45#include "TGeoVolume.h"
46#include "TGeoArb8.h"
47#include "TGeoTube.h"
48#include "TGeoCone.h"
49#include "TGeoPara.h"
50#include "TGeoParaboloid.h"
51#include "TGeoTrd1.h"
52#include "TGeoTrd2.h"
53#include "TGeoPcon.h"
54#include "TGeoPgon.h"
55#include "TGeoSphere.h"
56#include "TGeoBoolNode.h"
57#include "TGeoCompositeShape.h"
58#include "TGeoScaledShape.h"
59#include "TGeoTorus.h"
60#include "TGeoEltu.h"
61#include "TGeoXtru.h"
62#include "TGeoTessellated.h"
63#include "TGeoHype.h"
64
65////////////////////////////////////////////////////////////////////////////////
66/// Default constructor
67
68TGeoVGShape::TGeoVGShape(TGeoShape *shape, vecgeom::cxx::VPlacedVolume *vgshape)
69 : TGeoBBox(shape->GetName(), 0, 0, 0), fVGShape(vgshape), fShape(shape)
70{
71 // Copy box parameters from the original ROOT shape
72 const TGeoBBox *box = (const TGeoBBox *)shape;
73 TGeoBBox::SetBoxDimensions(box->GetDX(), box->GetDY(), box->GetDZ());
74 memcpy(fOrigin, box->GetOrigin(), 3 * sizeof(Double_t));
75}
76
77////////////////////////////////////////////////////////////////////////////////
78/// Destructor
79
81{
82 // Cleanup only the VecGeom solid, the ROOT shape is cleaned by TGeoManager
83 delete fVGShape;
84}
85
86////////////////////////////////////////////////////////////////////////////////
87/// Factory creating TGeoVGShape from a Root shape. Returns nullptr if the
88/// shape cannot be converted
89
91{
92 vecgeom::cxx::VPlacedVolume *vgshape = TGeoVGShape::CreateVecGeomSolid(shape);
93 if (!vgshape)
94 return nullptr;
95 return (new TGeoVGShape(shape, vgshape));
96}
97
98////////////////////////////////////////////////////////////////////////////////
99/// Conversion method to create VecGeom solid corresponding to TGeoShape
100
101vecgeom::cxx::VPlacedVolume *TGeoVGShape::CreateVecGeomSolid(TGeoShape *shape)
102{
103 // Call VecGeom TGeoShape->UnplacedSolid converter
104 // VUnplacedVolume *unplaced = RootGeoManager::Instance().Convert(shape);
105 vecgeom::cxx::VUnplacedVolume *unplaced = Convert(shape);
106 if (!unplaced)
107 return nullptr;
108 // We have to create a placed volume from the unplaced one to have access
109 // to the navigation interface
110 vecgeom::cxx::LogicalVolume *lvol = new vecgeom::cxx::LogicalVolume("", unplaced);
111 return (lvol->Place());
112}
113
114////////////////////////////////////////////////////////////////////////////////
115/// Convert a TGeoMatrix to a TRansformation3D
116
117vecgeom::cxx::Transformation3D *TGeoVGShape::Convert(TGeoMatrix const *const geomatrix)
118{
119 Double_t const *const t = geomatrix->GetTranslation();
120 Double_t const *const r = geomatrix->GetRotationMatrix();
121 vecgeom::cxx::Transformation3D *const transformation =
122 new vecgeom::cxx::Transformation3D(t[0], t[1], t[2], r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);
123 return transformation;
124}
125
126////////////////////////////////////////////////////////////////////////////////
127/// Convert a TGeo shape to VUnplacedVolume, then creates a VPlacedVolume
128
129vecgeom::cxx::VUnplacedVolume *TGeoVGShape::Convert(TGeoShape const *const shape)
130{
131 using namespace vecgeom;
132 using Vector3D = vecgeom::cxx::Vector3D<Precision>;
133 VUnplacedVolume *unplaced_volume = nullptr;
134
135 // THE BOX
136 if (shape->IsA() == TGeoBBox::Class()) {
137 TGeoBBox const *const box = static_cast<TGeoBBox const *>(shape);
138 unplaced_volume = GeoManager::MakeInstance<UnplacedBox>(box->GetDX(), box->GetDY(), box->GetDZ());
139 }
140
141 // THE TUBE
142 if (shape->IsA() == TGeoTube::Class()) {
143 TGeoTube const *const tube = static_cast<TGeoTube const *>(shape);
144 unplaced_volume =
145 GeoManager::MakeInstance<UnplacedTube>(tube->GetRmin(), tube->GetRmax(), tube->GetDz(), 0., kTwoPi);
146 }
147
148 // THE TUBESEG
149 if (shape->IsA() == TGeoTubeSeg::Class()) {
150 TGeoTubeSeg const *const tube = static_cast<TGeoTubeSeg const *>(shape);
151 unplaced_volume = GeoManager::MakeInstance<UnplacedTube>(tube->GetRmin(), tube->GetRmax(), tube->GetDz(),
152 kDegToRad * tube->GetPhi1(),
153 kDegToRad * (tube->GetPhi2() - tube->GetPhi1()));
154 }
155
156 // THE CONESEG
157 if (shape->IsA() == TGeoConeSeg::Class()) {
158 TGeoConeSeg const *const cone = static_cast<TGeoConeSeg const *>(shape);
159 unplaced_volume = GeoManager::MakeInstance<UnplacedCone>(
160 cone->GetRmin1(), cone->GetRmax1(), cone->GetRmin2(), cone->GetRmax2(), cone->GetDz(),
161 kDegToRad * cone->GetPhi1(), kDegToRad * (cone->GetPhi2() - cone->GetPhi1()));
162 }
163
164 // THE CONE
165 if (shape->IsA() == TGeoCone::Class()) {
166 TGeoCone const *const cone = static_cast<TGeoCone const *>(shape);
167 unplaced_volume = GeoManager::MakeInstance<UnplacedCone>(cone->GetRmin1(), cone->GetRmax1(), cone->GetRmin2(),
168 cone->GetRmax2(), cone->GetDz(), 0., kTwoPi);
169 }
170
171 // THE PARABOLOID
172 if (shape->IsA() == TGeoParaboloid::Class()) {
173 TGeoParaboloid const *const p = static_cast<TGeoParaboloid const *>(shape);
174 unplaced_volume = GeoManager::MakeInstance<UnplacedParaboloid>(p->GetRlo(), p->GetRhi(), p->GetDz());
175 }
176
177 // THE PARALLELEPIPED
178 if (shape->IsA() == TGeoPara::Class()) {
179 TGeoPara const *const p = static_cast<TGeoPara const *>(shape);
180 unplaced_volume = GeoManager::MakeInstance<UnplacedParallelepiped>(p->GetX(), p->GetY(), p->GetZ(), p->GetAlpha(),
181 p->GetTheta(), p->GetPhi());
182 }
183
184 // Polyhedron/TGeoPgon
185 if (shape->IsA() == TGeoPgon::Class()) {
186 TGeoPgon const *pgon = static_cast<TGeoPgon const *>(shape);
187 unplaced_volume = GeoManager::MakeInstance<UnplacedPolyhedron>(pgon->GetPhi1(), // phiStart
188 pgon->GetDphi(), // phiEnd
189 pgon->GetNedges(), // sideCount
190 pgon->GetNz(), // zPlaneCount
191 pgon->GetZ(), // zPlanes
192 pgon->GetRmin(), // rMin
193 pgon->GetRmax() // rMax
194 );
195 }
196
197 // TRD2
198 if (shape->IsA() == TGeoTrd2::Class()) {
199 TGeoTrd2 const *const p = static_cast<TGeoTrd2 const *>(shape);
200 unplaced_volume =
201 GeoManager::MakeInstance<UnplacedTrd>(p->GetDx1(), p->GetDx2(), p->GetDy1(), p->GetDy2(), p->GetDz());
202 }
203
204 // TRD1
205 if (shape->IsA() == TGeoTrd1::Class()) {
206 TGeoTrd1 const *const p = static_cast<TGeoTrd1 const *>(shape);
207 unplaced_volume = GeoManager::MakeInstance<UnplacedTrd>(p->GetDx1(), p->GetDx2(), p->GetDy(), p->GetDz());
208 }
209
210 // TRAPEZOID
211 if (shape->IsA() == TGeoTrap::Class()) {
212 TGeoTrap const *const p = static_cast<TGeoTrap const *>(shape);
213 unplaced_volume = GeoManager::MakeInstance<UnplacedTrapezoid>(
214 p->GetDz(), p->GetTheta() * kDegToRad, p->GetPhi() * kDegToRad, p->GetH1(), p->GetBl1(), p->GetTl1(),
215 std::tan(p->GetAlpha1() * kDegToRad), p->GetH2(), p->GetBl2(), p->GetTl2(),
216 std::tan(p->GetAlpha2() * kDegToRad));
217 }
218
219 // THE SPHERE | ORB
220 if (shape->IsA() == TGeoSphere::Class()) {
221 // make distinction
222 TGeoSphere const *const p = static_cast<TGeoSphere const *>(shape);
223 if (p->GetRmin() == 0. && p->GetTheta2() - p->GetTheta1() == 180. && p->GetPhi2() - p->GetPhi1() == 360.) {
224 unplaced_volume = GeoManager::MakeInstance<UnplacedOrb>(p->GetRmax());
225 } else {
226 unplaced_volume = GeoManager::MakeInstance<UnplacedSphere>(
227 p->GetRmin(), p->GetRmax(), p->GetPhi1() * kDegToRad, (p->GetPhi2() - p->GetPhi1()) * kDegToRad,
228 p->GetTheta1() * kDegToRad, (p->GetTheta2() - p->GetTheta1()) * kDegToRad);
229 }
230 }
231
232 if (shape->IsA() == TGeoCompositeShape::Class()) {
233 TGeoCompositeShape const *const compshape = static_cast<TGeoCompositeShape const *>(shape);
234 TGeoBoolNode const *const boolnode = compshape->GetBoolNode();
235
236 // need the matrix;
237 Transformation3D const *lefttrans = Convert(boolnode->GetLeftMatrix());
238 Transformation3D const *righttrans = Convert(boolnode->GetRightMatrix());
239 // unplaced shapes
240 VUnplacedVolume const *leftunplaced = Convert(boolnode->GetLeftShape());
241 VUnplacedVolume const *rightunplaced = Convert(boolnode->GetRightShape());
242 if (!leftunplaced || !rightunplaced) {
243 // If one of the components cannot be converted, cleanup & return nullptr
244 delete lefttrans;
245 delete righttrans;
246 delete leftunplaced;
247 delete rightunplaced;
248 return nullptr;
249 }
250
251 assert(leftunplaced != nullptr);
252 assert(rightunplaced != nullptr);
253
254 // the problem is that I can only place logical volumes
255 VPlacedVolume *const leftplaced = (new LogicalVolume("inner_virtual", leftunplaced))->Place(lefttrans);
256
257 VPlacedVolume *const rightplaced = (new LogicalVolume("inner_virtual", rightunplaced))->Place(righttrans);
258
259 // now it depends on concrete type
261 unplaced_volume =
262 GeoManager::MakeInstance<UnplacedBooleanVolume<kSubtraction>>(kSubtraction, leftplaced, rightplaced);
263 } else if (boolnode->GetBooleanOperator() == TGeoBoolNode::kGeoIntersection) {
264 unplaced_volume =
265 GeoManager::MakeInstance<UnplacedBooleanVolume<kIntersection>>(kIntersection, leftplaced, rightplaced);
266 } else if (boolnode->GetBooleanOperator() == TGeoBoolNode::kGeoUnion) {
267 unplaced_volume = GeoManager::MakeInstance<UnplacedBooleanVolume<kUnion>>(kUnion, leftplaced, rightplaced);
268 }
269 }
270
271 // THE TORUS
272 if (shape->IsA() == TGeoTorus::Class()) {
273 // make distinction
274 TGeoTorus const *const p = static_cast<TGeoTorus const *>(shape);
275 unplaced_volume = GeoManager::MakeInstance<UnplacedTorus2>(p->GetRmin(), p->GetRmax(), p->GetR(),
276 p->GetPhi1() * kDegToRad, p->GetDphi() * kDegToRad);
277 }
278
279 // THE POLYCONE
280 if (shape->IsA() == TGeoPcon::Class()) {
281 TGeoPcon const *const p = static_cast<TGeoPcon const *>(shape);
282 unplaced_volume = GeoManager::MakeInstance<UnplacedPolycone>(p->GetPhi1() * kDegToRad, p->GetDphi() * kDegToRad,
283 p->GetNz(), p->GetZ(), p->GetRmin(), p->GetRmax());
284 }
285
286 // THE SCALED SHAPE
287 if (shape->IsA() == TGeoScaledShape::Class()) {
288 TGeoScaledShape const *const p = static_cast<TGeoScaledShape const *>(shape);
289 // First convert the referenced shape
290 VUnplacedVolume *referenced_shape = Convert(p->GetShape());
291 if (!referenced_shape)
292 return nullptr;
293 const double *scale_root = p->GetScale()->GetScale();
294 unplaced_volume =
295 GeoManager::MakeInstance<UnplacedScaledShape>(referenced_shape, scale_root[0], scale_root[1], scale_root[2]);
296 }
297
298 // THE CUT TUBE
299 if (shape->IsA() == TGeoCtub::Class()) {
300 TGeoCtub const *const p = static_cast<TGeoCtub const *>(shape);
301 auto low = p->GetNlow();
302 auto high = p->GetNhigh();
303 auto const bottomNormal = Vector3D{low[0], low[1], low[2]};
304 auto const topNormal = Vector3D{high[0], high[1], high[2]};
305
306 unplaced_volume =
307 GeoManager::MakeInstance<UnplacedCutTube>(p->GetRmin(), p->GetRmax(), p->GetDz(), kDegToRad * p->GetPhi1(),
308 kDegToRad * (p->GetPhi2() - p->GetPhi1()), bottomNormal, topNormal);
309 }
310
311 // THE ELLIPTICAL TUBE
312 if (shape->IsA() == TGeoEltu::Class()) {
313 TGeoEltu const *const p = static_cast<TGeoEltu const *>(shape);
314 unplaced_volume = GeoManager::MakeInstance<UnplacedEllipticalTube>(p->GetA(), p->GetB(), p->GetDz());
315 }
316
317 // THE HYPERBOLOID
318 if (shape->IsA() == TGeoHype::Class()) {
319 TGeoHype const *const p = static_cast<TGeoHype const *>(shape);
320 unplaced_volume = GeoManager::MakeInstance<UnplacedHype>(p->GetRmin(), p->GetRmax(), kDegToRad * p->GetStIn(),
321 kDegToRad * p->GetStOut(), p->GetDz());
322 }
323
324 // THE ARB8
325 if (shape->IsA() == TGeoArb8::Class() || shape->IsA() == TGeoGtra::Class()) {
326 TGeoArb8 *p = (TGeoArb8 *)(shape);
327 // Create the corresponding GenTrap
328 const double *vertices = p->GetVertices();
329 Precision verticesx[8], verticesy[8];
330 for (auto ivert = 0; ivert < 8; ++ivert) {
331 verticesx[ivert] = vertices[2 * ivert];
332 verticesy[ivert] = vertices[2 * ivert + 1];
333 }
334 unplaced_volume = GeoManager::MakeInstance<UnplacedGenTrap>(verticesx, verticesy, p->GetDz());
335 }
336
337 // THE SIMPLE XTRU
338 if (shape->IsA() == TGeoXtru::Class()) {
339 TGeoXtru *p = (TGeoXtru *)(shape);
340 // analyse convertibility
341 if (p->GetNz() == 2) {
342 // add check on scaling and distortions
343 size_t Nvert = (size_t)p->GetNvert();
344 double *x = new double[Nvert];
345 double *y = new double[Nvert];
346 for (size_t i = 0; i < Nvert; ++i) {
347 x[i] = p->GetX(i);
348 y[i] = p->GetY(i);
349 }
350 // check in which orientation the polygon in given
351 if (PlanarPolygon::GetOrientation(x, y, Nvert) > 0.) {
352 // std::cerr << "Points not given in clockwise order ... reordering \n";
353 for (size_t i = 0; i < Nvert; ++i) {
354 x[Nvert - 1 - i] = p->GetX(i);
355 y[Nvert - 1 - i] = p->GetY(i);
356 }
357 }
358 unplaced_volume =
359 GeoManager::MakeInstance<UnplacedSExtruVolume>(p->GetNvert(), x, y, p->GetZ()[0], p->GetZ()[1]);
360 delete[] x;
361 delete[] y;
362 }
363 }
364
365 // THE TESSELLATED
366 if (shape->IsA() == TGeoTessellated::Class()) {
367 TGeoTessellated const *const tsl = static_cast<TGeoTessellated const *>(shape);
368 unplaced_volume = GeoManager::MakeInstance<UnplacedTessellated>();
369 auto vtsl = static_cast<UnplacedTessellated *>(unplaced_volume);
370
371 for (auto i = 0; i < tsl->GetNfacets(); ++i) {
372 auto const &facet = tsl->GetFacet(i);
373 int nvert = facet.GetNvert();
374 auto const &v0 = facet.GetVertex(0);
375 auto const &v1 = facet.GetVertex(1);
376 auto const &v2 = facet.GetVertex(2);
377 if (nvert == 3) {
378 vtsl->AddTriangularFacet(Vector3D(v0[0], v0[1], v0[2]), Vector3D(v1[0], v1[1], v1[2]),
379 Vector3D(v2[0], v2[1], v2[2]));
380 } else if (nvert == 4) {
381 auto const &v3 = facet.GetVertex(3);
382 vtsl->AddQuadrilateralFacet(Vector3D(v0[0], v0[1], v0[2]), Vector3D(v1[0], v1[1], v1[2]),
383 Vector3D(v2[0], v2[1], v2[2]), Vector3D(v3[0], v3[1], v3[2]));
384 } else {
385 return nullptr; // should never happen
386 }
387 }
388 vtsl->Close();
389 }
390
391 // New volumes should be implemented here...
392 if (!unplaced_volume) {
393 printf("Unsupported shape for ROOT shape \"%s\" of type %s. "
394 "Using ROOT implementation.\n",
395 shape->GetName(), shape->ClassName());
396 return nullptr;
397 }
398
399 return (unplaced_volume);
400}
401
402////////////////////////////////////////////////////////////////////////////////
403/// Compute bounding box.
404
406{
408}
409
410////////////////////////////////////////////////////////////////////////////////
411/// Returns analytic capacity of the solid
412
414{
415 return fVGShape->Capacity();
416}
417
418////////////////////////////////////////////////////////////////////////////////
419/// Normal computation.
420
421void TGeoVGShape::ComputeNormal(const Double_t *point, const Double_t * /*dir*/, Double_t *norm)
422{
423 vecgeom::cxx::Vector3D<Double_t> vnorm;
424 fVGShape->Normal(vecgeom::cxx::Vector3D<Double_t>(point[0], point[1], point[2]), vnorm);
425 norm[0] = vnorm.x();
426 norm[1] = vnorm.y(), norm[2] = vnorm.z();
427}
428
429////////////////////////////////////////////////////////////////////////////////
430/// Test if point is inside this shape.
431
433{
434 return (fVGShape->Contains(vecgeom::cxx::Vector3D<Double_t>(point[0], point[1], point[2])));
435}
436
437////////////////////////////////////////////////////////////////////////////////
438
439Double_t TGeoVGShape::DistFromInside(const Double_t *point, const Double_t *dir, Int_t /*iact*/, Double_t step,
440 Double_t * /*safe*/) const
441{
442 Double_t dist = fVGShape->DistanceToOut(vecgeom::cxx::Vector3D<Double_t>(point[0], point[1], point[2]),
443 vecgeom::cxx::Vector3D<Double_t>(dir[0], dir[1], dir[2]), step);
444 return ((dist < 0.) ? 0. : dist);
445}
446
447////////////////////////////////////////////////////////////////////////////////
448
449Double_t TGeoVGShape::DistFromOutside(const Double_t *point, const Double_t *dir, Int_t /*iact*/, Double_t step,
450 Double_t * /*safe*/) const
451{
452 Double_t dist = fVGShape->DistanceToIn(vecgeom::cxx::Vector3D<Double_t>(point[0], point[1], point[2]),
453 vecgeom::cxx::Vector3D<Double_t>(dir[0], dir[1], dir[2]), step);
454 return ((dist < 0.) ? 0. : dist);
455}
456
457////////////////////////////////////////////////////////////////////////////////
458
460{
461 Double_t safety = (in) ? fVGShape->SafetyToOut(vecgeom::cxx::Vector3D<Double_t>(point[0], point[1], point[2]))
462 : fVGShape->SafetyToIn(vecgeom::cxx::Vector3D<Double_t>(point[0], point[1], point[2]));
463 return ((safety < 0.) ? 0. : safety);
464}
465
466////////////////////////////////////////////////////////////////////////////////
467/// Print info about the VecGeom solid
468
470{
471 fVGShape->GetUnplacedVolume()->Print();
472 printf("\n");
473}
Py_ssize_t * fShape
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
An arbitrary trapezoid with less than 8 vertices standing on two parallel planes perpendicular to Z a...
Definition TGeoArb8.h:18
static TClass * Class()
Box class.
Definition TGeoBBox.h:18
void SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=nullptr)
Set parameters of the box.
Definition TGeoBBox.cxx:926
Double_t fOrigin[3]
Definition TGeoBBox.h:24
static TClass * Class()
Base class for Boolean operations between two shapes.
virtual EGeoBoolType GetBooleanOperator() const =0
TGeoMatrix * GetRightMatrix() const
TGeoShape * GetLeftShape() const
TGeoMatrix * GetLeftMatrix() const
TGeoShape * GetRightShape() const
Composite shapes are Boolean combinations of two or more shape components.
static TClass * Class()
TGeoBoolNode * GetBoolNode() const
A cone segment is a cone having a range in phi.
Definition TGeoCone.h:102
Double_t GetPhi1() const
Definition TGeoCone.h:163
Double_t GetPhi2() const
Definition TGeoCone.h:164
static TClass * Class()
The cones are defined by 5 parameters:
Definition TGeoCone.h:18
virtual Double_t GetRmax2() const
Definition TGeoCone.h:79
virtual Double_t GetDz() const
Definition TGeoCone.h:71
virtual Double_t GetRmin2() const
Definition TGeoCone.h:78
virtual Double_t GetRmin1() const
Definition TGeoCone.h:76
static TClass * Class()
virtual Double_t GetRmax1() const
Definition TGeoCone.h:77
The cut tubes constructor has the form:
Definition TGeoTube.h:172
static TClass * Class()
An elliptical tube is defined by the two semi-axes A and B.
Definition TGeoEltu.h:18
static TClass * Class()
int GetNvert() const
static TClass * Class()
A hyperboloid is represented as a solid limited by two planes perpendicular to the Z axis (top and bo...
Definition TGeoHype.h:18
static TClass * Class()
Geometrical transformation package.
Definition TGeoMatrix.h:41
virtual const Double_t * GetTranslation() const =0
virtual const Double_t * GetRotationMatrix() const =0
Parallelepiped class.
Definition TGeoPara.h:18
static TClass * Class()
A paraboloid is defined by the revolution surface generated by a parabola and is bounded by two plane...
static TClass * Class()
A polycone is represented by a sequence of tubes/cones, glued together at defined Z planes.
Definition TGeoPcon.h:18
Double_t * GetRmax() const
Definition TGeoPcon.h:81
Double_t GetDphi() const
Definition TGeoPcon.h:76
Double_t * GetZ() const
Definition TGeoPcon.h:83
static TClass * Class()
Int_t GetNz() const
Definition TGeoPcon.h:77
Double_t * GetRmin() const
Definition TGeoPcon.h:79
Double_t GetPhi1() const
Definition TGeoPcon.h:75
Polygons are defined in the same way as polycones, the difference being just that the segments betwee...
Definition TGeoPgon.h:21
static TClass * Class()
Int_t GetNedges() const
Definition TGeoPgon.h:86
A shape scaled by a TGeoScale transformation.
static TClass * Class()
Base abstract class for all shapes.
Definition TGeoShape.h:26
virtual TClass * IsA() const
Definition TGeoShape.h:167
virtual const char * GetName() const
Get the shape name.
virtual void ComputeBBox()=0
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
Definition TGeoSphere.h:18
static TClass * Class()
Tessellated solid class.
const TGeoFacet & GetFacet(int i) const
static TClass * Class()
int GetNfacets() const
The torus is defined by its axial radius, its inner and outer radius.
Definition TGeoTorus.h:18
static TClass * Class()
A general trapezoid.
Definition TGeoArb8.h:92
static TClass * Class()
A trapezoid with only X varying with Z.
Definition TGeoTrd1.h:18
static TClass * Class()
A trapezoid with only X varying with Z.
Definition TGeoTrd2.h:18
static TClass * Class()
A tube segment is a tube having a range in phi.
Definition TGeoTube.h:92
static TClass * Class()
Double_t GetPhi2() const
Definition TGeoTube.h:152
Double_t GetPhi1() const
Definition TGeoTube.h:151
Cylindrical tube class.
Definition TGeoTube.h:18
virtual Double_t GetRmin() const
Definition TGeoTube.h:69
static TClass * Class()
virtual Double_t GetDz() const
Definition TGeoTube.h:71
virtual Double_t GetRmax() const
Definition TGeoTube.h:70
Bridge class for using a VecGeom solid as TGeoShape.
Definition TGeoVGShape.h:31
static vecgeom::cxx::VPlacedVolume * CreateVecGeomSolid(TGeoShape *shape)
Conversion method to create VecGeom solid corresponding to TGeoShape.
static TGeoVGShape * Create(TGeoShape *shape)
Factory creating TGeoVGShape from a Root shape.
virtual void ComputeBBox()
Compute bounding box.
TGeoShape * fShape
Definition TGeoVGShape.h:34
virtual Bool_t Contains(const Double_t *point) const
Test if point is inside this shape.
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 box.
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Normal computation.
virtual ~TGeoVGShape()
Destructor.
virtual Double_t Capacity() const
Returns analytic capacity of the solid.
vecgeom::cxx::VPlacedVolume * fVGShape
Definition TGeoVGShape.h:33
virtual void InspectShape() const
Print info about the VecGeom solid.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
Computes the closest distance from given point to this shape.
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 box.
static vecgeom::cxx::Transformation3D * Convert(TGeoMatrix const *const geomatrix)
Convert a TGeoMatrix to a TRansformation3D.
A TGeoXtru shape is represented by the extrusion of an arbitrary polygon with fixed outline between s...
Definition TGeoXtru.h:23
static TClass * Class()
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:207
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.C:1
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17