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