ROOT logo
ROOT » GEOM » GEOM » TGeoIterator

class TGeoIterator

 TGeoNode

   A node represent a volume positioned inside another.They store links to both
 volumes and to the TGeoMatrix representing the relative positioning. Node are
 never instanciated directly by users, but created as a result of volume operations.
 Adding a volume named A with a given user ID inside a volume B will create a node
 node named A_ID. This will be added to the list of nodes stored by B. Also,
 when applying a division operation in N slices to a volume A, a list of nodes
 B_1, B_2, ..., B_N is also created. A node B_i does not represent a unique
 object in the geometry because its container A might be at its turn positioned
 as node inside several other volumes. Only when a complete branch of nodes
 is fully defined up to the top node in the geometry, a given path like:
       /TOP_1/.../A_3/B_7 will represent an unique object. Its global transformation
 matrix can be computed as the pile-up of all local transformations in its
 branch. We will therefore call "logical graph" the hierarchy defined by nodes
 and volumes. The expansion of the logical graph by all possible paths defines
 a tree sructure where all nodes are unique "touchable" objects. We will call
 this the "physical tree". Unlike the logical graph, the physical tree can
 become a huge structure with several milions of nodes in case of complex
 geometries, therefore it is not always a good idea to keep it transient
 in memory. Since a the logical and physical structures are correlated, the
 modeller rather keeps track only of the current branch, updating the current
 global matrix at each change of the level in geometry. The current physical node
 is not an object that can be asked for at a given moment, but rather represented
 by the combination: current node + current global matrix. However, physical nodes
 have unique ID's that can be retreived for a given modeler state. These can be
 fed back to the modeler in order to force a physical node to become current.
 The advantage of this comes from the fact that all navigation queries check
 first the current node, therefore knowing the location of a point in the
 geometry can be saved as a starting state for later use.

   Nodes can be declared as "overlapping" in case they do overlap with other
 nodes inside the same container or extrude this container. Non-overlapping
 nodes can be created with:

      TGeoVolume::AddNode(TGeoVolume *daughter, Int_t copy_No, TGeoMatrix *matr);

 The creation of overapping nodes can be done with a similar prototype:

      TGeoVolume::AddNodeOverlap(same arguments);

 When closing the geometry, overlapping nodes perform a check of possible
 overlaps with their neighbours. These are stored and checked all the time
 during navigation, therefore navigation is slower when embedding such nodes
 into geometry.

   Node have visualization attributes as volume have. When undefined by users,
 painting a node on a pad will take the corresponding volume attributes.


/* */

Function Members (Methods)

public:
TGeoIterator(TGeoVolume* top)
TGeoIterator(const TGeoIterator& iter)
virtual~TGeoIterator()
static TClass*Class()
const TGeoMatrix*GetCurrentMatrix() const
Int_tGetIndex(Int_t i) const
Int_tGetLevel() const
TGeoNode*GetNode(Int_t level) const
voidGetPath(TString& path) const
TGeoVolume*GetTopVolume() const
Int_tGetType() const
TGeoIteratorPlugin*GetUserPlugin() const
virtual TClass*IsA() const
TGeoNode*Next()
TGeoNode*operator()()
TGeoIterator&operator=(const TGeoIterator& iter)
voidReset(TGeoVolume* top = 0)
voidSetPluginAutoexec(Bool_t mode)
voidSetTopName(const char* name)
voidSetType(Int_t type)
voidSetUserPlugin(TGeoIteratorPlugin* plugin)
virtual voidShowMembers(TMemberInspector& insp)
voidSkip()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
protected:
TGeoIterator()
private:
voidIncreaseArray()

Data Members

private:
Int_t*fArrayArray of node indices for the current path
Int_tfLevelCurrent level in the tree
TGeoHMatrix*fMatrixCurrent global matrix
Bool_tfMustResumePrivate flag to resume from current node.
Bool_tfMustStopPrivate flag to signal that the iterator has finished.
TGeoIteratorPlugin*fPluginUser iterator plugin
Bool_tfPluginAutoexecPlugin automatically executed during next()
TGeoVolume*fTopTop volume of the iterated branch
TStringfTopNameUser name for top
Int_tfTypeType of iteration

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TGeoIterator(TGeoVolume* top)
 Geometry iterator for a branch starting with a TOP node.
TGeoIterator(const TGeoIterator& iter)
 Copy ctor.
~TGeoIterator()
 Destructor.
TGeoIterator & operator=(const TGeoIterator& iter)
 Assignment.
TGeoNode * Next()
 Returns next node.
TGeoNode * operator()()
 Returns next node.
const TGeoMatrix * GetCurrentMatrix() const
 Returns global matrix for current node.
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.
void IncreaseArray()
 Increase by 30 the size of the array.
void Reset(TGeoVolume* top = 0)
 Resets the iterator for volume TOP.
void SetTopName(const char* name)
 Set the top name for path
void 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.
void SetUserPlugin(TGeoIteratorPlugin* plugin)
 Set a plugin.
Int_t GetIndex()
{return 0;}
TGeoIterator()
{ }
Int_t GetLevel() const
{return fLevel;}
* GetUserPlugin() const
{return fPlugin;}
TGeoVolume * GetTopVolume() const
{return fTop;}
Int_t GetType() const
{return fType;}
void SetPluginAutoexec(Bool_t mode)
{fPluginAutoexec = mode;}
void SetType(Int_t type)
{fType = type;}