Logo ROOT  
Reference Guide
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 in the Users Guide.
57*/
58
59#include "TClass.h"
60#include "TGeoManager.h"
61#include "TGeoVoxelFinder.h"
62#include "TGeoCache.h"
63#include "TGeoMatrix.h"
64#include "TGeoShapeAssembly.h"
65#include "TGeoCompositeShape.h"
66#include "TGeoBoolNode.h"
67#include "TGeoVolume.h"
68
69#include "TGeoPhysicalNode.h"
70
71// statics and globals
72
74
75////////////////////////////////////////////////////////////////////////////////
76/// Default constructor
77
79{
80 fLevel = 0;
81 fMatrices = 0;
82 fNodes = 0;
83 fMatrixOrig = 0;
88}
89
90////////////////////////////////////////////////////////////////////////////////
91/// Constructor
92
93TGeoPhysicalNode::TGeoPhysicalNode(const char *path) : TNamed(path,"")
94{
95 if (!path[0]) {
96 Error("ctor", "path not valid");
97 return;
98 }
99 fLevel = 0;
100 fMatrices = new TObjArray(30);
101 fNodes = new TObjArray(30);
102 fMatrixOrig = 0;
103 SetPath(path);
108}
109
110////////////////////////////////////////////////////////////////////////////////
111/// Destructor
112
114{
115 if (fMatrices) {
116 fMatrices->Delete();
117 delete fMatrices;
118 }
119 if (fNodes) delete fNodes;
120 if (fMatrixOrig) delete fMatrixOrig;
121}
122
123////////////////////////////////////////////////////////////////////////////////
124/// Align a physical node with a new relative matrix/shape.
125/// Example: /TOP_1/A_1/B_1/C_1
126/// node->Align(transl_1, box) will perform:
127/// - change RELATIVE translation of C_1 node (with respect to its
128/// container volume B) to transl_1
129/// - change the shape of the C volume
130/// *NOTE* The operations will affect ONLY the LAST node in the branch. All
131/// volumes/nodes in the branch represented by this physical node are
132/// CLONED so the operation does not affect other possible replicas.
133
135{
136 if (!newmat && !newshape) return kFALSE;
137 if (TGeoManager::IsLocked()) {
138 Error("Align", "Not performed. Geometry in LOCKED mode !");
139 return kFALSE;
140 }
141 if (newmat == gGeoIdentity) {
142 Error("Align", "Cannot align using gGeoIdentity. Use some default matrix constructor to represent identities.");
143 return kFALSE;
144 }
145 TGeoNode *node = GetNode();
146 if (node->IsOffset()) {
147 Error("Align", "Cannot align division nodes: %s\n",node->GetName());
148 return kFALSE;
149 }
150 // Refresh the node since other Align calls may have altered the stored nodes
151 Refresh();
152 TGeoNode *nnode = 0;
153 TGeoVolume *vm = GetVolume(0);
154 TGeoVolume *vd = 0;
155 Int_t i;
156 if (!IsAligned()) {
157 Int_t *id = new Int_t[fLevel];
158 for (i=0; i<fLevel; i++) {
159 // Store daughter indexes
160 vd = GetVolume(i);
161 node = GetNode(i+1);
162 id[i] = vd->GetIndex(node);
163 if (id[i]<0) {
164 Error("Align","%s cannot align node %s",GetName(), node->GetName());
165 delete [] id;
166 return kFALSE;
167 }
168 }
169 for (i=0; i<fLevel; i++) {
170 // Get daughter node and its id inside vm
171 node = GetNode(i+1);
172 // Clone daughter volume and node if not done yet
173 if (node->IsCloned()) {
174 vd = node->GetVolume();
175 nnode = node;
176 } else {
177 vd = node->GetVolume()->CloneVolume();
178 if (!vd) {
179 delete [] id;
180 Fatal("Align", "Cannot clone volume %s", node->GetVolume()->GetName());
181 return kFALSE;
182 }
183 nnode = node->MakeCopyNode();
184 if (!nnode) {
185 delete [] id;
186 Fatal("Align", "Cannot make copy node for %s", node->GetName());
187 return kFALSE;
188 }
189 // Correct pointers to mother and volume
190 nnode->SetVolume(vd);
191 nnode->SetMotherVolume(vm);
192 // Decouple old node from mother volume and connect new one
195 }
196 vm->GetNodes()->RemoveAt(id[i]);
197 vm->GetNodes()->AddAt(nnode,id[i]);
198 fNodes->RemoveAt(i+1);
199 fNodes->AddAt(nnode,i+1);
200 // node->GetVolume()->Release();
201 }
202 // Consider new cloned volume as mother and continue
203 vm = vd;
204 }
205 delete [] id;
206 } else {
207 nnode = GetNode();
208 }
209 // Now nnode is a cloned node of the one that need to be aligned
210 TGeoNodeMatrix *aligned = (TGeoNodeMatrix*)nnode;
211 vm = nnode->GetMotherVolume();
212 vd = nnode->GetVolume();
213 if (newmat) {
214 // Check if the old matrix for this node was shared
215 Bool_t shared = kFALSE;
216 Int_t nd = vm->GetNdaughters();
218 if (nnode->GetMatrix()->IsShared()) {
219 // Now find the node having a composite shape using this shared matrix
220 for (i=0; i<nd; i++) {
221 node = vm->GetNode(i);
222 if (node==nnode) continue;
223 if (node->IsOffset()) continue;
224 if (!node->GetVolume()->GetShape()->IsComposite()) continue;
225 // We found a node having a composite shape, scan for the shared matrix
226 cs = (TGeoCompositeShape*)node->GetVolume()->GetShape();
227 if (cs->GetBoolNode()->GetRightMatrix() != nnode->GetMatrix()) continue;
228 // The composite uses the matrix -> replace it
230 ncs->GetBoolNode()->ReplaceMatrix(nnode->GetMatrix(), newmat);
231 // We have to clone the node/volume having the composite shape
232 TGeoVolume *newvol = node->GetVolume()->CloneVolume();
233 if (!newvol) {
234 Error("Align", "Cannot clone volume %s", node->GetVolume()->GetName());
235 return kFALSE;
236 }
237 newvol->SetShape(ncs);
238 TGeoNode *newnode = node->MakeCopyNode();
239 if (!newnode) {
240 Error("Align", "Cannot clone node %s", node->GetName());
241 return kFALSE;
242 }
243 newnode->SetVolume(newvol);
244 newnode->SetMotherVolume(vm);
246 gGeoManager->GetListOfGShapes()->Add(newnode);
247 }
248 vm->GetNodes()->RemoveAt(i);
249 vm->GetNodes()->AddAt(newnode,i);
250 shared = kTRUE;
251 }
252 if (!shared) Error("Align", "The matrix replaced for %s is not actually shared", GetName());
253 } else {
254 // The aligned node may have a composite shape containing a shared matrix
255 if (vd->GetShape()->IsComposite()) {
256 cs = (TGeoCompositeShape*)vd->GetShape();
257 if (cs->GetBoolNode()->GetRightMatrix()->IsShared()) {
258 if (!nnode->GetMatrix()->IsIdentity()) {
259 Error("Align", "The composite shape having a shared matrix on the subtracted branch must be positioned using identity matrix.");
260 return kFALSE;
261 }
262 // We have to put the alignment matrix on top of the left branch
263 // of the composite shape. The node is already decoupled from logical tree.
265 TGeoMatrix *oldmat = ncs->GetBoolNode()->GetLeftMatrix();
266 TGeoHMatrix *newmat1 = new TGeoHMatrix(*newmat);
267 newmat1->Multiply(oldmat);
268 ncs->GetBoolNode()->ReplaceMatrix(oldmat, newmat1);
269 vd->SetShape(ncs);
270 // The right-side matrix pointer is preserved, so no need to update nodes.
271 aligned = 0; // to prevent updating its matrix
272 }
273 }
274 }
275 // Register matrix and make it the active one
276 if (!newmat->IsRegistered()) newmat->RegisterYourself();
277 if (aligned) {
278 aligned->SetMatrix(newmat);
279 // Update the global matrix for the aligned node
280 TGeoHMatrix *global = GetMatrix();
282 *global = up;
283 global->Multiply(newmat);
284 }
285 }
286 // Change the shape for the aligned node
287 if (newshape) vd->SetShape(newshape);
288
289 // Re-compute bounding box of mother(s) if needed
290 for (i=fLevel-1; i>0; i--) {
291 Bool_t dassm = vd->IsAssembly(); // is daughter assembly ?
292 vd = GetVolume(i);
293 if (!vd) break;
294 Bool_t cassm = vd->IsAssembly(); // is current assembly ?
295 if (cassm) ((TGeoShapeAssembly*)vd->GetShape())->NeedsBBoxRecompute();
296 if ((cassm || dassm) && vd->GetVoxels()) vd->GetVoxels()->SetNeedRebuild();
297 if (!cassm) break;
298 }
299
300 // Now we have to re-voxelize the mother volume
301 TGeoVoxelFinder *voxels = vm->GetVoxels();
302 if (voxels) voxels->SetNeedRebuild();
303 // Eventually check for overlaps
304 if (check) {
305 if (voxels) {
306 voxels->Voxelize();
307 vm->FindOverlaps();
308 }
309 // Set aligned node to be checked
310 i = fLevel;
311 node = GetNode(i);
312 if (!node) return kTRUE;
313 if (node->IsOverlapping()) {
314 Info("Align", "The check for overlaps for node: \n%s\n cannot be performed since the node is declared possibly overlapping",
315 GetName());
316 } else {
318 // Check overlaps for the first non-assembly parent node
319 while ((node=GetNode(--i))) {
320 if (!node->GetVolume()->IsAssembly()) break;
321 }
322 if (node && node->IsOverlapping()) {
323 Info("Align", "The check for overlaps for assembly node: \n%s\n cannot be performed since the parent %s is declared possibly overlapping",
324 GetName(), node->GetName());
325 node = 0;
326 }
327 if (node) node->CheckOverlaps(ovlp);
329 }
330 }
331 // Clean current matrices from cache
334 return kTRUE;
335}
336
337////////////////////////////////////////////////////////////////////////////////
338
340{
341 if (GetNode(0) != gGeoManager->GetTopNode()) return;
343}
344
345////////////////////////////////////////////////////////////////////////////////
346/// Draw this node.
347
349{
350}
351
352////////////////////////////////////////////////////////////////////////////////
353/// Return parent at LEVUP generation
354
356{
357 Int_t ind = fLevel-levup;
358 if (ind<0) return 0;
359 return (TGeoNode*)fNodes->UncheckedAt(ind);
360}
361
362////////////////////////////////////////////////////////////////////////////////
363/// Return global matrix for node at LEVEL.
364
366{
367 if (level<0) return (TGeoHMatrix*)fMatrices->UncheckedAt(fLevel);
368 if (level>fLevel) return 0;
369 return (TGeoHMatrix*)fMatrices->UncheckedAt(level);
370}
371
372////////////////////////////////////////////////////////////////////////////////
373/// Return node in branch at LEVEL. If not specified, return last leaf.
374
376{
377 if (level<0) return (TGeoNode*)fNodes->UncheckedAt(fLevel);
378 if (level>fLevel) return 0;
379 return (TGeoNode*)fNodes->UncheckedAt(level);
380}
381
382////////////////////////////////////////////////////////////////////////////////
383/// Return volume associated with node at LEVEL in the branch
384
386{
387 TGeoNode *node = GetNode(level);
388 if (node) return node->GetVolume();
389 return 0;
390}
391
392////////////////////////////////////////////////////////////////////////////////
393/// Return shape associated with volume.
394
396{
397 TGeoVolume *vol = GetVolume(level);
398 if (vol) return vol->GetShape();
399 return 0;
400}
401
402////////////////////////////////////////////////////////////////////////////////
403/// Paint this node and its content according to visualization settings.
404
406{
408 if (!painter) return;
409// painter->PaintNode(this, option);
410}
411
412////////////////////////////////////////////////////////////////////////////////
413/// Print info about this node.
414
415void TGeoPhysicalNode::Print(Option_t * /*option*/) const
416{
417 printf("TGeoPhysicalNode: %s level=%d aligned=%d\n", fName.Data(), fLevel, IsAligned());
418 for (Int_t i=0; i<=fLevel; i++) {
419 printf(" level %d: node %s\n", i, GetNode(i)->GetName());
420 printf(" local matrix:\n");
421 if (GetNode(i)->GetMatrix()->IsIdentity()) printf(" IDENTITY\n");
422 else GetNode(i)->GetMatrix()->Print();
423 printf(" global matrix:\n");
424 if (GetMatrix(i)->IsIdentity()) printf(" IDENTITY\n");
425 else GetMatrix(i)->Print();
426 }
427 if (IsAligned() && fMatrixOrig) {
428 printf(" original local matrix:\n");
430 }
431}
432
433////////////////////////////////////////////////////////////////////////////////
434/// Refresh this physical node. Called for all registered physical nodes
435/// after an Align() call.
436
438{
439 SetPath(fName.Data());
440}
441
442////////////////////////////////////////////////////////////////////////////////
443/// Set node branch according to current state
444
446{
448 if (!cache) {
449 Error("SetBranchAsState","no state available");
450 return;
451 }
452 if (!cache->IsDummy()) {
453 Error("SetBranchAsState", "not implemented for full cache");
454 return;
455 }
456 if (!fNodes) fNodes = new TObjArray(30);
457 if (!fMatrices) fMatrices = new TObjArray(30);
458 TGeoHMatrix **matrices = (TGeoHMatrix **) cache->GetMatrices();
459 TGeoNode **branch = (TGeoNode **) cache->GetBranch();
460
461 Bool_t refresh = (fLevel>0)?kTRUE:kFALSE;
462 if (refresh) {
463 TGeoHMatrix *current;
464 for (Int_t i=0; i<=fLevel; i++) {
465 fNodes->AddAtAndExpand(branch[i],i);
466 current = (TGeoHMatrix*)fMatrices->UncheckedAt(i);
467 *current = *matrices[i];
468 }
469 return;
470 }
472 for (Int_t i=0; i<=fLevel; i++) {
473 fNodes->AddAtAndExpand(branch[i],i);
474 fMatrices->AddAtAndExpand(new TGeoHMatrix(*matrices[i]),i);
475 }
477 if (!fMatrixOrig) fMatrixOrig = new TGeoHMatrix();
478 *fMatrixOrig = node->GetMatrix();
479}
480
481////////////////////////////////////////////////////////////////////////////////
482/// Allows PN entries (or users) to preset the local original matrix for the
483/// last node pointed by the path.
484
486{
487 if (!fMatrixOrig) fMatrixOrig = new TGeoHMatrix();
488 if (!local) {
490 return;
491 }
492 *fMatrixOrig = local;
493}
494
495////////////////////////////////////////////////////////////////////////////////
496/// Specify the path for this node.
497
499{
500 if (!gGeoManager->cd(path)) {
501 Error("SetPath","wrong path -> maybe RestoreMasterVolume");
502 return kFALSE;
503 }
505 return kTRUE;
506}
507
508////////////////////////////////////////////////////////////////////////////////
509/// Checks if a given navigator state matches this physical node
510
512{
513 TGeoNodeCache *cache = nav->GetCache();
514 if (!cache) {
515 Fatal("SetBranchAsState","no state available");
516 return kFALSE;
517 }
518 TGeoNode **branch = (TGeoNode **) cache->GetBranch();
519 for (Int_t i=1; i<=fLevel; i++)
520 if (fNodes->At(i) != branch[i]) return kFALSE;
521 return kTRUE;
522}
523
525
526////////////////////////////////////////////////////////////////////////////////
527/// Default constructor
528
530{
531 fNode = 0;
532 fMatrix = 0;
533 fGlobalOrig = 0;
534}
535
536////////////////////////////////////////////////////////////////////////////////
537/// Default constructor
538
539TGeoPNEntry::TGeoPNEntry(const char *name, const char *path)
540 :TNamed(name, path)
541{
542 if (!gGeoManager || !gGeoManager->IsClosed() || !gGeoManager->CheckPath(path)) {
543 TString errmsg("Cannot define a physical node link without a closed geometry and a valid path !");
544 Error("ctor", "%s", errmsg.Data());
545 throw errmsg;
546 return;
547 }
549 gGeoManager->cd(path);
550 fGlobalOrig = new TGeoHMatrix();
553 fNode = 0;
554 fMatrix = 0;
555}
556
557////////////////////////////////////////////////////////////////////////////////
558/// Destructor
559
561{
562 if (fMatrix && !fMatrix->IsRegistered()) delete fMatrix;
563 delete fGlobalOrig;
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Setter for the corresponding physical node.
568
570{
571 if (fNode && node) {
572 Warning("SetPhysicalNode", "Physical node changed for entry %s", GetName());
573 Warning("SetPhysicalNode", "=== New path: %s", node->GetName());
574 }
575 fNode = node;
576}
577
578////////////////////////////////////////////////////////////////////////////////
579/// Set the additional matrix for this node entry. The matrix will be deleted
580/// by this class unless registered by the user to gGeoManager
581
583{
584 fMatrix = mat;
585}
const Bool_t kFALSE
Definition: RtypesCore.h:90
double Double_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
XFontStruct * id
Definition: TGX11.cxx:108
char name[80]
Definition: TGX11.cxx:109
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:600
R__EXTERN TGeoIdentity * gGeoIdentity
Definition: TGeoMatrix.h:478
Bool_t ReplaceMatrix(TGeoMatrix *mat, TGeoMatrix *newmat)
Replace one of the matrices.
TGeoMatrix * GetRightMatrix() const
Definition: TGeoBoolNode.h:81
TGeoMatrix * GetLeftMatrix() const
Definition: TGeoBoolNode.h:80
virtual TGeoBoolNode * MakeClone() const =0
Class handling Boolean composition of shapes.
TGeoBoolNode * GetBoolNode() const
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition: TGeoMatrix.h:421
void Clear(Option_t *option="")
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
Definition: TGeoManager.h:303
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
Definition: TGeoManager.h:494
Int_t GetLevel() const
Definition: TGeoManager.h:525
TGeoHMatrix * GetCurrentMatrix() const
Definition: TGeoManager.h:514
TGeoNode * GetTopNode() const
Definition: TGeoManager.h:531
TGeoNodeCache * GetCache() const
Definition: TGeoManager.h:576
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)
Definition: TGeoManager.h:583
Bool_t PopPath()
Definition: TGeoManager.h:584
Geometrical transformation package.
Definition: TGeoMatrix.h:41
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Definition: TGeoMatrix.cxx:526
void Print(Option_t *option="") const
print the matrix in 4x4 format
Definition: TGeoMatrix.cxx:486
Bool_t IsIdentity() const
Definition: TGeoMatrix.h:66
Bool_t IsRegistered() const
Definition: TGeoMatrix.h:77
Bool_t IsShared() const
Definition: TGeoMatrix.h:71
Class providing navigation API for TGeo geometries.
Definition: TGeoNavigator.h:34
TGeoNodeCache * GetCache() const
Special pool of reusable nodes.
Definition: TGeoCache.h:54
void * GetMatrices() const
Definition: TGeoCache.h:98
Bool_t IsDummy() const
Definition: TGeoCache.h:113
void * GetBranch() const
Definition: TGeoCache.h:94
A node containing local transformation.
Definition: TGeoNode.h:153
void SetMatrix(const TGeoMatrix *matrix)
Matrix setter.
Definition: TGeoNode.cxx:767
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition: TGeoNode.h:41
Bool_t IsOverlapping() const
Definition: TGeoNode.h:105
TGeoVolume * GetVolume() const
Definition: TGeoNode.h:97
void SetVolume(TGeoVolume *volume)
Definition: TGeoNode.h:115
Bool_t IsOffset() const
Definition: TGeoNode.h:103
virtual TGeoMatrix * GetMatrix() const =0
Bool_t IsCloned() const
Definition: TGeoNode.h:101
void SetMotherVolume(TGeoVolume *mother)
Definition: TGeoNode.h:123
virtual TGeoNode * MakeCopyNode() const
Definition: TGeoNode.h:111
TGeoVolume * GetMotherVolume() const
Definition: TGeoNode.h:92
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Check overlaps bigger than OVLP hierarchically, starting with this node.
Definition: TGeoNode.cxx:179
The knowledge of the path to the objects that need to be misaligned is essential since there is no ot...
const TGeoHMatrix * fMatrix
void SetPhysicalNode(TGeoPhysicalNode *node)
Setter for the corresponding physical node.
TGeoPhysicalNode * fNode
TGeoHMatrix * fGlobalOrig
TGeoPNEntry()
Default constructor.
virtual ~TGeoPNEntry()
Destructor.
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
virtual ~TGeoPhysicalNode()
Destructor.
TGeoNode * GetMother(Int_t levup=1) const
Return parent at LEVUP generation.
void Draw(Option_t *option="")
Draw this node.
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.
virtual void Print(Option_t *option="") const
Print info about this node.
void SetVisibility(Bool_t flag=kTRUE)
TGeoPhysicalNode()
Default constructor.
Bool_t Align(TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE, Double_t ovlp=0.001)
Align a physical node with a new relative matrix/shape.
void SetAligned(Bool_t flag=kTRUE)
void SetVisibleFull(Bool_t flag=kTRUE)
Bool_t IsMatchingState(TGeoNavigator *nav) const
Checks if a given navigator state matches this physical node.
TObjArray * fNodes
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.
TGeoHMatrix * fMatrixOrig
virtual void Paint(Option_t *option="")
Paint this node and its content according to visualization settings.
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:26
virtual Bool_t IsComposite() const
Definition: TGeoShape.h:130
virtual const char * GetName() const
Get the shape name.
Definition: TGeoShape.cxx:248
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:47
@ kVolumeImportNodes
Definition: TGeoVolume.h:79
virtual TGeoVolume * CloneVolume() const
Clone this volume.
Int_t GetNdaughters() const
Definition: TGeoVolume.h:347
TObjArray * GetNodes()
Definition: TGeoVolume.h:165
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:186
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
TString fName
Definition: TNamed.h:32
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
An array of TObjects.
Definition: TObjArray.h:37
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Definition: TObjArray.cxx:235
void Add(TObject *obj)
Definition: TObjArray.h:74
TObject * UncheckedAt(Int_t i) const
Definition: TObjArray.h:90
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
Definition: TObjArray.cxx:356
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
Definition: TObjArray.cxx:254
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
Definition: TObjArray.cxx:694
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:187
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:877
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:891
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition: TObject.cxx:919
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:865
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
Abstract class for geometry painters.