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