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:
The iterator can perform 2 types of iterations that can be selected via:
Here TYPE can be:
Supposing the tree structure looks like:
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:
We want to find out a volume named "MyVol" in the hierarchy of TOP volume.
Definition at line 248 of file TGeoNode.h.
Public Member Functions | |
TGeoIterator (const TGeoIterator &iter) | |
Copy ctor. | |
TGeoIterator (TGeoVolume *top) | |
Geometry iterator for a branch starting with a TOP node. | |
virtual | ~TGeoIterator () |
Destructor. | |
const TGeoMatrix * | GetCurrentMatrix () const |
Returns global matrix for current node. | |
Int_t | GetIndex (Int_t i) const |
Int_t | GetLevel () const |
TGeoNode * | GetNode (Int_t level) const |
Returns current node at a given level. | |
void | GetPath (TString &path) const |
Returns the path for the current node. | |
TGeoVolume * | GetTopVolume () const |
Int_t | GetType () const |
TGeoIteratorPlugin * | GetUserPlugin () const |
virtual TClass * | IsA () const |
TGeoNode * | Next () |
Returns next node. | |
TGeoNode * | operator() () |
Returns next node. | |
TGeoIterator & | operator= (const TGeoIterator &iter) |
Assignment. | |
void | Reset (TGeoVolume *top=nullptr) |
Resets the iterator for volume TOP. | |
void | SetPluginAutoexec (Bool_t mode) |
void | SetTopName (const char *name) |
Set the top name for path. | |
void | SetType (Int_t type) |
void | SetUserPlugin (TGeoIteratorPlugin *plugin) |
Set a plugin. | |
void | Skip () |
Stop iterating the current branch. | |
virtual void | Streamer (TBuffer &) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
void | Up () |
Static Public Member Functions | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Protected Member Functions | |
TGeoIterator () | |
Private Member Functions | |
void | IncreaseArray () |
Increase by 30 the size of the array. | |
Private Attributes | |
Int_t * | fArray = nullptr |
Int_t | fLevel = 0 |
TGeoHMatrix * | fMatrix = nullptr |
Bool_t | fMustResume = kFALSE |
Bool_t | fMustStop = kFALSE |
TGeoIteratorPlugin * | fPlugin = nullptr |
Bool_t | fPluginAutoexec = kFALSE |
TGeoVolume * | fTop = nullptr |
TString | fTopName |
Int_t | fType = 0 |
#include <TGeoNode.h>
|
inlineprotected |
Definition at line 264 of file TGeoNode.h.
TGeoIterator::TGeoIterator | ( | TGeoVolume * | top | ) |
Geometry iterator for a branch starting with a TOP node.
Definition at line 989 of file TGeoNode.cxx.
TGeoIterator::TGeoIterator | ( | const TGeoIterator & | iter | ) |
Copy ctor.
Definition at line 1006 of file TGeoNode.cxx.
|
virtual |
Destructor.
Definition at line 1026 of file TGeoNode.cxx.
|
static |
|
inlinestaticconstexpr |
Definition at line 308 of file TGeoNode.h.
|
inlinestatic |
Definition at line 308 of file TGeoNode.h.
const TGeoMatrix * TGeoIterator::GetCurrentMatrix | ( | ) | const |
Returns global matrix for current node.
Definition at line 1161 of file TGeoNode.cxx.
Definition at line 293 of file TGeoNode.h.
|
inline |
Definition at line 294 of file TGeoNode.h.
Returns current node at a given level.
Definition at line 1178 of file TGeoNode.cxx.
void TGeoIterator::GetPath | ( | TString & | path | ) | const |
Returns the path for the current node.
Definition at line 1191 of file TGeoNode.cxx.
|
inline |
Definition at line 299 of file TGeoNode.h.
|
inline |
Definition at line 300 of file TGeoNode.h.
|
inline |
Definition at line 297 of file TGeoNode.h.
|
private |
Increase by 30 the size of the array.
Definition at line 1209 of file TGeoNode.cxx.
|
inlinevirtual |
Definition at line 308 of file TGeoNode.h.
TGeoNode * TGeoIterator::Next | ( | ) |
Returns next node.
Definition at line 1063 of file TGeoNode.cxx.
TGeoNode * TGeoIterator::operator() | ( | ) |
Returns next node.
Definition at line 1153 of file TGeoNode.cxx.
TGeoIterator & TGeoIterator::operator= | ( | const TGeoIterator & | iter | ) |
Assignment.
Definition at line 1036 of file TGeoNode.cxx.
void TGeoIterator::Reset | ( | TGeoVolume * | top = nullptr | ) |
Resets the iterator for volume TOP.
Definition at line 1220 of file TGeoNode.cxx.
|
inline |
Definition at line 303 of file TGeoNode.h.
void TGeoIterator::SetTopName | ( | const char * | name | ) |
Set the top name for path.
Definition at line 1232 of file TGeoNode.cxx.
|
inline |
Definition at line 304 of file TGeoNode.h.
void TGeoIterator::SetUserPlugin | ( | TGeoIteratorPlugin * | plugin | ) |
Set a plugin.
Definition at line 1280 of file TGeoNode.cxx.
void TGeoIterator::Skip | ( | ) |
Stop iterating the current branch.
The iteration of the next node will behave as if the branch starting from the current node (included) is not existing.
Definition at line 1241 of file TGeoNode.cxx.
|
virtual |
|
inline |
Definition at line 308 of file TGeoNode.h.
|
inline |
Definition at line 286 of file TGeoNode.h.
|
private |
Definition at line 255 of file TGeoNode.h.
|
private |
Definition at line 253 of file TGeoNode.h.
|
private |
Definition at line 256 of file TGeoNode.h.
Definition at line 251 of file TGeoNode.h.
Definition at line 252 of file TGeoNode.h.
|
private |
Definition at line 258 of file TGeoNode.h.
Definition at line 259 of file TGeoNode.h.
|
private |
Definition at line 250 of file TGeoNode.h.
|
private |
Definition at line 257 of file TGeoNode.h.
|
private |
Definition at line 254 of file TGeoNode.h.