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