Celeritas 0.6.0-114+develop.74672520
Loading...
Searching...
No Matches
Classes | Functions
VisitVolumes.hh File Reference
#include <G4LogicalVolume.hh>
#include <G4VPhysicalVolume.hh>
#include "corecel/Assert.hh"
#include "corecel/cont/Range.hh"
#include "corecel/sys/ScopedProfiling.hh"
#include "geocel/VolumeVisitor.hh"
This graph shows which files directly or indirectly include this file:

Classes

class  celeritas::GeantVolumeAccessor
 

Functions

template<class Visitor >
void celeritas::visit_volume_instances (Visitor &&vis, G4VPhysicalVolume const *world)
 Perform a depth-first traversal of physical volumes.
 
template<class Visitor >
void celeritas::visit_volumes (Visitor &&vis, G4VPhysicalVolume const *world)
 Perform a depth-first traversal of Geant4 logical volumes.
 

Function Documentation

◆ visit_volume_instances()

template<class Visitor >
void celeritas::visit_volume_instances ( Visitor &&  vis,
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" hierarchy: this may be very expensive! If it's desired to only visit single physical volumes, mark them as visited using a set.

◆ visit_volumes()

template<class Visitor >
void celeritas::visit_volumes ( Visitor &&  vis,
G4VPhysicalVolume const world 
)

Perform a depth-first traversal of Geant4 logical volumes.

This will visit each volume exactly once based on when it's encountered in the hierarchy. The visitor function Visitor should have the signature

void(*)(G4LogicalVolume const*)

.