remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGParticleFilterScheme Class Reference

Filter-output scheme for particles. More...

#include <RMGParticleFilterScheme.hh>

Inheritance diagram for RMGParticleFilterScheme:
Collaboration diagram for RMGParticleFilterScheme:

Public Member Functions

std::optional< G4ClassificationOfNewTrack > StackingActionClassify (const G4Track *, int) override
 Wraps G4UserStackingAction::StackingActionClassify.
 
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.
 
void AddKillVolume (std::string name)
 Add a physical volume, by name, to the volumes in which the filter will be applied.
 
void AddKeepProcess (std::string name)
 Add a physics process by name. This will only keep the specified particles when they were created by this process, all other particles will not be kept.
 
void AddKillProcess (std::string name)
 Add a physics process by name. This will apply the filter only to particles created by this process.
 
- Public Member Functions inherited from RMGVOutputScheme
virtual void AssignOutputNames (G4AnalysisManager *)
 Initialize ntuple column names for this output scheme.
 
virtual void ClearBeforeEvent ()
 Clear any event-specific data.
 
virtual bool ShouldDiscardEvent (const G4Event *)
 Decide whether to discard the current event.
 
virtual bool StoreAlways () const
 Indicates whether the output scheme always stores event data.
 
virtual void StoreEvent (const G4Event *)
 Store the event data.
 
virtual std::optional< bool > StackingActionNewStage (const int)
 Hook for transitioning to a new stacking stage.
 
virtual void TrackingActionPre (const G4Track *)
 Hook called before tracking a new particle.
 
virtual void TrackingActionPost (const G4Track *)
 Hook called after tracking a new particle.
 
virtual void SteppingAction (const G4Step *)
 Hook called after each step.
 
virtual void EndOfRunAction (const G4Run *)
 Perform final actions at the end of a run.
 
void SetNtuplePerDetector (bool ntuple_per_det)
 Specify whether to create separate ntuples for each detector.
 
void SetNtupleUseVolumeName (bool use_vol_name)
 Specify whether to use the physical volume name for naming ntuples.
 
void SetEventIDOffset (int offset)
 

Additional Inherited Members

- Static Public Attributes inherited from RMGVOutputScheme
static std::string fUIDKeyFormatString = "det{:03}"
 
- Protected Member Functions inherited from RMGVOutputScheme
virtual std::string GetNtupleName (RMGDetectorMetadata det) const
 
virtual std::string GetNtupleNameFlat () const
 
void CreateNtupleFOrDColumn (G4AnalysisManager *ana_man, int nt, std::string name, bool use_float)
 
void FillNtupleFOrDColumn (G4AnalysisManager *ana_man, int nt, int col, double val, bool use_float)
 
int GetEventIDForStorage (const G4Event *evt) const
 
- Protected Attributes inherited from RMGVOutputScheme
bool fNtuplePerDetector = true
 
bool fNtupleUseVolumeName = false
 
int fEventIDOffset = 0
 

Detailed Description

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.

Member Function Documentation

◆ AddKeepProcess()

void RMGParticleFilterScheme::AddKeepProcess ( std::string name)

Add a physics process by name. This will only keep the specified particles when they were created by this process, all other particles will not be kept.

This means that specified particles that are not created by these processes will not be affected by the filter. It is therefore not possible to specify keep-processes and kill-processes at the same time.

◆ AddKeepVolume()

void RMGParticleFilterScheme::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.

◆ AddKillProcess()

void RMGParticleFilterScheme::AddKillProcess ( std::string name)

Add a physics process by name. This will apply the filter only to particles created by this process.

This means that specified particles that are not created by these processes will be filtered. It is therefore not possible to specify keep-processes and kill-processes at the same time.

◆ AddKillVolume()

void RMGParticleFilterScheme::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.

◆ StackingActionClassify()

std::optional< G4ClassificationOfNewTrack > RMGParticleFilterScheme::StackingActionClassify ( const G4Track * aTrack,
int  )
overridevirtual

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.

Reimplemented from RMGVOutputScheme.


The documentation for this class was generated from the following files: