13 #ifndef ROOT_TGeoCache
14 #define ROOT_TGeoCache
24 class TGeoCacheState :
public TObject
35 TGeoNode **fNodeBranch;
36 TGeoHMatrix **fMatrixBranch;
37 TGeoHMatrix **fMatPtr;
39 TGeoCacheState(
const TGeoCacheState&);
40 TGeoCacheState& operator=(
const TGeoCacheState&);
44 TGeoCacheState(Int_t capacity);
45 virtual ~TGeoCacheState();
47 void SetState(Int_t level, Int_t startlevel, Int_t nmany, Bool_t ovlp, Double_t *point=0);
48 Bool_t GetState(Int_t &level, Int_t &nmany, Double_t *point)
const;
50 ClassDef(TGeoCacheState, 0)
53 class TGeoNodeCache :
public TObject
56 Int_t fGeoCacheMaxLevels;
57 Int_t fGeoCacheStackSize;
58 Int_t fGeoInfoStackSize;
70 TGeoHMatrix **fMatrixBranch;
72 TGeoNode **fNodeBranch;
73 TGeoStateInfo **fInfoBranch;
74 TGeoStateInfo *fPWInfo;
77 TGeoNodeCache(
const TGeoNodeCache&);
78 TGeoNodeCache& operator=(
const TGeoNodeCache&);
82 TGeoNodeCache(TGeoNode *top, Bool_t nodeid=kFALSE, Int_t capacity=30);
83 virtual ~TGeoNodeCache();
86 void BuildInfoBranch();
87 void CdNode(Int_t nodeid);
88 Bool_t CdDown(Int_t index);
89 Bool_t CdDown(TGeoNode *node);
90 void CdTop() {fLevel=1; CdUp();}
92 void FillIdBranch(
const Int_t *br, Int_t startlevel=0) {memcpy(fIdBranch+startlevel,br,(fLevel+1-startlevel)*
sizeof(Int_t)); fIndex=fIdBranch[fLevel];}
93 const Int_t *GetIdBranch()
const {
return fIdBranch;}
94 void *GetBranch()
const {
return fNodeBranch;}
95 void GetBranchNames(Int_t *names)
const;
96 void GetBranchNumbers(Int_t *copyNumbers, Int_t *volumeNumbers)
const;
97 void GetBranchOnlys(Int_t *isonly)
const;
98 void *GetMatrices()
const {
return fMatrixBranch;}
99 TGeoHMatrix *GetCurrentMatrix()
const {
return fMatrix;}
100 Int_t GetCurrentNodeId()
const;
101 TGeoNode *GetMother(Int_t up=1)
const {
return ((fLevel-up)>=0)?fNodeBranch[fLevel-up]:0;}
102 TGeoHMatrix *GetMotherMatrix(Int_t up=1)
const {
return ((fLevel-up)>=0)?fMatrixBranch[fLevel-up]:0;}
103 TGeoNode *GetNode()
const {
return fNode;}
104 TGeoNode *GetTopNode()
const {
return fTop;}
105 TGeoStateInfo *GetInfo();
106 TGeoStateInfo *GetMakePWInfo(Int_t nd);
108 Int_t GetLevel()
const {
return fLevel;}
109 const char *GetPath();
110 Int_t GetStackLevel()
const {
return fStackLevel;}
111 Int_t GetNodeId()
const;
112 Bool_t HasIdArray()
const {
return (fNodeIdArray)?kTRUE:kFALSE;}
113 Bool_t IsDummy()
const {
return kTRUE;}
115 void LocalToMaster(
const Double_t *local, Double_t *master)
const;
116 void MasterToLocal(
const Double_t *master, Double_t *local)
const;
117 void LocalToMasterVect(
const Double_t *local, Double_t *master)
const;
118 void MasterToLocalVect(
const Double_t *master, Double_t *local)
const;
119 void LocalToMasterBomb(
const Double_t *local, Double_t *master)
const;
120 void MasterToLocalBomb(
const Double_t *master, Double_t *local)
const;
121 Int_t PushState(Bool_t ovlp, Int_t ntmany=0, Int_t startlevel=0, Double_t *point=0);
122 Bool_t PopState(Int_t &nmany, Double_t *point=0);
123 Bool_t PopState(Int_t &nmany, Int_t level, Double_t *point=0);
124 void PopDummy(Int_t ipop=9999) {fStackLevel=(ipop>fStackLevel)?(fStackLevel-1):(ipop-1);}
125 void Refresh() {fNode=fNodeBranch[fLevel]; fMatrix=fMatrixBranch[fLevel];}
126 Bool_t RestoreState(Int_t &nmany, TGeoCacheState *state, Double_t *point=0);
128 ClassDef(TGeoNodeCache, 0)