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