LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
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 61 of file ROOTGeometryNavigator.h.
|
inline |
Constructor: picks the manager.
Definition at line 67 of file ROOTGeometryNavigator.h.
References apply().
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 121 of file ROOTGeometryNavigator.h.
References geo::GeoNodePath::append(), geo::GeoNodePath::current(), and geo::GeoNodePath::pop().
Referenced by evgen::RadioGen::addvolume(), apply(), and ROOTGeometryNavigator().
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 144 of file ROOTGeometryNavigator.h.
References apply().
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 152 of file ROOTGeometryNavigator.h.
|
private |
Definition at line 63 of file ROOTGeometryNavigator.h.
Referenced by apply().