Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoPhysicalNode.cxx
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 17/02/04
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/** \class TGeoPhysicalNode
13\ingroup Geometry_classes
14
15Physical nodes are the actual 'touchable' objects in the geometry, representing
16a path of positioned volumes starting with the top node:
17 path=/TOP/A_1/B_4/C_3 , where A, B, C represent names of volumes.
18
19The number of physical nodes is given by the total number of possible of
20branches in the geometry hierarchy. In case of detector geometries and
21specially for calorimeters this number can be of the order 1e6-1e9, therefore
22it is impossible to create all physical nodes as objects in memory. In TGeo,
23physical nodes are represented by the class TGeoPhysicalNode and can be created
24on demand for alignment purposes:
25
26~~~ {.cpp}
27 TGeoPhysicalNode *pn = new TGeoPhysicalNode("path_to_object")
28~~~
29
30Once created, a physical node can be misaligned, meaning that its position
31or even shape can be changed:
32
33~~~ {.cpp}
34 pn->Align(TGeoMatrix* newmat, TGeoShape* newshape, Bool_t check=kFALSE)
35~~~
36*/
37
38/** \class TGeoPNEntry
39\ingroup Geometry_classes
40
41The knowledge of the path to the objects that need to be misaligned is
42essential since there is no other way of identifying them. One can however
43create 'symbolic links' to any complex path to make it more representable
44for the object it designates:
45
46~~~ {.cpp}
47 TGeoPNEntry *pne = new TGeoPNEntry("TPC_SECTOR_2", "path_to_tpc_sect2");
48 pne->SetPhysicalNode(pn)
49~~~
50
51Such a symbolic link hides the complexity of the path to the align object and
52replaces it with a more meaningful name. In addition, TGeoPNEntry objects are
53faster to search by name and they may optionally store an additional user
54matrix.
55
56For more details please read the [misalignment section](\ref GP05).
57*/
58
59#include "TGeoManager.h"
60#include "TGeoVoxelFinder.h"
61#include "TGeoCache.h"
62#include "TGeoMatrix.h"
63#include "TGeoShapeAssembly.h"
64#include "TGeoCompositeShape.h"
65#include "TGeoBoolNode.h"
66#include "TGeoVolume.h"
67
68#include "TGeoPhysicalNode.h"
69
70// statics and globals
71
73
74////////////////////////////////////////////////////////////////////////////////
75/// Default constructor
76
78{
79 fLevel = 0;
80 fMatrices = nullptr;
81 fNodes = nullptr;
82 fMatrixOrig = nullptr;
87}
88
89////////////////////////////////////////////////////////////////////////////////
90/// Constructor
91
92TGeoPhysicalNode::TGeoPhysicalNode(const char *path) : TNamed(path, "")
93{
94 if (!path[0]) {
95 Error("ctor", "path not valid");
96 return;
97 }
98 fLevel = 0;
99 fMatrices = new TObjArray(30);
100 fNodes = new TObjArray(30);
101 fMatrixOrig = nullptr;
102 SetPath(path);
107}
108
109////////////////////////////////////////////////////////////////////////////////
110/// Destructor
111
113{
114 if (fMatrices) {
115 fMatrices->Delete();
116 delete fMatrices;
117 }
118 if (fNodes)
119 delete fNodes;
120 if (fMatrixOrig)
121 delete fMatrixOrig;
122}
123
124////////////////////////////////////////////////////////////////////////////////
125/// Align a physical node with a new relative matrix/shape.
126/// Example: /TOP_1/A_1/B_1/C_1
127/// node->Align(transl_1, box) will perform:
128/// - change RELATIVE translation of C_1 node (with respect to its
129/// container volume B) to transl_1
130/// - change the shape of the C volume
131/// *NOTE* The operations will affect ONLY the LAST node in the branch. All
132/// volumes/nodes in the branch represented by this physical node are
133/// CLONED so the operation does not affect other possible replicas.
134
136{
137 if (!newmat && !newshape)
138 return kFALSE;
139 if (TGeoManager::IsLocked()) {
140 Error("Align", "Not performed. Geometry in LOCKED mode !");
141 return kFALSE;
142 }
143 if (newmat == gGeoIdentity) {
144 Error("Align", "Cannot align using gGeoIdentity. Use some default matrix constructor to represent identities.");
145 return kFALSE;
146 }
147 TGeoNode *node = GetNode();
148 if (node->IsOffset()) {
149 Error("Align", "Cannot align division nodes: %s\n", node->GetName());
150 return kFALSE;
151 }
152 // Refresh the node since other Align calls may have altered the stored nodes
153 Refresh();
154 TGeoNode *nnode = nullptr;
155 TGeoVolume *vm = GetVolume(0);
156 TGeoVolume *vd = nullptr;
157 Int_t i;
158 if (!IsAligned()) {
159 Int_t *id = new Int_t[fLevel];
160 for (i = 0; i < fLevel; i++) {
161 // Store daughter indexes
162 vd = GetVolume(i);
163 node = GetNode(i + 1);
164 id[i] = vd->GetIndex(node);
165 if (id[i] < 0) {
166 Error("Align", "%s cannot align node %s", GetName(), node->GetName());
167 delete[] id;
168 return kFALSE;
169 }
170 }
171 for (i = 0; i < fLevel; i++) {
172 // Get daughter node and its id inside vm
173 node = GetNode(i + 1);
174 // Clone daughter volume and node if not done yet
175 if (node->IsCloned()) {
176 vd = node->GetVolume();
177 nnode = node;
178 } else {
179 vd = node->GetVolume()->CloneVolume();
180 if (!vd) {
181 delete[] id;
182 Fatal("Align", "Cannot clone volume %s", node->GetVolume()->GetName());
183 return kFALSE;
184 }
185 nnode = node->MakeCopyNode();
186 if (!nnode) {
187 delete[] id;
188 Fatal("Align", "Cannot make copy node for %s", node->GetName());
189 return kFALSE;
190 }
191 // Correct pointers to mother and volume
192 nnode->SetVolume(vd);
193 nnode->SetMotherVolume(vm);
194 // Decouple old node from mother volume and connect new one
197 }
198 vm->GetNodes()->RemoveAt(id[i]);
199 vm->GetNodes()->AddAt(nnode, id[i]);
200 fNodes->RemoveAt(i + 1);
201 fNodes->AddAt(nnode, i + 1);
202 // node->GetVolume()->Release();
203 }
204 // Consider new cloned volume as mother and continue
205 vm = vd;
206 }
207 delete[] id;
208 } else {
209 nnode = GetNode();
210 }
211 if (!node) {
212 Fatal("Align", "Cannot get node %s", GetName());
213 return kFALSE;
214 }
215
216 // Now nnode is a cloned node of the one that need to be aligned
217 TGeoNodeMatrix *aligned = (TGeoNodeMatrix *)nnode;
218 vm = nnode->GetMotherVolume();
219 vd = nnode->GetVolume();
220 if (newmat) {
221 // Check if the old matrix for this node was shared
222 Bool_t shared = kFALSE;
223 Int_t nd = vm->GetNdaughters();
225 if (nnode->GetMatrix()->IsShared()) {
226 // Now find the node having a composite shape using this shared matrix
227 for (i = 0; i < nd; i++) {
228 node = vm->GetNode(i);
229 if (node == nnode)
230 continue;
231 if (node->IsOffset())
232 continue;
233 if (!node->GetVolume()->GetShape()->IsComposite())
234 continue;
235 // We found a node having a composite shape, scan for the shared matrix
236 cs = (TGeoCompositeShape *)node->GetVolume()->GetShape();
237 if (cs->GetBoolNode()->GetRightMatrix() != nnode->GetMatrix())
238 continue;
239 // The composite uses the matrix -> replace it
241 ncs->GetBoolNode()->ReplaceMatrix(nnode->GetMatrix(), newmat);
242 // We have to clone the node/volume having the composite shape
243 TGeoVolume *newvol = node->GetVolume()->CloneVolume();
244 if (!newvol) {
245 Error("Align", "Cannot clone volume %s", node->GetVolume()->GetName());
246 return kFALSE;
247 }
248 newvol->SetShape(ncs);
249 TGeoNode *newnode = node->MakeCopyNode();
250 if (!newnode) {
251 Error("Align", "Cannot clone node %s", node->GetName());
252 return kFALSE;
253 }
254 newnode->SetVolume(newvol);
255 newnode->SetMotherVolume(vm);
257 gGeoManager->GetListOfGShapes()->Add(newnode);
258 }
259 vm->GetNodes()->RemoveAt(i);
260 vm->GetNodes()->AddAt(newnode, i);
261 shared = kTRUE;
262 }
263 if (!shared)
264 Error("Align", "The matrix replaced for %s is not actually shared", GetName());
265 } else {
266 // The aligned node may have a composite shape containing a shared matrix
267 if (vd->GetShape()->IsComposite()) {
268 cs = (TGeoCompositeShape *)vd->GetShape();
269 if (cs->GetBoolNode()->GetRightMatrix()->IsShared()) {
270 if (!nnode->GetMatrix()->IsIdentity()) {
271 Error("Align", "The composite shape having a shared matrix on the subtracted branch must be "
272 "positioned using identity matrix.");
273 return kFALSE;
274 }
275 // We have to put the alignment matrix on top of the left branch
276 // of the composite shape. The node is already decoupled from logical tree.
278 TGeoMatrix *oldmat = ncs->GetBoolNode()->GetLeftMatrix();
279 TGeoHMatrix *newmat1 = new TGeoHMatrix(*newmat);
280 newmat1->Multiply(oldmat);
281 ncs->GetBoolNode()->ReplaceMatrix(oldmat, newmat1);
282 vd->SetShape(ncs);
283 // The right-side matrix pointer is preserved, so no need to update nodes.
284 aligned = nullptr; // to prevent updating its matrix
285 }
286 }
287 }
288 // Register matrix and make it the active one
289 if (!newmat->IsRegistered())
290 newmat->RegisterYourself();
291 if (aligned) {
292 aligned->SetMatrix(newmat);
293 // Update the global matrix for the aligned node
294 TGeoHMatrix *global = GetMatrix();
295 TGeoHMatrix *up = GetMatrix(fLevel - 1);
296 *global = up;
297 global->Multiply(newmat);
298 }
299 }
300 // Change the shape for the aligned node
301 if (newshape)
302 vd->SetShape(newshape);
303
304 // Re-compute bounding box of mother(s) if needed
305 for (i = fLevel - 1; i > 0; i--) {
306 Bool_t dassm = vd->IsAssembly(); // is daughter assembly ?
307 vd = GetVolume(i);
308 if (!vd)
309 break;
310 Bool_t cassm = vd->IsAssembly(); // is current assembly ?
311 if (cassm)
312 ((TGeoShapeAssembly *)vd->GetShape())->NeedsBBoxRecompute();
313 if ((cassm || dassm) && vd->GetVoxels())
314 vd->GetVoxels()->SetNeedRebuild();
315 if (!cassm)
316 break;
317 }
318
319 // Now we have to re-voxelize the mother volume
320 TGeoVoxelFinder *voxels = vm->GetVoxels();
321 if (voxels)
322 voxels->SetNeedRebuild();
323 // Eventually check for overlaps
324 if (check) {
325 if (voxels) {
326 voxels->Voxelize();
327 vm->FindOverlaps();
328 }
329 // Set aligned node to be checked
330 i = fLevel;
331 node = GetNode(i);
332 if (!node)
333 return kTRUE;
334 if (node->IsOverlapping()) {
335 Info("Align",
336 "The check for overlaps for node: \n%s\n cannot be performed since the node is declared possibly "
337 "overlapping",
338 GetName());
339 } else {
341 // Check overlaps for the first non-assembly parent node
342 while ((node = GetNode(--i))) {
343 if (!node->GetVolume()->IsAssembly())
344 break;
345 }
346 if (node && node->IsOverlapping()) {
347 Info("Align",
348 "The check for overlaps for assembly node: \n%s\n cannot be performed since the parent %s is declared "
349 "possibly overlapping",
350 GetName(), node->GetName());
351 node = nullptr;
352 }
353 if (node)
354 node->CheckOverlaps(ovlp);
355 gGeoManager->SetCheckedNode(nullptr);
356 }
357 }
358 // Clean current matrices from cache
361 return kTRUE;
362}
363
364////////////////////////////////////////////////////////////////////////////////
365
367{
368 if (GetNode(0) != gGeoManager->GetTopNode())
369 return;
371}
372
373////////////////////////////////////////////////////////////////////////////////
374/// Draw this node.
375
376void TGeoPhysicalNode::Draw(Option_t * /*option*/) {}
377
378////////////////////////////////////////////////////////////////////////////////
379/// Return parent at LEVUP generation
380
382{
383 Int_t ind = fLevel - levup;
384 if (ind < 0)
385 return nullptr;
386 return (TGeoNode *)fNodes->UncheckedAt(ind);
387}
388
389////////////////////////////////////////////////////////////////////////////////
390/// Return global matrix for node at LEVEL.
391
393{
394 if (level < 0)
396 if (level > fLevel)
397 return nullptr;
398 return (TGeoHMatrix *)fMatrices->UncheckedAt(level);
399}
400
401////////////////////////////////////////////////////////////////////////////////
402/// Return node in branch at LEVEL. If not specified, return last leaf.
403
405{
406 if (level < 0)
407 return (TGeoNode *)fNodes->UncheckedAt(fLevel);
408 if (level > fLevel)
409 return nullptr;
410 return (TGeoNode *)fNodes->UncheckedAt(level);
411}
412
413////////////////////////////////////////////////////////////////////////////////
414/// Return volume associated with node at LEVEL in the branch
415
417{
418 TGeoNode *node = GetNode(level);
419 if (node)
420 return node->GetVolume();
421 return nullptr;
422}
423
424////////////////////////////////////////////////////////////////////////////////
425/// Return shape associated with volume.
426
428{
429 TGeoVolume *vol = GetVolume(level);
430 if (vol)
431 return vol->GetShape();
432 return nullptr;
433}
434
435////////////////////////////////////////////////////////////////////////////////
436/// Paint this node and its content according to visualization settings.
437
439{
441 if (!painter)
442 return;
443 // painter->PaintNode(this, option);
444}
445
446////////////////////////////////////////////////////////////////////////////////
447/// Print info about this node.
448
449void TGeoPhysicalNode::Print(Option_t * /*option*/) const
450{
451 printf("TGeoPhysicalNode: %s level=%d aligned=%d\n", fName.Data(), fLevel, IsAligned());
452 for (Int_t i = 0; i <= fLevel; i++) {
453 printf(" level %d: node %s\n", i, GetNode(i)->GetName());
454 printf(" local matrix:\n");
455 if (GetNode(i)->GetMatrix()->IsIdentity())
456 printf(" IDENTITY\n");
457 else
458 GetNode(i)->GetMatrix()->Print();
459 printf(" global matrix:\n");
460 if (GetMatrix(i)->IsIdentity())
461 printf(" IDENTITY\n");
462 else
463 GetMatrix(i)->Print();
464 }
465 if (IsAligned() && fMatrixOrig) {
466 printf(" original local matrix:\n");
468 }
469}
470
471////////////////////////////////////////////////////////////////////////////////
472/// Refresh this physical node. Called for all registered physical nodes
473/// after an Align() call.
474
476{
477 SetPath(fName.Data());
478}
479
480////////////////////////////////////////////////////////////////////////////////
481/// Set node branch according to current state
482
484{
486 if (!cache) {
487 Error("SetBranchAsState", "no state available");
488 return;
489 }
490 if (!cache->IsDummy()) {
491 Error("SetBranchAsState", "not implemented for full cache");
492 return;
493 }
494 if (!fNodes)
495 fNodes = new TObjArray(30);
496 if (!fMatrices)
497 fMatrices = new TObjArray(30);
498 TGeoHMatrix **matrices = (TGeoHMatrix **)cache->GetMatrices();
499 TGeoNode **branch = (TGeoNode **)cache->GetBranch();
500
501 Bool_t refresh = (fLevel > 0) ? kTRUE : kFALSE;
502 if (refresh) {
503 TGeoHMatrix *current;
504 for (Int_t i = 0; i <= fLevel; i++) {
505 fNodes->AddAtAndExpand(branch[i], i);
506 current = (TGeoHMatrix *)fMatrices->UncheckedAt(i);
507 *current = *matrices[i];
508 }
509 return;
510 }
512 for (Int_t i = 0; i <= fLevel; i++) {
513 fNodes->AddAtAndExpand(branch[i], i);
514 fMatrices->AddAtAndExpand(new TGeoHMatrix(*matrices[i]), i);
515 }
517 if (!fMatrixOrig)
518 fMatrixOrig = new TGeoHMatrix();
519 *fMatrixOrig = node->GetMatrix();
520}
521
522////////////////////////////////////////////////////////////////////////////////
523/// Allows PN entries (or users) to preset the local original matrix for the
524/// last node pointed by the path.
525
527{
528 if (!fMatrixOrig)
529 fMatrixOrig = new TGeoHMatrix();
530 if (!local) {
532 return;
533 }
534 *fMatrixOrig = local;
535}
536
537////////////////////////////////////////////////////////////////////////////////
538/// Specify the path for this node.
539
541{
542 if (!gGeoManager->cd(path)) {
543 Error("SetPath", "wrong path -> maybe RestoreMasterVolume");
544 return kFALSE;
545 }
547 return kTRUE;
548}
549
550////////////////////////////////////////////////////////////////////////////////
551/// Checks if a given navigator state matches this physical node
552
554{
555 TGeoNodeCache *cache = nav->GetCache();
556 if (!cache) {
557 Fatal("SetBranchAsState", "no state available");
558 return kFALSE;
559 }
560 TGeoNode **branch = (TGeoNode **)cache->GetBranch();
561 for (Int_t i = 1; i <= fLevel; i++)
562 if (fNodes->At(i) != branch[i])
563 return kFALSE;
564 return kTRUE;
565}
566
568
569////////////////////////////////////////////////////////////////////////////////
570/// Default constructor
571
573{
574 fNode = nullptr;
575 fMatrix = nullptr;
576 fGlobalOrig = nullptr;
577}
578
579////////////////////////////////////////////////////////////////////////////////
580/// Default constructor
581
582TGeoPNEntry::TGeoPNEntry(const char *name, const char *path) : TNamed(name, path)
583{
584 if (!gGeoManager || !gGeoManager->IsClosed() || !gGeoManager->CheckPath(path)) {
585 TString errmsg("Cannot define a physical node link without a closed geometry and a valid path !");
586 Error("ctor", "%s", errmsg.Data());
587 throw errmsg;
588 return;
589 }
591 gGeoManager->cd(path);
592 fGlobalOrig = new TGeoHMatrix();
595 fNode = nullptr;
596 fMatrix = nullptr;
597}
598
599////////////////////////////////////////////////////////////////////////////////
600/// Destructor
601
603{
604 if (fMatrix && !fMatrix->IsRegistered())
605 delete fMatrix;
606 delete fGlobalOrig;
607}
608
609////////////////////////////////////////////////////////////////////////////////
610/// Setter for the corresponding physical node.
611
613{
614 if (fNode && node) {
615 Warning("SetPhysicalNode", "Physical node changed for entry %s", GetName());
616 Warning("SetPhysicalNode", "=== New path: %s", node->GetName());
617 }
618 fNode = node;
619}
620
621////////////////////////////////////////////////////////////////////////////////
622/// Set the additional matrix for this node entry. The matrix will be deleted
623/// by this class unless registered by the user to gGeoManager
624
626{
627 fMatrix = mat;
628}
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
char name[80]
Definition TGX11.cxx:110
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
Definition TGeoMatrix.h:537
Bool_t ReplaceMatrix(TGeoMatrix *mat, TGeoMatrix *newmat)
Replace one of the matrices.
TGeoMatrix * GetRightMatrix() const
TGeoMatrix * GetLeftMatrix() const
virtual TGeoBoolNode * MakeClone() const =0
Composite shapes are Boolean combinations of two or more shape components.
TGeoBoolNode * GetBoolNode() const
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition TGeoMatrix.h:458
void Clear(Option_t *option="") override
clear the data for this matrix
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return
virtual Bool_t cd(const char *path="")
Browse the tree of nodes starting from fTopNode according to pathname.
Bool_t IsClosed() const
static Bool_t IsLocked()
Check lock state.
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
Bool_t CheckPath(const char *path) const
Check if a geometry path is valid without changing the state of the current navigator.
TObjArray * GetListOfGShapes() const
Int_t GetLevel() const
TGeoHMatrix * GetCurrentMatrix() const
TGeoNode * GetTopNode() const
TGeoNodeCache * GetCache() const
void SetCheckedNode(TGeoNode *node)
Assign a given node to be checked for overlaps. Any other overlaps will be ignored.
void CdTop()
Make top level node the current node.
Int_t PushPath(Int_t startlevel=0)
Bool_t PopPath()
Geometrical transformation package.
Definition TGeoMatrix.h:38
void Print(Option_t *option="") const override
print the matrix in 4x4 format
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Bool_t IsIdentity() const
Definition TGeoMatrix.h:63
Bool_t IsRegistered() const
Definition TGeoMatrix.h:72
Bool_t IsShared() const
Definition TGeoMatrix.h:68
Class providing navigation API for TGeo geometries.
TGeoNodeCache * GetCache() const
Special pool of reusable nodes.
Definition TGeoCache.h:56
void * GetMatrices() const
Definition TGeoCache.h:108
Bool_t IsDummy() const
Definition TGeoCache.h:126
void * GetBranch() const
Definition TGeoCache.h:104
A node containing local transformation.
Definition TGeoNode.h:154
void SetMatrix(const TGeoMatrix *matrix)
Matrix setter.
Definition TGeoNode.cxx:827
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
Bool_t IsOverlapping() const
Definition TGeoNode.h:107
TGeoVolume * GetVolume() const
Definition TGeoNode.h:99
void SetVolume(TGeoVolume *volume)
Definition TGeoNode.h:117
Bool_t IsOffset() const
Definition TGeoNode.h:105
virtual TGeoMatrix * GetMatrix() const =0
Bool_t IsCloned() const
Definition TGeoNode.h:103
void SetMotherVolume(TGeoVolume *mother)
Definition TGeoNode.h:125
virtual TGeoNode * MakeCopyNode() const
Definition TGeoNode.h:113
TGeoVolume * GetMotherVolume() const
Definition TGeoNode.h:90
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Check overlaps bigger than OVLP hierarchically, starting with this node.
Definition TGeoNode.cxx:192
The knowledge of the path to the objects that need to be misaligned is essential since there is no ot...
const TGeoHMatrix * fMatrix
~TGeoPNEntry() override
Destructor.
void SetPhysicalNode(TGeoPhysicalNode *node)
Setter for the corresponding physical node.
TGeoPhysicalNode * fNode
TGeoHMatrix * fGlobalOrig
TGeoPNEntry()
Default constructor.
void SetMatrix(const TGeoHMatrix *matrix)
Set the additional matrix for this node entry.
Physical nodes are the actual 'touchable' objects in the geometry, representing a path of positioned ...
void SetBranchAsState()
Set node branch according to current state.
Bool_t IsAligned() const
TGeoNode * GetMother(Int_t levup=1) const
Return parent at LEVUP generation.
TGeoNode * GetNode(Int_t level=-1) const
Return node in branch at LEVEL. If not specified, return last leaf.
void Refresh()
Refresh this physical node.
Bool_t SetPath(const char *path)
Specify the path for this node.
void SetVisibility(Bool_t flag=kTRUE)
TGeoPhysicalNode()
Default constructor.
void SetAligned(Bool_t flag=kTRUE)
void Paint(Option_t *option="") override
Paint this node and its content according to visualization settings.
void Print(Option_t *option="") const override
Print info about this node.
~TGeoPhysicalNode() override
Destructor.
void SetVisibleFull(Bool_t flag=kTRUE)
Bool_t IsMatchingState(TGeoNavigator *nav) const
Checks if a given navigator state matches this physical node.
void SetMatrixOrig(const TGeoMatrix *local)
Allows PN entries (or users) to preset the local original matrix for the last node pointed by the pat...
TGeoHMatrix * GetMatrix(Int_t level=-1) const
Return global matrix for node at LEVEL.
void Draw(Option_t *option="") override
Draw this node.
TGeoHMatrix * fMatrixOrig
Bool_t Align(TGeoMatrix *newmat=nullptr, TGeoShape *newshape=nullptr, Bool_t check=kFALSE, Double_t ovlp=0.001)
Align a physical node with a new relative matrix/shape.
TGeoVolume * GetVolume(Int_t level=-1) const
Return volume associated with node at LEVEL in the branch.
void SetIsVolAtt(Bool_t flag=kTRUE)
TGeoShape * GetShape(Int_t level=-1) const
Return shape associated with volume.
TObjArray * fMatrices
The shape encapsulating an assembly (union) of volumes.
Base abstract class for all shapes.
Definition TGeoShape.h:25
virtual Bool_t IsComposite() const
Definition TGeoShape.h:130
const char * GetName() const override
Get the shape name.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
@ kVolumeImportNodes
Definition TGeoVolume.h:76
virtual TGeoVolume * CloneVolume() const
Clone this volume.
Int_t GetNdaughters() const
Definition TGeoVolume.h:362
TObjArray * GetNodes()
Definition TGeoVolume.h:169
void FindOverlaps() const
loop all nodes marked as overlaps and find overlapping brothers
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
void SetShape(const TGeoShape *shape)
set the shape associated with this volume
TGeoShape * GetShape() const
Definition TGeoVolume.h:190
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
Finder class handling voxels.
void SetNeedRebuild(Bool_t flag=kTRUE)
virtual void Voxelize(Option_t *option="")
Voxelize attached volume according to option If the volume is an assembly, make sure the bbox is comp...
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
TString fName
Definition TNamed.h:32
An array of TObjects.
Definition TObjArray.h:31
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
void Delete(Option_t *option="") override
Remove all objects from the array AND delete all heap based objects.
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
TObject * UncheckedAt(Int_t i) const
Definition TObjArray.h:84
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
void Add(TObject *obj) override
Definition TObjArray.h:68
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:201
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:973
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:987
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition TObject.cxx:1015
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:961
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
Abstract class for geometry painters.