6#ifndef SIMCORE_USERACTION_H
7#define SIMCORE_USERACTION_H
20#include "G4EventManager.hh"
21#include "G4UserStackingAction.hh"
26#include "Framework/Configure/Parameters.h"
28#include "Framework/Logger.h"
29#include "SimCore/Event/SimParticle.h"
30#include "SimCore/G4User/UserEventInformation.h"
41enum TYPE { RUN = 1, EVENT, TRACKING, STEPPING, STACKING, NONE };
136 const G4Track*,
const G4ClassificationOfNewTrack& cl) {
191 void abortEvent(
const std::string& reason)
const;
216#define DECLARE_ACTION(CLASS) FACTORY_REGISTRATION(simcore::UserAction, CLASS)
Header holding Factory class and supporting macros.
Class encapsulating parameters for configuring a processor.
Interface that defines a user action.
virtual void stepping(const G4Step *)
Method called after each simulation step.
virtual void beginOfEventAction(const G4Event *)
Method called at the beginning of every event.
virtual G4ClassificationOfNewTrack classifyNewTrack(const G4Track *, const G4ClassificationOfNewTrack &cl)
Method called when a track is updated.
mutable::framework::logging::logger the_log_
the logging channel user actions can use ldmx_log with
virtual void preUserTrackingAction(const G4Track *)
Method called before the UserTrackingAction.
virtual ~UserAction()=default
Destructor.
DECLARE_FACTORY(UserAction, std::shared_ptr< UserAction >, const std::string &, framework::config::Parameters &)
factory for user actions
UserAction(const std::string &name, framework::config::Parameters ¶meters)
Constructor.
const std::map< int, ldmx::SimParticle > & getCurrentParticleMap() const
Get the current particle map.
virtual std::vector< TYPE > getTypes()=0
UserEventInformation * getEventInfo() const
Get a handle to the event information.
virtual void prepareNewEvent()
Method called at the beginning of a new event.
virtual void endOfEventAction(const G4Event *)
Method called at the end of every event.
virtual void newStage()
Method called at the beginning of a new stage.
virtual void endOfRunAction(const G4Run *)
Method called at the end of a run.
std::string name_
Name of the UserAction.
framework::config::Parameters parameters_
The set of parameters used to configure this class.
void abortEvent(const std::string &reason) const
Helper to abort an event with a message.
virtual void beginOfRunAction(const G4Run *)
Method called at the beginning of a run.
virtual void postUserTrackingAction(const G4Track *)
Method called after the UserTrackingAction.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...
TYPE
Enum for each of the user action types.