Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::EventReader Class Reference

Read a HepMC3 event record file and create primary particles. More...

#include <EventReader.hh>

Inheritance diagram for celeritas::EventReader:
Inheritance graph
[legend]

Public Types

Type aliases
using SPConstParticles = std::shared_ptr< ParticleParams const >
 
using result_type = std::vector< Primary >
 
- Public Types inherited from celeritas::EventReaderInterface
using VecPrimary = std::vector< Primary >
 
using result_type = VecPrimary
 

Public Member Functions

 EventReader (std::string const &filename, SPConstParticles particles)
 Construct from a filename.
 
 CELER_DELETE_COPY_MOVE (EventReader)
 Prevent copying and moving.
 
result_type operator() () final
 Read a single event from the event record. More...
 
size_type num_events () const final
 Get total number of events.
 

Additional Inherited Members

- Protected Member Functions inherited from celeritas::EventReaderInterface
 EventReaderInterface ()=default
 
 CELER_DEFAULT_COPY_MOVE (EventReaderInterface)
 

Detailed Description

Read a HepMC3 event record file and create primary particles.

Each operator() call returns a vector of primaries from a single event until all events have been read. Supported formats are Asciiv3, IO_GenEvent, HEPEVT, and LHEF.

Todo:
Define ImportPrimary with double precision.

Member Function Documentation

◆ operator()()

auto celeritas::EventReader::operator() ( )
inlinefinalvirtual

Read a single event from the event record.

Note
Units are converted manually from HepMC3 to Celeritas rather than using GenEvent::set_units(). This method converts the momentum units of all particles and the length units of all daughter vertices; however, it does not convert the length units of the root vertex. This means any particle without a vertex will not have the correct units for position and time. This may also be true for any vertices that do not have a position assigned, as their positions will be inherited from the vertices of their ancestors (or by falling back on the event position).

Implements celeritas::EventReaderInterface.


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