9 #include <simulation/kernel/EventAction.h>
10 #include <framework/datastore/RelationArray.h>
11 #include <mdst/dataobjects/MCParticleGraph.h>
12 #include <simulation/kernel/SensitiveDetectorBase.h>
18 using namespace Belle2::Simulation;
21 EventAction::EventAction(
const std::string& mcCollectionName,
MCParticleGraph& mcParticleGraph):
22 G4UserEventAction(), m_mcCollectionName(mcCollectionName), m_mcParticleGraph(mcParticleGraph)
52 vector<std::pair<unsigned int, bool> > indices;
63 for (std::map<std::string, RelationArray::EConsolidationAction>::const_iterator it = relations.begin(); it != relations.end();
Class to represent Particle data in graph.
int getTrackID() const
Returns the track ID assigned to this MCParticle.
bool getIgnore() const
Get the ignore flag.
Class to build, validate and sort a particle decay chain.
@ c_clearParticles
Clear the particle list before adding the graph.
size_t size() const
Return the number of particles in the graph.
void generateList(const std::string &name="", int options=c_setNothing)
Generates the MCParticle list and stores it in the StoreArray with the given name.
int getIndex() const
Get 1-based index of the particle in the corresponding MCParticle list.
Struct to replace indices based on a sequential container.
Low-level class to create/modify relations between StoreArrays.
void consolidate()
Consolidate Relation Elements.
std::string m_mcCollectionName
The name of the MCParticle collection to which the MCParticles should be written.
MCParticleGraph & m_mcParticleGraph
Reference to the MCParticle graph which is converted to a MCParticle list by this class.
virtual ~EventAction()
Destructor.
void EndOfEventAction(const G4Event *event)
This method is invoked at the very end of event processing.
void BeginOfEventAction(const G4Event *event)
This method is invoked before converting the primary particles to G4Track objects.
static void setActive(bool activeStatus)
Enable/Disable all Sensitive Detectors.
static const std::map< std::string, RelationArray::EConsolidationAction > & getMCParticleRelations()
Return a list of all registered Relations with MCParticles.
Abstract base class for different kinds of events.
Struct for identity transformation on indices.