gparticle
Loading...
Searching...
No Matches
gparticle Namespace Reference

Functions

vector< GparticlePtrgetGParticlesFromOption (const std::shared_ptr< GOptions > &gopts, std::shared_ptr< GLogger > &logger)
 Builds inline generator particles from only the -gparticle option.
vector< GparticlePtrgetGParticles (const std::shared_ptr< GOptions > &gopts, std::shared_ptr< GLogger > &logger)
 Builds the list of generator particles from structured options.
GOptions defineOptions ()
 Defines the structured options used by the gparticle module.
const std::vector< std::string > & supported_static_reader_formats ()
 Returns built-in file-reader format tokens.
std::vector< GParticleSourceDefinitiongetGParticleSourceDefinitions (const std::shared_ptr< GOptions > &gopts)
 Parses all configured -gparticlefile entries.
std::vector< GparticlePtrgetGParticlesFromSources (const std::shared_ptr< GOptions > &gopts, std::shared_ptr< GLogger > &logger)
 Loads propagated particles from all configured file sources.
GParticleEvents getGParticleEventsFromSources (const std::shared_ptr< GOptions > &gopts, std::shared_ptr< GLogger > &logger, bool propagated_only=true)
 Loads event-indexed propagated particles from all configured file sources.
GParticleRecordEvents getGParticleRecordEventsFromSources (const std::shared_ptr< GOptions > &gopts, std::shared_ptr< GLogger > &logger)
 Loads event-indexed generated-particle records from all configured file sources.

Variables

Error codes

Error codes emitted by gparticle through GLogger.

Values are in the 900s to reduce collision with other modules.

constexpr int ERR_GPARTICLENOTFOUND = 901
 Requested particle name was not found in the G4ParticleTable.
constexpr int ERR_GPARTICLEWRONGTHETAMODEL = 902
 Theta randomization model was not recognized or not supported.
constexpr int ERR_GPARTICLETABLENOTFOUND = 903
 G4ParticleTable could not be obtained (unexpected runtime state).
constexpr int ERR_GPARTICLEREADERNOTFOUND = 904
 Particle reader factory could not be found or instantiated.
constexpr int ERR_GPARTICLEFILEOPEN = 905
 Particle input file could not be opened.
constexpr int ERR_GPARTICLEFILEFORMAT = 906
 Particle input file contained malformed or unsupported data.

Function Documentation

◆ getGParticleEventsFromSources()

GParticleEvents gparticle::getGParticleEventsFromSources ( const std::shared_ptr< GOptions > & gopts,
std::shared_ptr< GLogger > & logger,
bool propagated_only = true )
Parameters
goptsParsed options.
loggerLogger used for diagnostics.
propagated_onlyWhether to restrict file rows to Geant4-propagated particles.
Returns
Event-indexed generated particles.

Definition at line 99 of file gparticle_reader.cc.

◆ getGParticleRecordEventsFromSources()

GParticleRecordEvents gparticle::getGParticleRecordEventsFromSources ( const std::shared_ptr< GOptions > & gopts,
std::shared_ptr< GLogger > & logger )

This is the data source for the generated output bank. It preserves every parsed file particle, including particles that are not propagated in Geant4.

Parameters
goptsParsed options.
loggerLogger used for diagnostics.
Returns
Event-indexed generated-particle records.

Definition at line 137 of file gparticle_reader.cc.

◆ getGParticlesFromSources()

std::vector< GparticlePtr > gparticle::getGParticlesFromSources ( const std::shared_ptr< GOptions > & gopts,
std::shared_ptr< GLogger > & logger )
Parameters
goptsParsed options.
loggerLogger used for diagnostics.
Returns
Flattened vector of Geant4-propagated particles.

Definition at line 90 of file gparticle_reader.cc.

◆ getGParticleSourceDefinitions()

std::vector< GParticleSourceDefinition > gparticle::getGParticleSourceDefinitions ( const std::shared_ptr< GOptions > & gopts)
Parameters
goptsParsed options containing the optional gparticlefile node.
Returns
Source definitions in configuration order.

Definition at line 71 of file gparticle_reader.cc.

◆ supported_static_reader_formats()

const std::vector< std::string > & gparticle::supported_static_reader_formats ( )
Returns
Static list of built-in reader formats.

Definition at line 66 of file gparticle_reader.cc.

Variable Documentation

◆ ERR_GPARTICLEFILEFORMAT

int gparticle::ERR_GPARTICLEFILEFORMAT = 906
inlineconstexpr

Definition at line 49 of file gparticleConventions.h.

◆ ERR_GPARTICLEFILEOPEN

int gparticle::ERR_GPARTICLEFILEOPEN = 905
inlineconstexpr

Definition at line 46 of file gparticleConventions.h.

◆ ERR_GPARTICLENOTFOUND

int gparticle::ERR_GPARTICLENOTFOUND = 901
inlineconstexpr

Definition at line 34 of file gparticleConventions.h.

◆ ERR_GPARTICLEREADERNOTFOUND

int gparticle::ERR_GPARTICLEREADERNOTFOUND = 904
inlineconstexpr

Definition at line 43 of file gparticleConventions.h.

◆ ERR_GPARTICLETABLENOTFOUND

int gparticle::ERR_GPARTICLETABLENOTFOUND = 903
inlineconstexpr

Definition at line 40 of file gparticleConventions.h.

◆ ERR_GPARTICLEWRONGTHETAMODEL

int gparticle::ERR_GPARTICLEWRONGTHETAMODEL = 902
inlineconstexpr

Definition at line 37 of file gparticleConventions.h.