Class RMGParticleFilterOutputScheme

Inheritance Relationships

Base Type

Class Documentation

class RMGParticleFilterOutputScheme : public RMGVOutputScheme

Filter-output scheme for particles.

This optional output scheme filters out all particles specified via their PDG code. Optionally, it can apply this filter to a specified volume or ignore a specified volume. Properties need to be specified per macro.

Does nothing if the output scheme is not enabled per macro before run initialization. Also does nothing if no particle is specified. If no volume is specified the filter is applied to all volumes.

Public Functions

RMGParticleFilterOutputScheme()
virtual std::optional<G4ClassificationOfNewTrack> StackingActionClassify(const G4Track*, int) override

Wraps G4UserStackingAction::StackingActionClassify.

This is used to classify all specified particles as fKill if they are in the specified volumes (or no volume is specified).

If the primary particle is filtered out here, the simulation crashes. To avoid the crash, the particle will be simulated anyways and a warning message will be shown.

inline void AddParticle(int pdg)

Add a particle, identified by its PDG code, to the list of particles to kill.

void AddKeepVolume(std::string name)

Add a physical volume, by name, to the volumes in which the filter will not be applied.

This means that specified particles outside of the specified keep-volumes will be filtered. It is therefore not possible to specify keep-volumes and kill-volumes in the same geometry.

void AddKillVolume(std::string name)

Add a physical volume, by name, to the volumes in which the filter will be applied.

This means that specified particles outside of the specified kill-volumes will not be affected by the filter. It is therefore not possible to specify keep-volumes and kill-volumes in the same geometry.