21 #include "G4PrimaryParticle.hh"
27 using namespace DD4hep;
28 using namespace DD4hep::Simulation;
75 Geant4PrimaryInteraction::ParticleMap::iterator ip, ipend;
77 (*ip).second->mask =
mask;
79 Geant4PrimaryInteraction::VertexMap::iterator iv, ivend;
81 (*iv).second->mask =
mask;
97 interaction->
mask = id;
102 ::snprintf(text,
sizeof(text),
"Geant4PrimaryEvent: Interaction with ID '%d' "
103 "exists and cannot be added twice!",
id);
104 throw std::runtime_error(text);
106 throw std::runtime_error(
"Geant4PrimaryEvent: CANNOT add invalid Interaction!");
120 std::vector<Interaction*>
v;
122 v.push_back((*i).second);
VertexMap vertices
The map of primary vertices for the particles.
Geant4Particle * addRef()
Increase reference count.
int nextPID()
Access a new particle identifier within the interaction.
void setNextPID(int value)
Set the next PID value.
Data structure to store the MC particle information.
int next_particle_identifier
Next PID indentifier.
virtual ~Geant4PrimaryMap()
Default destructor.
Class modelling a single interaction with multiple primary vertices and particles.
Geant4PrimaryInteraction * get(int id) const
Retrieve an interaction by it's ID.
Interactions m_interactions
Set of primary interactions.
bool applyMask()
Apply mask to all contained vertices (max. 1) and particles.
ParticleMap particles
The map of particles participating in this primary interaction.
void destroyObjects(M &m)
void releaseObjects(M &m)
Geant4Particle * get(const G4PrimaryParticle *particle)
Access DDG4 particle by G4 primary particle.
Primaries m_primaryMap
Mapping of primary particles of this event.
virtual ~Geant4PrimaryEvent()
Default destructor.
std::vector< Geant4PrimaryInteraction * > interactions() const
Retrieve all interactions.
void insert(G4PrimaryParticle *g4_particle, Geant4Particle *particle)
Add a new object pair (G4 primary particle, DDG4 particle) into the maps.
int mask
User mask to flag the interaction. Also unique identifier.
void add(int id, Geant4PrimaryInteraction *interaction)
Add a new interaction object to the event.
virtual ~Geant4PrimaryInteraction()
Default destructor.
virtual ~PrimaryExtension()
Default destructor.