A geometry iterator.
A geometry iterator that sequentially follows all nodes of the geometrical hierarchy of a volume. The iterator has to be initiated with a top volume pointer:
One can use the iterator as any other in ROOT:
while ((node=next())) {
...
}
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
The iterator can perform 2 types of iterations that can be selected via:
Here TYPE can be:
- 0 (default) - 'first daughter next' behavior
- 1 - iteration at the current level only
Supposing the tree structure looks like:
TOP ___ A_1 ___ A1_1 ___ A11_1
| | |___ A12_1
| |_____A2_1 ___ A21_1
| |___ A21_2
|___ B_1 ...
The order of iteration for TYPE=0 is: A_1, A1_1, A11_1, A12_1, A2_1, A21_1, A21_2, B_1, ...
The order of iteration for TYPE=1 is: A_1, B_1, ... At any moment during iteration, TYPE can be changed. If the last iterated node is for instance A1_1 and the iteration type was 0, one can do:
The next iterated nodes will be the rest of A daughters: A2,A3,... The iterator will return 0 after finishing all daughters of A.
During iteration, the following can be retrieved:
The iterator can be reset by changing (or not) the top volume:
void Reset(TGeoVolume *top=0)
Resets the iterator for volume TOP.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Example:
We want to find out a volume named "MyVol" in the hierarchy of TOP volume.
while ((node=next()))
TGeoVolume * GetVolume() const
virtual const char * GetName() const
Returns name of object.
Definition at line 243 of file TGeoNode.h.