Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoShapeAssembly.cxx
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 02/06/05
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#include "TGeoManager.h"
13#include "TGeoVoxelFinder.h"
14#include "TGeoMatrix.h"
15#include "TGeoVolume.h"
16#include "TGeoNode.h"
17#include "TGeoShapeAssembly.h"
18#include "TBuffer3D.h"
19#include "TBuffer3DTypes.h"
20#include "TMath.h"
21
22/** \class TGeoShapeAssembly
23\ingroup Shapes_classes
24
25The shape encapsulating an assembly (union) of volumes.
26Automatically created by TGeoVolumeAssembly class
27*/
28
29
30////////////////////////////////////////////////////////////////////////////////
31/// Default constructor
32
38
39////////////////////////////////////////////////////////////////////////////////
40/// Constructor specifying hyperboloid parameters.
41
47
48////////////////////////////////////////////////////////////////////////////////
49/// destructor
50
52
53////////////////////////////////////////////////////////////////////////////////
54/// Compute bounding box of the assembly
55
57{
58 if (!fVolume) {
59 Fatal("ComputeBBox", "Assembly shape %s without volume", GetName());
60 return;
61 }
62 // Make sure bbox is computed only once or recomputed only if invalidated (by alignment)
63 if (fBBoxOK)
64 return;
66 if (!nd) {
67 fBBoxOK = kTRUE;
68 return;
69 }
70 TGeoNode *node;
72 Double_t xmin, xmax, ymin, ymax, zmin, zmax;
73 xmin = ymin = zmin = TGeoShape::Big();
74 xmax = ymax = zmax = -TGeoShape::Big();
75 Double_t vert[24];
76 Double_t pt[3];
77 for (Int_t i = 0; i < nd; i++) {
78 node = fVolume->GetNode(i);
79 // Make sure that all assembly daughters have computed their bboxes
80 if (node->GetVolume()->IsAssembly())
81 node->GetVolume()->GetShape()->ComputeBBox();
82 box = (TGeoBBox *)node->GetVolume()->GetShape();
83 box->SetBoxPoints(vert);
84 for (Int_t ipt = 0; ipt < 8; ipt++) {
85 node->LocalToMaster(&vert[3 * ipt], pt);
86 if (pt[0] < xmin)
87 xmin = pt[0];
88 if (pt[0] > xmax)
89 xmax = pt[0];
90 if (pt[1] < ymin)
91 ymin = pt[1];
92 if (pt[1] > ymax)
93 ymax = pt[1];
94 if (pt[2] < zmin)
95 zmin = pt[2];
96 if (pt[2] > zmax)
97 zmax = pt[2];
98 }
99 }
100 fDX = 0.5 * (xmax - xmin);
101 fOrigin[0] = 0.5 * (xmin + xmax);
102 fDY = 0.5 * (ymax - ymin);
103 fOrigin[1] = 0.5 * (ymin + ymax);
104 fDZ = 0.5 * (zmax - zmin);
105 fOrigin[2] = 0.5 * (zmin + zmax);
106 if (fDX > 0 && fDY > 0 && fDZ > 0)
107 fBBoxOK = kTRUE;
108}
109
110////////////////////////////////////////////////////////////////////////////////
111/// Recompute bounding box of the assembly after adding a node.
112
114{
116 if (!nd) {
117 Warning("RecomputeBoxLast", "No daughters for volume %s yet", fVolume->GetName());
118 return;
119 }
120 TGeoNode *node = fVolume->GetNode(nd - 1);
121 Double_t xmin, xmax, ymin, ymax, zmin, zmax;
122 if (nd == 1) {
123 xmin = ymin = zmin = TGeoShape::Big();
124 xmax = ymax = zmax = -TGeoShape::Big();
125 } else {
126 xmin = fOrigin[0] - fDX;
127 xmax = fOrigin[0] + fDX;
128 ymin = fOrigin[1] - fDY;
129 ymax = fOrigin[1] + fDY;
130 zmin = fOrigin[2] - fDZ;
131 zmax = fOrigin[2] + fDZ;
132 }
133 Double_t vert[24];
134 Double_t pt[3];
135 TGeoBBox *box = (TGeoBBox *)node->GetVolume()->GetShape();
136 if (TGeoShape::IsSameWithinTolerance(box->GetDX(), 0) || node->GetVolume()->IsAssembly())
137 node->GetVolume()->GetShape()->ComputeBBox();
138 box->SetBoxPoints(vert);
139 for (Int_t ipt = 0; ipt < 8; ipt++) {
140 node->LocalToMaster(&vert[3 * ipt], pt);
141 if (pt[0] < xmin)
142 xmin = pt[0];
143 if (pt[0] > xmax)
144 xmax = pt[0];
145 if (pt[1] < ymin)
146 ymin = pt[1];
147 if (pt[1] > ymax)
148 ymax = pt[1];
149 if (pt[2] < zmin)
150 zmin = pt[2];
151 if (pt[2] > zmax)
152 zmax = pt[2];
153 }
154 fDX = 0.5 * (xmax - xmin);
155 fOrigin[0] = 0.5 * (xmin + xmax);
156 fDY = 0.5 * (ymax - ymin);
157 fOrigin[1] = 0.5 * (ymin + ymax);
158 fDZ = 0.5 * (zmax - zmin);
159 fOrigin[2] = 0.5 * (zmin + zmax);
160 fBBoxOK = kTRUE;
161}
162
163////////////////////////////////////////////////////////////////////////////////
164/// Compute normal to closest surface from POINT. Should not be called.
165
166void TGeoShapeAssembly::ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const
167{
168 if (!fBBoxOK)
169 ((TGeoShapeAssembly *)this)->ComputeBBox();
171 if (inext < 0) {
172 DistFromOutside(point, dir, 3);
174 if (inext < 0) {
175 Error("ComputeNormal", "Invalid inext=%i (Ncomponents=%i)", inext, fVolume->GetNdaughters());
176 return;
177 }
178 }
179 TGeoNode *node = fVolume->GetNode(inext);
180 Double_t local[3], ldir[3], lnorm[3];
181 node->MasterToLocal(point, local);
182 node->MasterToLocalVect(dir, ldir);
185}
186
187////////////////////////////////////////////////////////////////////////////////
188/// Test if point is inside the assembly
189
191{
192 if (!fBBoxOK)
193 ((TGeoShapeAssembly *)this)->ComputeBBox();
194 if (!TGeoBBox::Contains(point))
195 return kFALSE;
197 TGeoNode *node;
198 TGeoShape *shape;
199 Int_t *check_list = nullptr;
200 Int_t ncheck, id;
201 Double_t local[3];
202 if (voxels) {
203 // get the list of nodes passing thorough the current voxel
205 TGeoStateInfo &td = *nav->GetCache()->GetInfo();
206 check_list = voxels->GetCheckList(point, ncheck, td);
207 if (!check_list) {
208 nav->GetCache()->ReleaseInfo();
209 return kFALSE;
210 }
211 for (id = 0; id < ncheck; id++) {
212 node = fVolume->GetNode(check_list[id]);
213 shape = node->GetVolume()->GetShape();
214 node->MasterToLocal(point, local);
215 if (shape->Contains(local)) {
218 nav->GetCache()->ReleaseInfo();
219 return kTRUE;
220 }
221 }
222 nav->GetCache()->ReleaseInfo();
223 return kFALSE;
224 }
226 for (id = 0; id < nd; id++) {
227 node = fVolume->GetNode(id);
228 shape = node->GetVolume()->GetShape();
229 node->MasterToLocal(point, local);
230 if (shape->Contains(local)) {
233 return kTRUE;
234 }
235 }
236 return kFALSE;
237}
238
239////////////////////////////////////////////////////////////////////////////////
240/// compute closest distance from point px,py to each vertex. Should not be called.
241
243{
244 return 9999;
245}
246
247////////////////////////////////////////////////////////////////////////////////
248/// Compute distance from inside point to surface of the hyperboloid.
249
250Double_t TGeoShapeAssembly::DistFromInside(const Double_t * /*point*/, const Double_t * /*dir*/, Int_t /*iact*/,
251 Double_t /*step*/, Double_t * /*safe*/) const
252{
253 Info("DistFromInside", "Cannot compute distance from inside the assembly (but from a component)");
254 return TGeoShape::Big();
255}
256
257////////////////////////////////////////////////////////////////////////////////
258/// compute distance from outside point to surface of the hyperboloid.
259/// fVolume->SetNextNodeIndex(-1);
260
262 Double_t *safe) const
263{
264#ifdef TGEO_DEBUG
265 static int indent = 0;
266 indent++;
267 TString sindent = "";
268 for (Int_t k = 0; k < indent; k++)
269 sindent += " ";
271#endif
272 if (!fBBoxOK)
273 ((TGeoShapeAssembly *)this)->ComputeBBox();
274 if (iact < 3 && safe) {
275 *safe = Safety(point, kFALSE);
276#ifdef TGEO_DEBUG
277 indent--;
278#endif
279 if (iact == 0)
280 return TGeoShape::Big();
281 if ((iact == 1) && (step <= *safe))
282 return TGeoShape::Big();
283#ifdef TGEO_DEBUG
284 indent++;
285#endif
286 }
287 // find distance to assembly
288 Double_t snext = 0.0;
289 Double_t dist;
290 Double_t stepmax = step;
291 Double_t pt[3];
292 Int_t i;
293 Bool_t found = kFALSE;
294 memcpy(pt, point, 3 * sizeof(Double_t));
295#ifdef TGEO_DEBUG
296 if (idebug > 4)
297 printf("%s[%d] assembly %s checking distance to %d daughters...\n", sindent.Data(), indent, fVolume->GetName(),
299#endif
300
301 if (!TGeoBBox::Contains(point)) {
302 snext = TGeoBBox::DistFromOutside(point, dir, 3, stepmax);
303 // Approach bounding box to minimize errors
304 snext = TMath::Min(0.01 * snext, 1.E-6);
305#ifdef TGEO_DEBUG
306 if (idebug > 4 && snext > stepmax)
307 printf("%s[%d] %s: bbox not crossed\n", sindent.Data(), indent, fVolume->GetName());
308 indent--;
309#endif
310 if (snext > stepmax)
311 return TGeoShape::Big();
312#ifdef TGEO_DEBUG
313 indent++;
314#endif
315 for (i = 0; i < 3; i++)
316 pt[i] += snext * dir[i];
317// if (Contains(pt)) {
318#ifdef TGEO_DEBUG
319// if (idebug>4) printf("%s[%d] Propagation to BBox of %s entered the component %s at %f\n", sindent.Data(),
320// indent, fVolume->GetName(), fVolume->GetNode(fVolume->GetCurrentNodeIndex())->GetName(), snext); indent--;
321#endif
322 // fVolume->SetNextNodeIndex(fVolume->GetCurrentNodeIndex());
323 // return snext;
324 // }
325 // snext += TGeoShape::Tolerance();
326 stepmax -= snext;
327 }
328 // Point represented by pt is now inside the bounding box - find distance to components
330 TGeoNode *node;
331 Double_t lpoint[3], ldir[3];
333 if (nd < 5 || !voxels) {
334 for (i = 0; i < nd; i++) {
335 node = fVolume->GetNode(i);
336 if (voxels && voxels->IsSafeVoxel(pt, i, stepmax))
337 continue;
338 node->MasterToLocal(pt, lpoint);
339 node->MasterToLocalVect(dir, ldir);
340#ifdef TGEO_DEBUG
341 if (idebug > 4)
342 printf("%s[%d] distance to %s ...\n", sindent.Data(), indent, node->GetName());
343#endif
344 dist = node->GetVolume()->GetShape()->DistFromOutside(lpoint, ldir, 3, stepmax);
345 if (dist < stepmax) {
346#ifdef TGEO_DEBUG
347 if (idebug > 4) {
348 printf("%s[%d] %s -> from local=(%19.16f, %19.16f, %19.16f, %19.16f, %19.16f, %19.16f)\n",
349 sindent.Data(), indent, fVolume->GetName(), lpoint[0], lpoint[1], lpoint[2], ldir[0], ldir[1],
350 ldir[2]);
351 printf("%s[%d] -> (l)to: %s shape %s snext=%g\n", sindent.Data(), indent, node->GetName(),
352 node->GetVolume()->GetShape()->ClassName(), dist);
353 }
354#endif
355
356 stepmax = dist;
358 found = kTRUE;
359 }
360 }
361 if (found) {
362 snext += stepmax;
363#ifdef TGEO_DEBUG
364 if (idebug > 4)
365 printf("%s[%d] %s: found %s at %f\n", sindent.Data(), indent, fVolume->GetName(),
367 indent--;
368#endif
369 return snext;
370 }
371#ifdef TGEO_DEBUG
372 if (idebug > 4)
373 printf("%s[%d] %s: no daughter crossed\n", sindent.Data(), indent, fVolume->GetName());
374 indent--;
375#endif
376 return TGeoShape::Big();
377 }
378 // current volume is voxelized, first get current voxel
379 Int_t ncheck = 0;
380 Int_t *vlist = nullptr;
382 TGeoStateInfo &td = *nav->GetCache()->GetInfo();
383
384 voxels->SortCrossedVoxels(pt, dir, td);
385 while ((vlist = voxels->GetNextVoxel(pt, dir, ncheck, td))) {
386 for (i = 0; i < ncheck; i++) {
387 node = fVolume->GetNode(vlist[i]);
388 node->MasterToLocal(pt, lpoint);
389 node->MasterToLocalVect(dir, ldir);
390#ifdef TGEO_DEBUG
391 if (idebug > 4)
392 printf("%s[%d] distance to %s ...\n", sindent.Data(), indent, node->GetName());
393#endif
394 dist = node->GetVolume()->GetShape()->DistFromOutside(lpoint, ldir, 3, stepmax);
395 if (dist < stepmax) {
396#ifdef TGEO_DEBUG
397 if (idebug > 4) {
398 printf("%s[%d] %s -> from local=(%19.16f, %19.16f, %19.16f, %19.16f, %19.16f, %19.16f)\n",
399 sindent.Data(), indent, fVolume->GetName(), lpoint[0], lpoint[1], lpoint[2], ldir[0], ldir[1],
400 ldir[2]);
401 printf("%s[%d] -> to: %s shape %s snext=%g\n", sindent.Data(), indent, node->GetName(),
402 node->GetVolume()->GetShape()->ClassName(), dist);
403 }
404#endif
405 stepmax = dist;
407 found = kTRUE;
408 }
409 }
410 }
411 nav->GetCache()->ReleaseInfo();
412 if (found) {
413 snext += stepmax;
414#ifdef TGEO_DEBUG
415 if (idebug > 4)
416 printf("%s[%d] %s: found %s at %f\n", sindent.Data(), indent, fVolume->GetName(),
418 indent--;
419#endif
420 return snext;
421 }
422#ifdef TGEO_DEBUG
423 if (idebug > 4)
424 printf("%s[%d] %s: no daughter crossed\n", sindent.Data(), indent, fVolume->GetName());
425 indent--;
426#endif
427 return TGeoShape::Big();
428}
429
430////////////////////////////////////////////////////////////////////////////////
431/// Cannot divide assemblies.
432
433TGeoVolume *TGeoShapeAssembly::Divide(TGeoVolume * /*voldiv*/, const char *divname, Int_t /*iaxis*/, Int_t /*ndiv*/,
434 Double_t /*start*/, Double_t /*step*/)
435{
436 Error("Divide", "Assemblies cannot be divided. Division volume %s not created", divname);
437 return nullptr;
438}
439
440////////////////////////////////////////////////////////////////////////////////
441/// in case shape has some negative parameters, these has to be computed
442/// in order to fit the mother
443
445{
446 Error("GetMakeRuntimeShape", "Assemblies cannot be parametrized.");
447 return nullptr;
448}
449
450////////////////////////////////////////////////////////////////////////////////
451/// print shape parameters
452
454{
455 printf("*** Shape %s: TGeoShapeAssembly ***\n", GetName());
456 printf(" Volume assembly %s with %i nodes\n", fVolume->GetName(), fVolume->GetNdaughters());
457 printf(" Bounding box:\n");
458 if (!fBBoxOK)
459 ((TGeoShapeAssembly *)this)->ComputeBBox();
461}
462
463////////////////////////////////////////////////////////////////////////////////
464/// Fill TBuffer3D structure for segments and polygons.
465
467{
468 Error("SetSegsAndPols", "Drawing functions should not be called for assemblies, but rather for their content");
469}
470
471////////////////////////////////////////////////////////////////////////////////
472/// computes the closest distance from given point to this shape, according
473/// to option. The matching point on the shape is stored in spoint.
474
476{
478 Double_t pt[3], loc[3];
479 if (!fBBoxOK)
480 ((TGeoShapeAssembly *)this)->ComputeBBox();
481 if (in) {
483 TGeoVolume *vol = fVolume;
484 TGeoNode *node;
485 memcpy(loc, point, 3 * sizeof(Double_t));
486 while (index >= 0) {
487 memcpy(pt, loc, 3 * sizeof(Double_t));
488 node = vol->GetNode(index);
489 node->GetMatrix()->MasterToLocal(pt, loc);
490 vol = node->GetVolume();
491 index = vol->GetCurrentNodeIndex();
492 if (index < 0) {
493 safety = vol->GetShape()->Safety(loc, in);
494 return safety;
495 }
496 }
497 return TGeoShape::Big();
498 }
502 Double_t *boxes = nullptr;
503 if (voxels)
504 boxes = voxels->GetBoxes();
505 TGeoNode *node;
506 for (Int_t id = 0; id < nd; id++) {
507 if (boxes && id > 0) {
508 Int_t ist = 6 * id;
509 Double_t dxyz = 0.;
510 Double_t dxyz0 = TMath::Abs(point[0] - boxes[ist + 3]) - boxes[ist];
511 if (dxyz0 > safety)
512 continue;
513 Double_t dxyz1 = TMath::Abs(point[1] - boxes[ist + 4]) - boxes[ist + 1];
514 if (dxyz1 > safety)
515 continue;
516 Double_t dxyz2 = TMath::Abs(point[2] - boxes[ist + 5]) - boxes[ist + 2];
517 if (dxyz2 > safety)
518 continue;
519 if (dxyz0 > 0)
520 dxyz += dxyz0 * dxyz0;
521 if (dxyz1 > 0)
522 dxyz += dxyz1 * dxyz1;
523 if (dxyz2 > 0)
524 dxyz += dxyz2 * dxyz2;
525 if (dxyz >= safety * safety)
526 continue;
527 }
528 node = fVolume->GetNode(id);
529 safe = node->Safety(point, kFALSE);
530 if (safe <= 0.0)
531 return 0.0;
532 if (safe < safety)
533 safety = safe;
534 }
535 return safety;
536}
537
538////////////////////////////////////////////////////////////////////////////////
539/// Save a primitive as a C++ statement(s) on output stream "out".
540
541void TGeoShapeAssembly::SavePrimitive(std::ostream & /*out*/, Option_t * /*option*/ /*= ""*/) {}
542
543////////////////////////////////////////////////////////////////////////////////
544/// No mesh for assemblies.
545
547{
548 Error("SetPoints", "Drawing functions should not be called for assemblies, but rather for their content");
549}
550
551////////////////////////////////////////////////////////////////////////////////
552/// No mesh for assemblies.
553
554void TGeoShapeAssembly::SetPoints(Float_t * /*points*/) const
555{
556 Error("SetPoints", "Drawing functions should not be called for assemblies, but rather for their content");
557}
558
559////////////////////////////////////////////////////////////////////////////////
560/// Returns numbers of vertices, segments and polygons composing the shape mesh.
561
563{
564 nvert = 0;
565 nsegs = 0;
566 npols = 0;
567}
568
569////////////////////////////////////////////////////////////////////////////////
570/// Check the inside status for each of the points in the array.
571/// Input: Array of point coordinates + vector size
572/// Output: Array of Booleans for the inside of each point
573
575{
576 for (Int_t i = 0; i < vecsize; i++)
577 inside[i] = Contains(&points[3 * i]);
578}
579
580////////////////////////////////////////////////////////////////////////////////
581/// Compute the normal for an array o points so that norm.dot.dir is positive
582/// Input: Arrays of point coordinates and directions + vector size
583/// Output: Array of normal directions
584
586{
587 for (Int_t i = 0; i < vecsize; i++)
588 ComputeNormal(&points[3 * i], &dirs[3 * i], &norms[3 * i]);
589}
590
591////////////////////////////////////////////////////////////////////////////////
592/// Compute distance from array of input points having directions specified by dirs. Store output in dists
593
595 Double_t *step) const
596{
597 for (Int_t i = 0; i < vecsize; i++)
598 dists[i] = DistFromInside(&points[3 * i], &dirs[3 * i], 3, step[i]);
599}
600
601////////////////////////////////////////////////////////////////////////////////
602/// Compute distance from array of input points having directions specified by dirs. Store output in dists
603
605 Double_t *step) const
606{
607 for (Int_t i = 0; i < vecsize; i++)
608 dists[i] = DistFromOutside(&points[3 * i], &dirs[3 * i], 3, step[i]);
609}
610
611////////////////////////////////////////////////////////////////////////////////
612/// Compute safe distance from each of the points in the input array.
613/// Input: Array of point coordinates, array of statuses for these points, size of the arrays
614/// Output: Safety values
615
617{
618 for (Int_t i = 0; i < vecsize; i++)
619 safe[i] = Safety(&points[3 * i], inside[i]);
620}
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
static void indent(ostringstream &buf, int indent_level)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
R__EXTERN TGeoManager * gGeoManager
float xmin
float ymin
float xmax
float ymax
Generic 3D primitive description class.
Definition TBuffer3D.h:18
Box class.
Definition TGeoBBox.h:17
Double_t fDX
Definition TGeoBBox.h:20
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
Compute distance from outside point to surface of the box.
Definition TGeoBBox.cxx:432
Double_t fOrigin[3]
Definition TGeoBBox.h:23
void InspectShape() const override
Prints shape parameters.
Definition TGeoBBox.cxx:810
Bool_t Contains(const Double_t *point) const override
Test if point is inside this shape.
Definition TGeoBBox.cxx:323
Double_t fDY
Definition TGeoBBox.h:21
Double_t fDZ
Definition TGeoBBox.h:22
TGeoNavigator * GetCurrentNavigator() const
Returns current navigator for the calling thread.
static Int_t GetVerboseLevel()
Set verbosity level (static function).
Geometrical transformation package.
Definition TGeoMatrix.h:38
Class providing navigation API for TGeo geometries.
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
TGeoVolume * GetVolume() const
Definition TGeoNode.h:99
virtual TGeoMatrix * GetMatrix() const =0
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
Convert a vector from local reference system to mother reference.
Definition TGeoNode.cxx:592
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
Convert the point coordinates from local reference system to mother reference.
Definition TGeoNode.cxx:584
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
Convert the point coordinates from mother reference to local reference system.
Definition TGeoNode.cxx:568
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
Convert a vector from mother reference to local reference system.
Definition TGeoNode.cxx:576
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape
Definition TGeoNode.cxx:684
The shape encapsulating an assembly (union) of volumes.
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
compute distance from outside point to surface of the hyperboloid.
~TGeoShapeAssembly() override
destructor
void SetPoints(Double_t *points) const override
No mesh for assemblies.
void InspectShape() const override
print shape parameters
TGeoShapeAssembly()
Default constructor.
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
in case shape has some negative parameters, these has to be computed in order to fit the mother
void ComputeBBox() override
Compute bounding box of the assembly.
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute closest distance from point px,py to each vertex. Should not be called.
TGeoVolumeAssembly * fVolume
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Check the inside status for each of the points in the array.
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
Compute safe distance from each of the points in the input array.
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Compute normal to closest surface from POINT. Should not be called.
void RecomputeBoxLast()
Recompute bounding box of the assembly after adding a node.
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
Compute distance from inside point to surface of the hyperboloid.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
computes the closest distance from given point to this shape, according to option.
Bool_t Contains(const Double_t *point) const override
Test if point is inside the assembly.
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Cannot divide assemblies.
void SetSegsAndPols(TBuffer3D &buff) const override
Fill TBuffer3D structure for segments and polygons.
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
Base abstract class for all shapes.
Definition TGeoShape.h:25
static Double_t Big()
Definition TGeoShape.h:94
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const =0
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const =0
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 =0
const char * GetName() const override
Get the shape name.
virtual void ComputeBBox()=0
virtual Bool_t Contains(const Double_t *point) const =0
Volume assemblies.
Definition TGeoVolume.h:316
Int_t GetNextNodeIndex() const override
void SetNextNodeIndex(Int_t index)
Int_t GetCurrentNodeIndex() const override
void SetCurrentNodeIndex(Int_t index)
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
Int_t GetNdaughters() const
Definition TGeoVolume.h:362
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
TGeoShape * GetShape() const
Definition TGeoVolume.h:190
virtual Int_t GetCurrentNodeIndex() const
Definition TGeoVolume.h:167
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
Finder class handling voxels.
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:226
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1057
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition TObject.cxx:1099
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:1045
Basic string class.
Definition TString.h:138
TPaveText * pt
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition fillpatterns.C:1
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:199
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:124
Statefull info for the current geometry level.