9 EXCEPTION_RAISE(
"NullEvent",
10 "Attempted to create HepMCEvent with null GenEvent");
15 std::shared_ptr<HepMC3::GenVertex> vertex;
18 if (
event_->vertices().size() > 0) {
19 vertex = event_->vertices()[0];
24 const HepMC3::FourVector& pos = vertex->position();
50 const std::vector<double>& weights =
event_->weights();
51 return weights.empty() ? 1.0 : weights[0];
74 for (
const auto& particle :
event_->particles()) {
82 if (particle->status() == 1) {
83 particles_.push_back(std::make_unique<HepMCParticle>(particle));
Class defining a HepMC event with a list of particles.
double vtxt_
Vertex time (in ns)
const std::vector< std::unique_ptr< HepMCParticle > > & getParticles() const
Get the list of final state particles in the event.
bool particles_extracted_
Flag to indicate if particles have been extracted.
const double * getVertex() const
Get the vertex location (in mm, as expected by Geant4).
HepMCEvent(std::shared_ptr< HepMC3::GenEvent > event)
Class constructor.
void extractParticles() const
Extract final state particles from the HepMC event.
double getEventWeight() const
Get the event weight.
double vtx_[3]
Vertex location (in mm)
double getVertexTime() const
Get the vertex time (in ns, as expected by Geant4).
std::vector< std::unique_ptr< HepMCParticle > > particles_
The list of final state particles to be tracked.
std::shared_ptr< HepMC3::GenEvent > getGenEvent() const
Get the underlying HepMC3 GenEvent.
int getNumParticles() const
Get the number of particles in the event.
std::shared_ptr< HepMC3::GenEvent > event_
The underlying HepMC3 GenEvent.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...