Abstract base class for gparticle file readers.
More...
#include <gparticle_reader.h>
Reader plugins translate file-backed generator input into two related views:
- GParticleEvents for particles that are propagated to Geant4.
- GParticleRecordEvents for generated-particle output banks, including particles that cannot or should not be propagated.
Built-in and dynamic readers share the same factory contract through GBase and instantiate().
Definition at line 138 of file gparticle_reader.h.
◆ GParticleReader()
| GParticleReader::GParticleReader |
( |
const std::shared_ptr< GOptions > & | gopts | ) |
|
|
explicit |
- Parameters
-
| gopts | Parsed options used by base logging and derived readers. |
Definition at line 14 of file gparticle_reader.cc.
◆ ~GParticleReader()
| GParticleReader::~GParticleReader |
( |
| ) |
|
|
overridedefault |
◆ instantiate()
The plugin must export GParticleReaderFactory.
- Parameters
-
| h | Dynamic library handle. |
| gopts | Parsed options passed to the plugin factory. |
- Returns
- Newly allocated reader instance owned by the caller.
Definition at line 53 of file gparticle_reader.cc.
◆ loadParticleEvents()
Readers should return only rows that can be represented as Gparticle objects and shot by Geant4 when propagated_only is true. Formats that carry a source type field may include additional rows when propagated_only is false, provided those rows are still valid Geant4 particles.
- Parameters
-
| source | Source definition to read. |
| logger | Logger used for diagnostics. |
| propagated_only | Whether to restrict the result to particles propagated in Geant4. |
- Returns
- File-backed generated events as Geant4-shootable particles.
Reimplemented in GParticleLundReader.
Definition at line 17 of file gparticle_reader.cc.
◆ loadParticleRecordEvents()
This view preserves all generator rows that can be parsed from the source file, including rows that are not propagated in Geant4 and rows whose ids are not known to G4ParticleTable.
- Parameters
-
| source | Source definition to read. |
| logger | Logger used for diagnostics. |
- Returns
- File-backed generated events as serialization records.
Reimplemented in GParticleLundReader.
Definition at line 26 of file gparticle_reader.cc.
◆ loadParticles()
This legacy view is equivalent to flattening loadParticleEvents() with the default propagated-only behavior.
- Parameters
-
| source | Source definition to read. |
| logger | Logger used for diagnostics. |
- Returns
- Vector of Geant4-propagated particles.
Implemented in GParticleLundReader.
◆ set_loggers()
| void GParticleReader::set_loggers |
( |
const std::shared_ptr< GOptions > & | gopts | ) |
|
|
inline |
The documentation for this class was generated from the following files: