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) {
206#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 PrepareNewEvent()
Method called at the beginning of a new event.
virtual void BeginOfEventAction(const G4Event *)
Method called at the beginning of every event.
mutable::framework::logging::logger the_log_
the logging channel user actions can use ldmx_log with
virtual void EndOfRunAction(const G4Run *)
Method called at the end of a run.
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.
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.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...
TYPE
Enum for each of the user action types.