Celeritas
0.5.0-56+6b053cd
|
#include <unordered_set>
#include <vector>
#include <G4LogicalVolume.hh>
#include <G4VPhysicalVolume.hh>
#include "corecel/Assert.hh"
#include "corecel/cont/Range.hh"
Functions | |
template<class F > | |
void | celeritas::visit_geant_volume_instances (F &&visit, G4VPhysicalVolume const &world) |
Perform a depth-first traversal of physical volumes. More... | |
template<class F > | |
void | celeritas::visit_geant_volumes (F &&vis, G4VPhysicalVolume const &parent_vol) |
Perform a depth-first listing of Geant4 logical volumes. More... | |
void celeritas::visit_geant_volume_instances | ( | F && | visit, |
G4VPhysicalVolume const & | world | ||
) |
Perform a depth-first traversal of physical volumes.
The function must have the signature bool(*)(G4VPhysicalVolume const&, int)
where the return value indicates whether the volume's children should be visited, and the integer is the depth of the volume being visited.
By default this will visit the entire "touchable" hierachy: this may be very expensive! If it's desired to only visit single physical volumes, mark them as visited using a set.
void celeritas::visit_geant_volumes | ( | F && | vis, |
G4VPhysicalVolume const & | parent_vol | ||
) |
Perform a depth-first listing of Geant4 logical volumes.
This will visit each volume exactly once based on when it's encountered in the hierarchy. The visitor function F should have the signature
.