3#include "Framework/Exception/Exception.h"
11 EXCEPTION_RAISE(
"NullEvent",
12 "Attempted to create HepMCEvent with null GenEvent");
17 std::shared_ptr<HepMC3::GenVertex> vertex;
20 if (
event_->vertices().size() > 0) {
21 vertex = event_->vertices()[0];
26 const HepMC3::FourVector& pos = vertex->position();
52 const std::vector<double>& weights =
event_->weights();
53 return weights.empty() ? 1.0 : weights[0];
76 for (
const auto& particle :
event_->particles()) {
84 if (particle->status() == 1) {
85 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 ...