Class RMGOpWLSProcess

Inheritance Relationships

Base Type

  • public G4WrapperProcess

Class Documentation

class RMGOpWLSProcess : public G4WrapperProcess

A wrapper for the Geant4 optical wavelength shifting (WLS) process.

This class extends G4WrapperProcess to customize the behavior of the standard G4OpWLS process. It uses a material property RMG_WLSMEANNUMBERPHOTONS to control the mean number of emitted photons and prevents the default Poissonian sampling by replacing the original WLSMEANNUMBERPHOTONS property.

Public Functions

explicit RMGOpWLSProcess(const G4String &aNamePrefix = "RMG", G4ProcessType aType = fOptical)

Constructs a new RMG Optical WLS process.

Parameters:
  • aNamePrefix – Prefix for naming the process (default “RMG”).

  • aType – Process type (default fOptical).

virtual ~RMGOpWLSProcess() = default

Virtual destructor.

G4VParticleChange *PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override

Applies the custom optical WLS process in the post-step of a track.

This method overrides PostStepDoIt() of G4WrapperProcess. It first calls the registered process’s PostStepDoIt() to obtain the default particle change. If the returned result indicates that no secondary photon has been produced and the track is stopped, the result is returned unchanged. Otherwise, the method samples a random number compared to the material property RMG_WLSMEANNUMBERPHOTONS and, if the random value exceeds this mean, it kills the secondary photon by proposing a kill status. Finally, the modified particle change is returned.

Parameters:
  • aTrack – The current track.

  • aStep – The current step.

Returns:

Pointer to the modified particle change.

void BuildPhysicsTable(const G4ParticleDefinition &aParticleType) override

Builds the physics table for the WLS process.

This method overrides BuildPhysicsTable() to customize the handling of the mean number of emitted photons. After invoking the registered process’s BuildPhysicsTable(), it iterates through the global material table. For each material possessing the property WLSMEANNUMBERPHOTONS, it replaces it with RMG_WLSMEANNUMBERPHOTONS to disable the default Poissonian sampling. If a mean emission number greater than 1 is found, a warning is issued and that material is skipped.

Parameters:

aParticleType – The particle definition for which the physics table is built.