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