162 const std::shared_ptr<GLogger>& logger) = 0;
179 const std::shared_ptr<GLogger>& logger,
180 bool propagated_only =
true);
194 const std::shared_ptr<GLogger>& logger);
197 void set_loggers([[maybe_unused]]
const std::shared_ptr<GOptions>& gopts) {
229 std::shared_ptr<GLogger>& logger);
240 std::shared_ptr<GLogger>& logger,
241 bool propagated_only =
true);
254 std::shared_ptr<GLogger>& logger);
Abstract base class for gparticle file readers.
~GParticleReader() override=default
Virtual destructor for plugin use through base pointers.
virtual GParticleRecordEvents loadParticleRecordEvents(const GParticleSourceDefinition &source, const std::shared_ptr< GLogger > &logger)
Loads file-backed events as output-bank records.
virtual GParticleEvents loadParticleEvents(const GParticleSourceDefinition &source, const std::shared_ptr< GLogger > &logger, bool propagated_only=true)
Loads file-backed events as Gparticle objects.
virtual std::vector< GparticlePtr > loadParticles(const GParticleSourceDefinition &source, const std::shared_ptr< GLogger > &logger)=0
Loads all propagated particles as one flattened list.
GParticleReader(const std::shared_ptr< GOptions > &gopts)
Constructs a reader with the shared options container.
void set_loggers(const std::shared_ptr< GOptions > &gopts)
Reader plugins currently share the base logger setup.
static GParticleReader * instantiate(dlhandle h, std::shared_ptr< GOptions > gopts)
Instantiates a dynamic reader plugin from a library handle.
Definition of the Gparticle class used by the gparticle module.
std::vector< GParticleEvent > GParticleEvents
Sequence of file-backed generated-particle events.
std::vector< GparticlePtr > GParticleEvent
Event-local list of Geant4-propagated generator particles.
std::vector< GParticleRecordEvent > GParticleRecordEvents
Sequence of generated-particle record events indexed by event number.
std::vector< GParticleRecord > GParticleRecordEvent
Event-local list of generated-particle records for output.
const std::vector< std::string > & supported_static_reader_formats()
Returns built-in file-reader format tokens.
std::vector< GparticlePtr > getGParticlesFromSources(const std::shared_ptr< GOptions > &gopts, std::shared_ptr< GLogger > &logger)
Loads 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.
GParticleEvents getGParticleEventsFromSources(const std::shared_ptr< GOptions > &gopts, std::shared_ptr< GLogger > &logger, bool propagated_only)
Loads event-indexed propagated particles from all configured file sources.
std::vector< GParticleSourceDefinition > getGParticleSourceDefinitions(const std::shared_ptr< GOptions > &gopts)
Parses all configured -gparticlefile entries.
Immutable generated-particle metadata used for output banks.
double phi
Azimuthal angle in GEMC internal angular units.
int type
Source generator type. Lund type == 1 means propagated in Geant4.
double p
Momentum magnitude in GEMC internal units.
double vy
Vertex y coordinate in GEMC internal length units.
int pid
PDG id or source particle id.
double vx
Vertex x coordinate in GEMC internal length units.
std::string name
Particle name when known, otherwise a source-format identifier such as the numeric pid.
double theta
Polar angle in GEMC internal angular units.
int multiplicity
Number of copies represented by this record.
double vz
Vertex z coordinate in GEMC internal length units.
One configured -gparticlefile source.
GParticleSourceDefinition()=default
Creates an empty source definition.
std::string gparticlePluginName() const
Returns the dynamic plugin name associated with this format.
std::string filename
Source filename.
GParticleSourceDefinition(std::string f, std::string n)
Creates a source definition from a format token and filename.
std::string format
Source format token, for example lund.