ATLAS Offline Software
Loading...
Searching...
No Matches
IUserActionTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef G4ATLASINTERFACES_IUSERACTIONTOOL_H
6#define G4ATLASINTERFACES_IUSERACTIONTOOL_H
7
8// System includes
9#include <vector>
10
11// Framework includes
12#include "GaudiKernel/IAlgTool.h"
13
14class IG4RunTool;
15// Geant4 forward declarations
16class G4UserRunAction;
17class G4VUserPrimaryGeneratorAction;
18class G4UserEventAction;
19class G4UserTrackingAction;
20class G4UserSteppingAction;
21class G4UserStackingAction;
23
24namespace G4UA
25{
26
35 {
36 std::vector<G4UserRunAction*> runActions;
37 std::vector<G4UserRunAction*> runActionsMaster;
38 std::vector<G4VUserPrimaryGeneratorAction*> primaryGeneratorActions;
39 std::vector<G4UserEventAction*> eventActions;
40 std::vector<G4UserTrackingAction*> trackingActions;
41 std::vector<G4UserSteppingAction*> steppingActions;
42 std::vector<G4UserStackingAction*> stackingActions;
43 };
44
53 class IUserActionTool : virtual public IAlgTool
54 {
55
56 public:
57
59 virtual StatusCode fillUserAction(G4AtlasUserActions& userActions) = 0;
60
63 // Can't use a tool handle here because of circular dependency (G4RunTool <-> UserActionTool).
64 virtual void G4RunTool(IG4RunTool*) {}
65
66 virtual StatusCode BeginOfAthenaEvent(HitCollectionMap&) = 0;
67 virtual StatusCode EndOfAthenaEvent(HitCollectionMap&) = 0;
68
71
72 }; // class IUserActionTool
73
74} // namespace G4UA
75
76#endif // G4ATLASINTERFACES_IUSERACTIONTOOL_H
Abstract interface for tools that construct G4 user actions.
virtual StatusCode EndOfAthenaEvent(HitCollectionMap &)=0
virtual StatusCode fillUserAction(G4AtlasUserActions &userActions)=0
Constructs a user action and populates the user action lists with it.
DeclareInterfaceID(IUserActionTool, 1, 0)
Declare this interface to the framework.
virtual void G4RunTool(IG4RunTool *)
Pointer to the G4RunTool instance.
virtual StatusCode BeginOfAthenaEvent(HitCollectionMap &)=0
Small wrapper around hit collection map to facilitate accessing the hit collection.
Provides an interface to interact with the Geant4 run.
Definition IG4RunTool.h:22
Struct for passing around user actions.
std::vector< G4UserRunAction * > runActionsMaster
std::vector< G4UserTrackingAction * > trackingActions
std::vector< G4UserStackingAction * > stackingActions
std::vector< G4VUserPrimaryGeneratorAction * > primaryGeneratorActions
std::vector< G4UserSteppingAction * > steppingActions
std::vector< G4UserEventAction * > eventActions
std::vector< G4UserRunAction * > runActions