Executes an operation on all the nodes of the ROOT geometry. More...
#include <ROOTGeometryNavigator.h>
Public Member Functions | |
ROOTGeometryNavigator (TGeoManager const &manager) | |
Constructor: picks the manager. More... | |
template<typename Op > | |
bool | apply (geo::GeoNodePath &path, Op &&op) const |
Applies the specified operation to all nodes under the path . More... | |
template<typename Op > | |
bool | apply (TGeoNode const &node, Op &&op) const |
Applies the specified operation to all nodes under node . More... | |
template<typename Op > | |
bool | apply (Op &&op) const |
Applies the specified operation to all nodes. More... | |
Private Attributes | |
TGeoNode const * | fTopNode = nullptr |
Executes an operation on all the nodes of the ROOT geometry.
For example, to collect the path (see geo::GeoNodePath
) of all the volumes named "volTPC"
in the geometry loaded in LArSoft:
Definition at line 64 of file ROOTGeometryNavigator.h.
|
inline |
bool geo::ROOTGeometryNavigator::apply | ( | geo::GeoNodePath & | path, |
Op && | op | ||
) | const |
Applies the specified operation to all nodes under the path
.
Op | type of operation (see description) |
path | the path to the first node to operate on |
op | operation to be applied |
The operation Op
must be a callable accepting a geo::GeoNodePath
immutable argument and returning a value convertible to boolean. If a call to op
results into a false
value, the recursion is terminated and false
is returned. path
will be pointing to the last node already processed.
The node at the head of the path is processed first, then for each daughter node, first the daughter itself then its own daughters, recursively.
Definition at line 128 of file ROOTGeometryNavigator.h.
bool geo::ROOTGeometryNavigator::apply | ( | TGeoNode const & | node, |
Op && | op | ||
) | const |
Applies the specified operation to all nodes under node
.
Op | type of operation (see description) |
node | the node to start from |
op | operation to be applied |
The operation Op
must be a callable accepting a geo::GeoNodePath
immutable argument.
Definition at line 151 of file ROOTGeometryNavigator.h.
bool geo::ROOTGeometryNavigator::apply | ( | Op && | op | ) | const |
Applies the specified operation to all nodes.
Op | type of operation (see description) |
op | operation to be applied |
The operation Op
must be a callable accepting a geo::GeoNodePath
immutable argument.
Definition at line 159 of file ROOTGeometryNavigator.h.
|
private |
Definition at line 66 of file ROOTGeometryNavigator.h.