LDMX Software
StackingAction.h
1
7#ifndef SIMCORE_G4USER_STACKINGACTION_H
8#define SIMCORE_G4USER_STACKINGACTION_H
9
10/*~~~~~~~~~~~~~~~~*/
11/* C++ StdLib */
12/*~~~~~~~~~~~~~~~~*/
13#include <vector>
14
15/*~~~~~~~~~~~~*/
16/* Geant4 */
17/*~~~~~~~~~~~~*/
18#include "G4UserStackingAction.hh"
19
20/*~~~~~~~~~~~~~*/
21/* SimCore */
22/*~~~~~~~~~~~~~*/
24
25namespace simcore {
26namespace g4user {
27
32class StackingAction : public G4UserStackingAction {
33 public:
35 StackingAction() = default;
36
38 virtual ~StackingAction() = default;
39
45 G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* track) override;
46
50 void NewStage() override;
51
55 void PrepareNewEvent() override;
56
62 void registerAction(std::shared_ptr<UserAction> stackingAction) {
63 stacking_actions_.push_back(stackingAction);
64 }
65
66 private:
68 std::vector<std::shared_ptr<UserAction>> stacking_actions_;
69
70}; // StackingAction
71
72} // namespace g4user
73} // namespace simcore
74
75#endif // SIMCORE_G4USER_STACKINGACTION_H
File holding UserAction prototype and supporting macro.
Class implementing a user stacking action.
void PrepareNewEvent() override
Invoked for a new event.
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *track) override
Classify a new track.
void registerAction(std::shared_ptr< UserAction > stackingAction)
Register a user action of type stacking action with this class.
StackingAction()=default
Constructor.
std::vector< std::shared_ptr< UserAction > > stacking_actions_
Collection of user stacking actions.
void NewStage() override
Invoked when there is a new stacking stage.
virtual ~StackingAction()=default
Destructor.
This namespace is meant to contain all the standard user actions that allow a Geant4 user to interfac...
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...