LDMX Software
|
Interface that defines a user action. More...
#include <UserAction.h>
Public Types | |
using | Factory = ::simcore::Factory< UserAction, std::shared_ptr< UserAction >, const std::string &, framework::config::Parameters & > |
factory for user actions | |
Public Member Functions | |
UserAction (const std::string &name, framework::config::Parameters ¶meters) | |
Constructor. | |
virtual | ~UserAction ()=default |
Destructor. | |
virtual void | BeginOfEventAction (const G4Event *) |
Method called at the beginning of every event. | |
virtual void | EndOfEventAction (const G4Event *) |
Method called at the end of every event. | |
virtual void | BeginOfRunAction (const G4Run *) |
Method called at the beginning of a run. | |
virtual void | EndOfRunAction (const G4Run *) |
Method called at the end of a run. | |
virtual void | PreUserTrackingAction (const G4Track *) |
Method called before the UserTrackingAction. | |
virtual void | PostUserTrackingAction (const G4Track *) |
Method called after the UserTrackingAction. | |
virtual void | stepping (const G4Step *) |
Method called after each simulation step. | |
virtual G4ClassificationOfNewTrack | ClassifyNewTrack (const G4Track *, const G4ClassificationOfNewTrack &cl) |
Method called when a track is updated. | |
virtual void | NewStage () |
Method called at the beginning of a new stage. | |
virtual void | PrepareNewEvent () |
Method called at the beginning of a new event. | |
virtual std::vector< TYPE > | getTypes ()=0 |
Protected Member Functions | |
UserEventInformation * | getEventInfo () const |
Get a handle to the event information. | |
const std::map< int, ldmx::SimParticle > & | getCurrentParticleMap () const |
Get the current particle map. | |
Protected Attributes | |
std::string | name_ {""} |
Name of the UserAction. | |
framework::config::Parameters | parameters_ |
The set of parameters used to configure this class. | |
Interface that defines a user action.
Definition at line 42 of file UserAction.h.
using simcore::UserAction::Factory = ::simcore::Factory<UserAction, std::shared_ptr<UserAction>, const std::string&, framework::config::Parameters&> |
factory for user actions
Definition at line 53 of file UserAction.h.
simcore::UserAction::UserAction | ( | const std::string & | name, |
framework::config::Parameters & | parameters | ||
) |
Constructor.
name | Name given the to class instance. |
Definition at line 16 of file UserAction.cxx.
References name_, and parameters_.
|
inlinevirtual |
Method called at the beginning of every event.
TYPE::EVENT
event | Geant4 event object. |
Reimplemented in biasing::TaggerVetoFilter, biasing::TargetDarkBremFilter, biasing::DeepEcalProcessFilter, biasing::EcalDarkBremFilter, biasing::MidShowerDiMuonBkgdFilter, biasing::MidShowerNuclearBkgdFilter, and biasing::utility::PartialEnergySorter.
Definition at line 67 of file UserAction.h.
|
inlinevirtual |
Method called at the beginning of a run.
TYPE::RUN
run | Current Geant4 run object. |
Definition at line 85 of file UserAction.h.
|
inlinevirtual |
Method called when a track is updated.
TYPE::STEPPING
current | Geant4 track |
current | tracks' classification |
Reimplemented in biasing::EcalDarkBremFilter, biasing::EcalProcessFilter, biasing::TargetBremFilter, biasing::TargetProcessFilter, and biasing::utility::PartialEnergySorter.
Definition at line 131 of file UserAction.h.
|
inlinevirtual |
Method called at the end of every event.
TYPE::EVENT
event | Geant4 event object. |
Reimplemented in biasing::NonFiducialFilter, biasing::TaggerVetoFilter, biasing::TargetBremFilter, biasing::TargetENProcessFilter, biasing::TargetProcessFilter, biasing::TaggerHitFilter, and biasing::TargetDarkBremFilter.
Definition at line 76 of file UserAction.h.
|
inlinevirtual |
Method called at the end of a run.
TYPE::RUN
run | Current Geant4 run object. |
Definition at line 94 of file UserAction.h.
|
protected |
Get the current particle map.
Definition at line 27 of file UserAction.cxx.
References simcore::g4user::TrackingAction::get(), simcore::TrackMap::getParticleMap(), and simcore::g4user::TrackingAction::getTrackMap().
Referenced by biasing::utility::DecayChildrenKeeper::PostUserTrackingAction().
|
protected |
Get a handle to the event information.
This is static just to point out that it doesn't depend on any of the member variables of this class. It is just a helper function for shortening any code that interacts with our event information.
Definition at line 22 of file UserAction.cxx.
Referenced by biasing::DeepEcalProcessFilter::stepping(), biasing::MidShowerNuclearBkgdFilter::stepping(), biasing::TargetBremFilter::stepping(), and biasing::TargetProcessFilter::stepping().
|
pure virtual |
Must be defined by any UserActions so that we know what functions to call.
Implemented in biasing::DeepEcalProcessFilter, biasing::EcalDarkBremFilter, biasing::EcalProcessFilter, biasing::MidShowerDiMuonBkgdFilter, biasing::MidShowerNuclearBkgdFilter, biasing::NonFiducialFilter, biasing::PhotoNuclearProductsFilter, biasing::PhotoNuclearTopologyFilter, biasing::PrimaryToEcalFilter, biasing::TaggerHitFilter, biasing::TaggerVetoFilter, biasing::TargetBremFilter, biasing::TargetDarkBremFilter, biasing::TargetENProcessFilter, biasing::TargetProcessFilter, biasing::utility::DecayChildrenKeeper, biasing::utility::PartialEnergySorter, biasing::utility::StepPrinter, and biasing::utility::TrackProcessFilter.
|
inlinevirtual |
Method called at the beginning of a new stage.
TYPE::STACKING
Reimplemented in biasing::DeepEcalProcessFilter, biasing::EcalDarkBremFilter, biasing::MidShowerDiMuonBkgdFilter, biasing::MidShowerNuclearBkgdFilter, and biasing::utility::PartialEnergySorter.
Definition at line 141 of file UserAction.h.
|
inlinevirtual |
Method called after the UserTrackingAction.
TYPE::TRACKING
track | current Geant4 track |
Reimplemented in biasing::EcalDarkBremFilter, biasing::utility::DecayChildrenKeeper, and biasing::utility::TrackProcessFilter.
Definition at line 112 of file UserAction.h.
|
inlinevirtual |
Method called at the beginning of a new event.
TYPE::STACKING
Definition at line 148 of file UserAction.h.
|
inlinevirtual |
Method called before the UserTrackingAction.
TYPE::TRACKING
track | current Geant4 track |
Definition at line 103 of file UserAction.h.
|
inlinevirtual |
Method called after each simulation step.
TYPE::STEPPING
current | Geant4 step |
Reimplemented in biasing::DeepEcalProcessFilter, biasing::EcalProcessFilter, biasing::MidShowerDiMuonBkgdFilter, biasing::MidShowerNuclearBkgdFilter, biasing::NonFiducialFilter, biasing::PhotoNuclearProductsFilter, biasing::PhotoNuclearTopologyFilter, biasing::PrimaryToEcalFilter, biasing::TaggerHitFilter, biasing::TaggerVetoFilter, biasing::TargetBremFilter, biasing::TargetDarkBremFilter, biasing::TargetENProcessFilter, biasing::TargetProcessFilter, biasing::utility::PartialEnergySorter, and biasing::utility::StepPrinter.
Definition at line 121 of file UserAction.h.
|
protected |
Name of the UserAction.
Definition at line 181 of file UserAction.h.
Referenced by UserAction().
|
protected |
The set of parameters used to configure this class.
Definition at line 184 of file UserAction.h.
Referenced by UserAction().