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/*~~~~~~~~~~~~~*/
23#include "SimCore/UserAction.h"
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(UserAction* stackingAction) {
63 stackingActions_.push_back(stackingAction);
64 }
65
66 private:
68 std::vector<UserAction*> stackingActions_;
69
70}; // StackingAction
71
72} // namespace g4user
73} // namespace simcore
74
75#endif // SIMCORE_G4USER_STACKINGACTION_H
Interface that defines a user action.
Definition UserAction.h:42
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(UserAction *stackingAction)
Register a user action of type stacking action with this class.
std::vector< UserAction * > stackingActions_
Collection of user stacking actions.
StackingAction()=default
Constructor.
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...