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