2#ifndef SIMCORE_USERACTION_H
3#define SIMCORE_USERACTION_H
16#include "G4EventManager.hh"
17#include "G4UserStackingAction.hh"
22#include "Framework/Configure/Parameters.h"
23#include "SimCore/Event/SimParticle.h"
24#include "SimCore/Factory.h"
25#include "SimCore/UserEventInformation.h"
36enum TYPE { RUN = 1, EVENT, TRACKING, STEPPING, STACKING, NONE };
132 const G4Track*,
const G4ClassificationOfNewTrack& cl) {
190#define DECLARE_ACTION(NS, CLASS) \
192 auto v##CLASS = ::simcore::UserAction::Factory::get().declare<NS::CLASS>(); \
Class encapsulating parameters for configuring a processor.
Factory to dynamically create objects derived from a specific prototype class.
Interface that defines a user action.
virtual void stepping(const G4Step *)
Method called after each simulation step.
virtual void PrepareNewEvent()
Method called at the beginning of a new event.
virtual void BeginOfEventAction(const G4Event *)
Method called at the beginning of every event.
virtual void EndOfRunAction(const G4Run *)
Method called at the end of a run.
virtual ~UserAction()=default
Destructor.
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *, const G4ClassificationOfNewTrack &cl)
Method called when a track is updated.
virtual void PreUserTrackingAction(const G4Track *)
Method called before the UserTrackingAction.
virtual void BeginOfRunAction(const G4Run *)
Method called at the beginning of a run.
const std::map< int, ldmx::SimParticle > & getCurrentParticleMap() const
Get the current particle map.
virtual void EndOfEventAction(const G4Event *)
Method called at the end of every event.
virtual std::vector< TYPE > getTypes()=0
UserEventInformation * getEventInfo() const
Get a handle to the event information.
virtual void NewStage()
Method called at the beginning of a new stage.
virtual void PostUserTrackingAction(const G4Track *)
Method called after the UserTrackingAction.
std::string name_
Name of the UserAction.
framework::config::Parameters parameters_
The set of parameters used to configure this class.