gparticle
Loading...
Searching...
No Matches
GParticleLundReader Class Reference

Built-in reader for Lund generated-particle files. More...

#include <gparticle_lund_reader.h>

Public Member Functions

std::vector< GparticlePtrloadParticles (const GParticleSourceDefinition &source, const std::shared_ptr< GLogger > &logger) override
 Loads all propagated Lund particles as one flattened list.
 
GParticleEvents loadParticleEvents (const GParticleSourceDefinition &source, const std::shared_ptr< GLogger > &logger, bool propagated_only=true) override
 Loads Lund events as Geant4-shootable particles.
 
GParticleRecordEvents loadParticleRecordEvents (const GParticleSourceDefinition &source, const std::shared_ptr< GLogger > &logger) override
 Loads Lund events as generated-particle records.
 
 GParticleReader (const std::shared_ptr< GOptions > &gopts)
 Inherit the base reader constructor.
 
- Public Member Functions inherited from GParticleReader
 GParticleReader (const std::shared_ptr< GOptions > &gopts)
 Constructs a reader with the shared options container.
 
 ~GParticleReader () override=default
 Virtual destructor for plugin use through base pointers.
 
void set_loggers (const std::shared_ptr< GOptions > &gopts)
 Reader plugins currently share the base logger setup.
 
- Public Member Functions inherited from GBase< GParticleReader >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Static Public Member Functions inherited from GParticleReader
static GParticleReaderinstantiate (dlhandle h, std::shared_ptr< GOptions > gopts)
 Instantiates a dynamic reader plugin from a library handle.
 
- Protected Attributes inherited from GBase< GParticleReader >
std::shared_ptr< GLoggerlog
 

Detailed Description

The Lund reader produces both Geant4-shootable particles and output-bank records. The propagated GParticleEvents view keeps only rows with Lund type == 1 by default. The GParticleRecordEvents view preserves every parsed particle row, including non-propagated rows and ids not known to Geant4, so the event output can populate the generated bank.

Definition at line 15 of file gparticle_lund_reader.h.

Member Function Documentation

◆ GParticleReader()

GParticleReader::GParticleReader ( const std::shared_ptr< GOptions > & gopts)
explicit

Definition at line 146 of file gparticle_reader.cc.

◆ loadParticleEvents()

GParticleEvents GParticleLundReader::loadParticleEvents ( const GParticleSourceDefinition & source,
const std::shared_ptr< GLogger > & logger,
bool propagated_only = true )
overridevirtual
Parameters
sourceLund file source definition.
loggerLogger used for diagnostics.
propagated_onlyWhen true, include only Lund rows with type == 1.
Returns
Event-indexed propagated particles.

Reimplemented from GParticleReader.

Definition at line 185 of file gparticle_lund_reader.cc.

◆ loadParticleRecordEvents()

GParticleRecordEvents GParticleLundReader::loadParticleRecordEvents ( const GParticleSourceDefinition & source,
const std::shared_ptr< GLogger > & logger )
overridevirtual

This method preserves all parsed particle rows. Unknown particle ids are represented by their numeric id in the record name field.

Parameters
sourceLund file source definition.
loggerLogger used for diagnostics.
Returns
Event-indexed generated-particle records.

Reimplemented from GParticleReader.

Definition at line 278 of file gparticle_lund_reader.cc.

◆ loadParticles()

std::vector< GparticlePtr > GParticleLundReader::loadParticles ( const GParticleSourceDefinition & source,
const std::shared_ptr< GLogger > & logger )
overridevirtual
Parameters
sourceLund file source definition.
loggerLogger used for diagnostics.
Returns
Flattened vector of propagated Gparticle objects.

Implements GParticleReader.

Definition at line 267 of file gparticle_lund_reader.cc.


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