Celeritas  0.5.0-56+6b053cd
Functions
VisitGeantVolumes.hh File Reference
#include <unordered_set>
#include <vector>
#include <G4LogicalVolume.hh>
#include <G4VPhysicalVolume.hh>
#include "corecel/Assert.hh"
#include "corecel/cont/Range.hh"
This graph shows which files directly or indirectly include this file:

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...
 

Function Documentation

◆ visit_geant_volume_instances()

template<class F >
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.

◆ visit_geant_volumes()

template<class F >
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

void(*)(G4LogicalVolume const&)

.