ROOT  6.06/09
Reference Guide
TGeoCache.cxx
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 18/03/02
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 // Physical tree description.
14 //
15 //
16 //
17 //
18 //Begin_Html
19 /*
20 <img src=".gif">
21 */
22 //End_Html
23 
24 #include "TGeoManager.h"
25 #include "TGeoMatrix.h"
26 #include "TGeoVolume.h"
27 #include "TGeoCache.h"
28 
29 //const Int_t kN3 = 3*sizeof(Double_t);
30 
31 
33 
34 /*************************************************************************
35  * TGeoNodeCache - special pool of reusable nodes
36  *
37  *
38  *************************************************************************/
39 
40 ////////////////////////////////////////////////////////////////////////////////
41 /// Dummy constructor
42 
44 {
45  fGeoCacheMaxLevels = 100;
46  fGeoCacheStackSize = 10;
47  fGeoInfoStackSize = 100;
48  fLevel = 0;
49  fStackLevel = 0;
50  fInfoLevel = 0;
51  fCurrentID = 0;
52  fIndex = 0;
53  fPath = "";
54  fTop = 0;
55  fNode = 0;
56  fMatrix = 0;
57  fStack = 0;
58  fMatrixBranch = 0;
59  fMPB = 0;
60  fNodeBranch = 0;
61  fInfoBranch = 0;
62  fPWInfo = 0;
63  fNodeIdArray = 0;
64  for (Int_t i=0; i<100; i++) fIdBranch[i] = 0;
65 }
66 
67 ////////////////////////////////////////////////////////////////////////////////
68 /// Default constructor
69 
71 {
72  fGeoCacheMaxLevels = capacity;
73  fGeoCacheStackSize = 10;
74  fGeoInfoStackSize = 100;
75  fLevel = 0;
76  fStackLevel = 0;
77  fInfoLevel = 0;
78  fCurrentID = 0;
79  fIndex = 0;
80  fPath = "";
81  fTop = top;
82  fNode = top;
84  for (Int_t ist=0; ist<fGeoCacheStackSize; ist++)
85  fStack->Add(new TGeoCacheState(fGeoCacheMaxLevels)); // !obsolete 100
90  for (Int_t i=0; i<fGeoCacheMaxLevels; i++) {
91  fMPB[i] = new TGeoHMatrix(TString::Format("global_%d",i));
92  fMatrixBranch[i] = 0;
93  fNodeBranch[i] = 0;
94  }
95  for (Int_t i=0; i<fGeoInfoStackSize; i++) {
96  fInfoBranch[i] = 0;
97  }
98  fPWInfo = 0;
99  fMatrix = fMatrixBranch[0] = fMPB[0];
100  fNodeBranch[0] = top;
101  fNodeIdArray = 0;
102  for (Int_t i=0; i<100; i++) fIdBranch[i] = 0;
103  if (nodeid) BuildIdArray();
104  CdTop();
105 }
106 
107 ////////////////////////////////////////////////////////////////////////////////
108 /// Destructor
109 
111 {
112  if (fStack) {
113  fStack->Delete();
114  delete fStack;
115  }
116  if (fMatrixBranch) delete [] fMatrixBranch;
117  if (fMPB) {
118  for (Int_t i=0; i<fGeoCacheMaxLevels; i++) delete fMPB[i];
119  delete [] fMPB;
120  }
121  delete [] fNodeBranch;
122  if (fInfoBranch) {
123  for (Int_t i=0; i<fGeoInfoStackSize; i++) delete fInfoBranch[i];
124  }
125  delete [] fInfoBranch;
126  if (fNodeIdArray) delete [] fNodeIdArray;
127  delete fPWInfo;
128 }
129 
130 ////////////////////////////////////////////////////////////////////////////////
131 /// Builds node id array.
132 
134 {
135  Int_t nnodes = gGeoManager->GetNNodes();
136  //if (nnodes>3E7) return;
137  if (fNodeIdArray) delete [] fNodeIdArray;
138  Info("BuildIDArray","--- node ID tracking enabled, size=%lu Bytes\n", ULong_t((2*nnodes+1)*sizeof(Int_t)));
139  fNodeIdArray = new Int_t[2*nnodes+1];
140  fNodeIdArray[0] = 0;
141  Int_t ifree = 1;
142  Int_t nodeid = 0;
143  gGeoManager->GetTopNode()->FillIdArray(ifree, nodeid, fNodeIdArray);
144  fIdBranch[0] = 0;
145 }
146 
147 ////////////////////////////////////////////////////////////////////////////////
148 /// Bulds info branch. Navigation is possible only after this step.
149 
151 {
153  else if (fInfoBranch[0]) return;
154  for (Int_t i=0; i<fGeoInfoStackSize; i++) {
155  fInfoBranch[i] = new TGeoStateInfo();
156  }
157 }
158 
159 ////////////////////////////////////////////////////////////////////////////////
160 /// Get the PW info, if none create one
161 
163 {
164  if (fPWInfo) return fPWInfo;
165  fPWInfo = new TGeoStateInfo(nd);
166  return fPWInfo;
167 }
168 
169 ////////////////////////////////////////////////////////////////////////////////
170 /// Change current path to point to the node having this id.
171 /// Node id has to be in range : 0 to fNNodes-1 (no check for performance reasons)
172 
174  if (!fNodeIdArray) {
175  Error("CdNode", "Navigation based on phisical node unuique id disabled.\n To enable, use: gGeoManager->GetCache()->BuildIdArray()");
176  return;
177  }
178  Int_t *arr = fNodeIdArray;
179  if (nodeid == arr[fIndex]) return;
180  while (fLevel>0) {
181  gGeoManager->CdUp();
182  if (nodeid == arr[fIndex]) return;
183  }
184  gGeoManager->CdTop();
185  Int_t currentID = 0;
186  Int_t nd = GetNode()->GetNdaughters();
187  Int_t nabove, nbelow, middle;
188  while (nodeid!=currentID && nd) {
189  nabove = nd+1;
190  nbelow = 0;
191  while (nabove-nbelow > 1) {
192  middle = (nabove+nbelow)>>1;
193  currentID = arr[arr[fIndex+middle]];
194  if (nodeid == currentID) {
195  gGeoManager->CdDown(middle-1);
196  return;
197  }
198  if (nodeid < currentID) nabove = middle;
199  else nbelow = middle;
200  }
201  gGeoManager->CdDown(nbelow-1);
202  currentID = arr[fIndex];
203  nd = GetNode()->GetNdaughters();
204  }
205 }
206 
207 ////////////////////////////////////////////////////////////////////////////////
208 /// Make daughter INDEX of current node the active state. Compute global matrix.
209 
211 {
212  TGeoNode *newnode = fNode->GetDaughter(index);
213  if (!newnode) return kFALSE;
214  fLevel++;
215  if (fNodeIdArray) {
216  fIndex = fNodeIdArray[fIndex+index+1];
218  }
219  fNode = newnode;
221  TGeoMatrix *local = newnode->GetMatrix();
222  TGeoHMatrix *newmat = fMPB[fLevel];
223  if (!local->IsIdentity()) {
224  newmat->CopyFrom(fMatrix);
225  newmat->Multiply(local);
226  fMatrix = newmat;
227  }
229  return kTRUE;
230 }
231 
232 ////////////////////////////////////////////////////////////////////////////////
233 /// Make daughter INDEX of current node the active state. Compute global matrix.
234 
236 {
237  if (!newnode) return kFALSE;
238  fLevel++;
239  if (fNodeIdArray) {
240  Int_t index = fNode->GetVolume()->GetIndex(newnode);
241  fIndex = fNodeIdArray[fIndex+index+1];
243  }
244  fNode = newnode;
246  TGeoMatrix *local = newnode->GetMatrix();
247  TGeoHMatrix *newmat = fMPB[fLevel];
248  if (!local->IsIdentity()) {
249  newmat->CopyFrom(fMatrix);
250  newmat->Multiply(local);
251  fMatrix = newmat;
252  }
254  return kTRUE;
255 }
256 
257 ////////////////////////////////////////////////////////////////////////////////
258 /// Make mother of current node the active state.
259 
261 {
262  if (!fLevel) return;
263  fLevel--;
267 }
268 
269 ////////////////////////////////////////////////////////////////////////////////
270 /// Returns a fixed ID for current physical node
271 
273 {
274  if (fNodeIdArray) return fNodeIdArray[fIndex];
275  return GetNodeId();
276 }
277 
278 ////////////////////////////////////////////////////////////////////////////////
279 /// Get unique node id.
280 
282 {
283  Long_t id=0;
284  for (Int_t level=0;level<fLevel+1; level++)
285  id += (Long_t)fNodeBranch[level];
286  return (Int_t)id;
287 }
288 
289 ////////////////////////////////////////////////////////////////////////////////
290 /// Fill names with current branch volume names (4 char - used by GEANT3 interface).
291 
293 {
294  const char *name;
295  for (Int_t i=0; i<fLevel+1; i++) {
296  name = fNodeBranch[i]->GetVolume()->GetName();
297  memcpy(&names[i], name, sizeof(Int_t));
298  }
299 }
300 
301 ////////////////////////////////////////////////////////////////////////////////
302 /// Fill copy numbers of current branch nodes.
303 
304 void TGeoNodeCache::GetBranchNumbers(Int_t *copyNumbers, Int_t *volumeNumbers) const
305 {
306  for (Int_t i=0; i<fLevel+1; i++) {
307  copyNumbers[i] = fNodeBranch[i]->GetNumber();
308  volumeNumbers[i] = fNodeBranch[i]->GetVolume()->GetNumber();
309  }
310 }
311 
312 ////////////////////////////////////////////////////////////////////////////////
313 /// Fill copy numbers of current branch nodes.
314 
316 {
317  Bool_t ismany = kFALSE;
318  for (Int_t i=0; i<fLevel+1; i++) {
319  if (!fNodeBranch[i]->IsOffset()) ismany=fNodeBranch[i]->IsOverlapping();
320  isonly[i] = (ismany)?0:1;
321  }
322 }
323 
324 ////////////////////////////////////////////////////////////////////////////////
325 /// Get next state info pointer.
326 
328 {
329  if (fInfoLevel==fGeoInfoStackSize-1) {
330  TGeoStateInfo **infoBranch = new TGeoStateInfo*[2*fGeoInfoStackSize];
331  memcpy(infoBranch, fInfoBranch, fGeoInfoStackSize*sizeof(TGeoStateInfo*));
332  for (Int_t i=fGeoInfoStackSize; i<2*fGeoInfoStackSize; i++)
333  infoBranch[i] = new TGeoStateInfo();
334  delete [] fInfoBranch;
335  fInfoBranch = infoBranch;
336  fGeoInfoStackSize *= 2;
337  }
338  return fInfoBranch[fInfoLevel++];
339 }
340 
341 ////////////////////////////////////////////////////////////////////////////////
342 /// Release last used state info pointer.
343 
345 {
346  fInfoLevel--;
347 }
348 
349 ////////////////////////////////////////////////////////////////////////////////
350 /// Returns the current geometry path.
351 
353 {
354  fPath = "";
355  for (Int_t level=0;level<fLevel+1; level++) {
356  fPath += "/";
357  fPath += fNodeBranch[level]->GetName();
358  }
359  return fPath.Data();
360 }
361 
362 ////////////////////////////////////////////////////////////////////////////////
363 /// Push current state into heap.
364 
365 Int_t TGeoNodeCache::PushState(Bool_t ovlp, Int_t startlevel, Int_t nmany, Double_t *point)
366 {
368  for (Int_t ist=0; ist<fGeoCacheStackSize; ist++)
370  }
371  ((TGeoCacheState*)fStack->At(fStackLevel))->SetState(fLevel,startlevel,nmany,ovlp,point);
372  return ++fStackLevel;
373 }
374 
375 ////////////////////////////////////////////////////////////////////////////////
376 /// Pop next state/point from heap.
377 
379 {
380  if (!fStackLevel) return 0;
381  Bool_t ovlp = ((TGeoCacheState*)fStack->At(--fStackLevel))->GetState(fLevel,nmany,point);
382  Refresh();
383 // return (fStackLevel+1);
384  return ovlp;
385 }
386 
387 ////////////////////////////////////////////////////////////////////////////////
388 /// Pop next state/point from heap and restore matrices starting from LEVEL.
389 
391 {
392  if (level<=0) return 0;
393  Bool_t ovlp = ((TGeoCacheState*)fStack->At(level-1))->GetState(fLevel,nmany,point);
394  Refresh();
395  return ovlp;
396 }
397 
398 ////////////////////////////////////////////////////////////////////////////////
399 /// Pop next state/point from a backed-up state.
400 
402 {
403  Bool_t ovlp = state->GetState(fLevel,nmany,point);
404  Refresh();
405  return ovlp;
406 }
407 
408 ////////////////////////////////////////////////////////////////////////////////
409 /// Local point converted to master frame defined by current matrix.
410 
411 void TGeoNodeCache::LocalToMaster(const Double_t *local, Double_t *master) const
412 {
413  fMatrix->LocalToMaster(local, master);
414 }
415 
416 ////////////////////////////////////////////////////////////////////////////////
417 /// Point in master frame defined by current matrix converted to local one.
418 
419 void TGeoNodeCache::MasterToLocal(const Double_t *master, Double_t *local) const
420 {
421  fMatrix->MasterToLocal(master, local);
422 }
423 
424 ////////////////////////////////////////////////////////////////////////////////
425 /// Local vector converted to master frame defined by current matrix.
426 
427 void TGeoNodeCache::LocalToMasterVect(const Double_t *local, Double_t *master) const
428 {
429  fMatrix->LocalToMasterVect(local, master);
430 }
431 
432 ////////////////////////////////////////////////////////////////////////////////
433 /// Vector in master frame defined by current matrix converted to local one.
434 
435 void TGeoNodeCache::MasterToLocalVect(const Double_t *master, Double_t *local) const
436 {
437  fMatrix->MasterToLocalVect(master,local);
438 }
439 
440 ////////////////////////////////////////////////////////////////////////////////
441 /// Local point converted to master frame defined by current matrix and rescaled with bomb factor.
442 
443 void TGeoNodeCache::LocalToMasterBomb(const Double_t *local, Double_t *master) const
444 {
445  fMatrix->LocalToMasterBomb(local, master);
446 }
447 
448 ////////////////////////////////////////////////////////////////////////////////
449 /// Point in master frame defined by current matrix converted to local one and rescaled with bomb factor.
450 
451 void TGeoNodeCache::MasterToLocalBomb(const Double_t *master, Double_t *local) const
452 {
453  fMatrix->MasterToLocalBomb(master, local);
454 }
455 
457 
458 /*************************************************************************
459 * TGeoCacheState - class storing the state of the cache at a given moment
460 *
461 *
462 *************************************************************************/
463 
464 ////////////////////////////////////////////////////////////////////////////////
465 /// Default ctor.
466 
468 {
469  fCapacity = 0;
470  fLevel = 0;
471  fNmany = 0;
472  fStart = 0;
473  memset(fIdBranch, 0, 30*sizeof(Int_t));
474  memset(fPoint, 0, 3*sizeof(Int_t));
475  fOverlapping = kFALSE;
476  fNodeBranch = 0;
477  fMatrixBranch = 0;
478  fMatPtr = 0;
479 }
480 
481 ////////////////////////////////////////////////////////////////////////////////
482 /// Ctor.
483 
485 {
486  fCapacity = capacity;
487  fLevel = 0;
488  fNmany = 0;
489  fStart = 0;
490  memset(fIdBranch, 0, 30*sizeof(Int_t));
491  memset(fPoint, 0, 3*sizeof(Int_t));
493  fNodeBranch = new TGeoNode *[capacity];
494  fMatrixBranch = new TGeoHMatrix *[capacity];
495  fMatPtr = new TGeoHMatrix *[capacity];
496  for (Int_t i=0; i<capacity; i++) {
497  fMatrixBranch[i] = new TGeoHMatrix("global");
498  fNodeBranch[i] = 0;
499  }
500 }
501 
502 ////////////////////////////////////////////////////////////////////////////////
503 ///copy constructor
504 
506  TObject(gcs),
507  fCapacity(gcs.fCapacity),
508  fLevel(gcs.fLevel),
509  fNmany(gcs.fNmany),
510  fStart(gcs.fStart),
511  fOverlapping(gcs.fOverlapping)
512 {
513  Int_t i;
514  for (i=0; i<3; i++) fPoint[i]=gcs.fPoint[i];
515  for(i=0; i<30; i++) fIdBranch[i]=gcs.fIdBranch[i];
516  fNodeBranch = new TGeoNode *[fCapacity];
518  fMatPtr = new TGeoHMatrix *[fCapacity];
519  for (i=0; i<fCapacity; i++) {
520  fNodeBranch[i] = gcs.fNodeBranch[i];
521  fMatrixBranch[i] = new TGeoHMatrix(*gcs.fMatrixBranch[i]);
522  fMatPtr[i] = gcs.fMatPtr[i];
523  }
524 }
525 
526 ////////////////////////////////////////////////////////////////////////////////
527 ///assignment operator
528 
530 {
531  Int_t i;
532  if(this!=&gcs) {
533  TObject::operator=(gcs);
534  fCapacity=gcs.fCapacity;
535  fLevel=gcs.fLevel;
536  fNmany=gcs.fNmany;
537  fStart=gcs.fStart;
538  for(i=0; i<30; i++) fIdBranch[i]=gcs.fIdBranch[i];
539  for(i=0; i<3; i++) fPoint[i]=gcs.fPoint[i];
541  fNodeBranch = new TGeoNode *[fCapacity];
543  fMatPtr = new TGeoHMatrix *[fCapacity];
544  for (i=0; i<fCapacity; i++) {
545  fNodeBranch[i] = gcs.fNodeBranch[i];
546  fMatrixBranch[i] = new TGeoHMatrix(*gcs.fMatrixBranch[i]);
547  fMatPtr[i] = gcs.fMatPtr[i];
548  }
549  }
550  return *this;
551 }
552 
553 ////////////////////////////////////////////////////////////////////////////////
554 /// Dtor.
555 
557 {
558  if (fNodeBranch) {
559  for (Int_t i=0; i<fCapacity; i++) {
560  delete fMatrixBranch[i];
561  }
562  delete [] fNodeBranch;
563  delete [] fMatrixBranch;
564  delete [] fMatPtr;
565  }
566 }
567 
568 ////////////////////////////////////////////////////////////////////////////////
569 /// Fill current modeller state.
570 
571 void TGeoCacheState::SetState(Int_t level, Int_t startlevel, Int_t nmany, Bool_t ovlp, Double_t *point)
572 {
573  fLevel = level;
574  fStart = startlevel;
575  fNmany = nmany;
576  TGeoNodeCache *cache = gGeoManager->GetCache();
577  if (cache->HasIdArray()) memcpy(fIdBranch, cache->GetIdBranch()+fStart, (level+1-fStart)*sizeof(Int_t));
578  TGeoNode **node_branch = (TGeoNode **) cache->GetBranch();
579  TGeoHMatrix **mat_branch = (TGeoHMatrix **) cache->GetMatrices();
580  Int_t nelem = level+1-fStart;
581  memcpy(fNodeBranch, node_branch+fStart, nelem*sizeof(TGeoNode *));
582  memcpy(fMatPtr, mat_branch+fStart, nelem*sizeof(TGeoHMatrix *));
583  TGeoHMatrix *last = 0;
584  TGeoHMatrix *current;
585  for (Int_t i=0; i<nelem; i++) {
586  current = mat_branch[i+fStart];
587  if (current == last) continue;
588  *fMatrixBranch[i] = current;
589  last = current;
590  }
591  fOverlapping = ovlp;
592  if (point) memcpy(fPoint, point, 3*sizeof(Double_t));
593 }
594 
595 ////////////////////////////////////////////////////////////////////////////////
596 /// Restore a modeler state.
597 
598 Bool_t TGeoCacheState::GetState(Int_t &level, Int_t &nmany, Double_t *point) const
599 {
600  level = fLevel;
601  nmany = fNmany;
602  TGeoNodeCache *cache = gGeoManager->GetCache();
603  if (cache->HasIdArray()) cache->FillIdBranch(fIdBranch, fStart);
604  TGeoNode **node_branch = (TGeoNode **) cache->GetBranch();
605  TGeoHMatrix **mat_branch = (TGeoHMatrix **) cache->GetMatrices();
606  Int_t nelem = level+1-fStart;
607  memcpy(node_branch+fStart, fNodeBranch, nelem*sizeof(TGeoNode *));
608  memcpy(mat_branch+fStart, fMatPtr, (level+1-fStart)*sizeof(TGeoHMatrix *));
609  TGeoHMatrix *last = 0;
610  TGeoHMatrix *current;
611  for (Int_t i=0; i<nelem; i++) {
612  current = mat_branch[i+fStart];
613  if (current == last) continue;
614  *current = fMatrixBranch[i];
615  last = current;
616  }
617  if (point) memcpy(point, fPoint, 3*sizeof(Double_t));
618  return fOverlapping;
619 }
Int_t fGeoCacheMaxLevels
Definition: TGeoCache.h:72
void MasterToLocal(const Double_t *master, Double_t *local) const
Point in master frame defined by current matrix converted to local one.
Definition: TGeoCache.cxx:419
An array of TObjects.
Definition: TObjArray.h:39
virtual ~TGeoNodeCache()
Destructor.
Definition: TGeoCache.cxx:110
Int_t fCurrentID
Definition: TGeoCache.h:78
void Refresh()
Definition: TGeoCache.h:141
TGeoVolume * GetVolume() const
Definition: TGeoNode.h:106
TObjArray * fStack
current matrix
Definition: TGeoCache.h:85
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
Definition: TObjArray.cxx:328
TGeoStateInfo * GetInfo()
Get next state info pointer.
Definition: TGeoCache.cxx:327
void CdUp()
Go one level up in geometry.
Int_t fIdBranch[100]
Definition: TGeoCache.h:80
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:892
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
TGeoNode * GetNode() const
Definition: TGeoCache.h:119
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
TGeoStateInfo * GetMakePWInfo(Int_t nd)
Get the PW info, if none create one.
Definition: TGeoCache.cxx:162
void LocalToMaster(const Double_t *local, Double_t *master) const
Local point converted to master frame defined by current matrix.
Definition: TGeoCache.cxx:411
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.cxx:370
void GetBranchOnlys(Int_t *isonly) const
Fill copy numbers of current branch nodes.
Definition: TGeoCache.cxx:315
TGeoStateInfo ** fInfoBranch
Definition: TGeoCache.h:89
void LocalToMasterVect(const Double_t *local, Double_t *master) const
Local vector converted to master frame defined by current matrix.
Definition: TGeoCache.cxx:427
void FillIdBranch(const Int_t *br, Int_t startlevel=0)
Definition: TGeoCache.h:108
const char * Data() const
Definition: TString.h:349
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2334
TString fPath
Definition: TGeoCache.h:81
Bool_t IsOverlapping() const
Definition: TGeoNode.h:114
Int_t fIdBranch[30]
Definition: TGeoCache.h:41
Int_t GetNNodes()
Definition: TGeoManager.h:531
TGeoNode * GetTopNode() const
Definition: TGeoManager.h:500
Bool_t HasIdArray() const
Definition: TGeoCache.h:128
void CdDown(Int_t index)
Make a daughter of current node current.
void CdTop()
Definition: TGeoCache.h:106
Bool_t IsIdentity() const
Definition: TGeoMatrix.h:77
void * GetBranch() const
Definition: TGeoCache.h:110
Int_t fStart
Definition: TGeoCache.h:40
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.cxx:413
virtual TGeoMatrix * GetMatrix() const =0
TObject & operator=(const TObject &rhs)
TObject assignment operator.
Definition: TObject.cxx:102
Int_t fIndex
Definition: TGeoCache.h:79
TGeoNode * GetDaughter(Int_t ind) const
Definition: TGeoNode.h:94
XFontStruct * id
Definition: TGX11.cxx:108
void CopyFrom(const TGeoMatrix *other)
Fast copy method.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
Bool_t PopState(Int_t &nmany, Double_t *point=0)
Pop next state/point from heap.
Definition: TGeoCache.cxx:378
Int_t * fNodeIdArray
State info for the parallel world.
Definition: TGeoCache.h:91
Int_t GetNumber() const
Definition: TGeoNode.h:104
TGeoHMatrix ** fMatrixBranch
Definition: TGeoCache.h:46
void ReleaseInfo()
Release last used state info pointer.
Definition: TGeoCache.cxx:344
TGeoHMatrix ** fMPB
Definition: TGeoCache.h:87
Int_t GetCurrentNodeId() const
Returns a fixed ID for current physical node.
Definition: TGeoCache.cxx:272
virtual void MasterToLocalVect(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.cxx:438
TGeoHMatrix ** fMatPtr
Definition: TGeoCache.h:47
Int_t fCapacity
Definition: TGeoCache.h:37
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
Int_t fLevel
Definition: TGeoCache.h:38
Int_t GetNodeId() const
Get unique node id.
Definition: TGeoCache.cxx:281
Int_t fGeoCacheStackSize
Definition: TGeoCache.h:73
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.cxx:346
Int_t fInfoLevel
Definition: TGeoCache.h:77
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
const Int_t * GetIdBranch() const
Definition: TGeoCache.h:109
virtual ~TGeoCacheState()
Dtor.
Definition: TGeoCache.cxx:556
Int_t fGeoInfoStackSize
Definition: TGeoCache.h:74
TGeoNodeCache * GetCache() const
Definition: TGeoManager.h:532
void MasterToLocalVect(const Double_t *master, Double_t *local) const
Vector in master frame defined by current matrix converted to local one.
Definition: TGeoCache.cxx:435
long Long_t
Definition: RtypesCore.h:50
Int_t GetNumber() const
Definition: TGeoVolume.h:198
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:556
double Double_t
Definition: RtypesCore.h:55
Double_t fPoint[3]
Definition: TGeoCache.h:42
const char * GetPath()
Returns the current geometry path.
Definition: TGeoCache.cxx:352
Int_t fStackLevel
Definition: TGeoCache.h:76
void CdTop()
Make top level node the current node.
unsigned long ULong_t
Definition: RtypesCore.h:51
void GetBranchNames(Int_t *names) const
Fill names with current branch volume names (4 char - used by GEANT3 interface).
Definition: TGeoCache.cxx:292
TGeoNode ** fNodeBranch
Definition: TGeoCache.h:88
virtual void MasterToLocalBomb(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
Definition: TGeoMatrix.cxx:455
TGeoNode * fNode
Definition: TGeoCache.h:83
Int_t PushState(Bool_t ovlp, Int_t ntmany=0, Int_t startlevel=0, Double_t *point=0)
Push current state into heap.
Definition: TGeoCache.cxx:365
#define name(a, b)
Definition: linkTestLib0.cpp:5
TGeoStateInfo * fPWInfo
Definition: TGeoCache.h:90
Mother of all ROOT objects.
Definition: TObject.h:58
ClassImp(TGeoNodeCache) TGeoNodeCache
Dummy constructor.
Definition: TGeoCache.cxx:32
Bool_t CdDown(Int_t index)
Make daughter INDEX of current node the active state. Compute global matrix.
Definition: TGeoCache.cxx:210
TGeoHMatrix ** fMatrixBranch
Definition: TGeoCache.h:86
void * GetMatrices() const
Definition: TGeoCache.h:114
void GetBranchNumbers(Int_t *copyNumbers, Int_t *volumeNumbers) const
Fill copy numbers of current branch nodes.
Definition: TGeoCache.cxx:304
void BuildIdArray()
Builds node id array.
Definition: TGeoCache.cxx:133
Bool_t GetState(Int_t &level, Int_t &nmany, Double_t *point) const
Restore a modeler state.
Definition: TGeoCache.cxx:598
void CdNode(Int_t nodeid)
Change current path to point to the node having this id.
Definition: TGeoCache.cxx:173
TGeoNode ** fNodeBranch
Definition: TGeoCache.h:45
virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
Definition: TGeoMatrix.cxx:387
Bool_t fOverlapping
Definition: TGeoCache.h:43
void CdUp()
Make mother of current node the active state.
Definition: TGeoCache.cxx:260
void Add(TObject *obj)
Definition: TObjArray.h:75
TGMatrixLayout * fMatrix
TObject * At(Int_t idx) const
Definition: TObjArray.h:167
TGeoNode * fTop
Definition: TGeoCache.h:82
void MasterToLocalBomb(const Double_t *master, Double_t *local) const
Point in master frame defined by current matrix converted to local one and rescaled with bomb factor...
Definition: TGeoCache.cxx:451
Int_t fLevel
Definition: TGeoCache.h:75
const Bool_t kTRUE
Definition: Rtypes.h:91
void SetState(Int_t level, Int_t startlevel, Int_t nmany, Bool_t ovlp, Double_t *point=0)
Fill current modeller state.
Definition: TGeoCache.cxx:571
Int_t fNmany
Definition: TGeoCache.h:39
TGeoCacheState & operator=(const TGeoCacheState &)
assignment operator
Definition: TGeoCache.cxx:529
void FillIdArray(Int_t &ifree, Int_t &nodeid, Int_t *array) const
Fill array with node id. Recursive on node branch.
Definition: TGeoNode.cxx:390
void BuildInfoBranch()
Bulds info branch. Navigation is possible only after this step.
Definition: TGeoCache.cxx:150
Bool_t RestoreState(Int_t &nmany, TGeoCacheState *state, Double_t *point=0)
Pop next state/point from a backed-up state.
Definition: TGeoCache.cxx:401
TGeoHMatrix * fMatrix
current node
Definition: TGeoCache.h:84
Int_t GetNdaughters() const
Definition: TGeoNode.h:102
void LocalToMasterBomb(const Double_t *local, Double_t *master) const
Local point converted to master frame defined by current matrix and rescaled with bomb factor...
Definition: TGeoCache.cxx:443