ATLAS Offline Software
Loading...
Searching...
No Matches
UserActionSvc.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
6#ifndef G4ATLASSERVICES__G4UA_USERACTIONSVC_H
7#define G4ATLASSERVICES__G4UA_USERACTIONSVC_H
8
9// Framework includes
11#include "GaudiKernel/ToolHandle.h"
12
13// G4Atlas includes
14#include "G4AtlasRunAction.h"
15#include "G4AtlasEventAction.h"
24
25// Forward declarations
26class IG4RunTool;
27
28namespace G4UA
29{
30
35 class UserActionSvc : public extends<AthService, IUserActionSvc>
36 {
37
38 public:
39
41 UserActionSvc(const std::string& name, ISvcLocator* pSvcLocator);
42
44 StatusCode initialize() override;
45
47 StatusCode initializeActionsMaster() override final;
48
50 StatusCode initializeActions() override final;
51
52 StatusCode getSecondaryActions( std::vector< G4UserSteppingAction* >& actions ) override final;
53
54 StatusCode addActionTool(const ToolHandle<IUserActionTool>& service_tool) override final;
55
56 void G4RunTool(IG4RunTool*) override final;
57
59 StatusCode BeginOfAthenaEvent(HitCollectionMap&) override final;
61 StatusCode EndOfAthenaEvent(HitCollectionMap&) override final;
62
63 private:
64
67
69 ToolHandleArray<IUserActionTool> m_userActionTools;
70
72
75
88
90
91 }; // class UserActionSvc
92
93}
94
95#endif
A thread-local storage wrapper for the user actions.
ToolHandleArray< IUserActionTool > m_userActionTools
User action tools.
StatusCode addActionTool(const ToolHandle< IUserActionTool > &service_tool) override final
ThreadActionHolder< G4AtlasEventAction > m_eventActions
Thread-local event action.
StatusCode initializeActions() override final
Initialize the user actions for the current thread.
StatusCode initializeActionsMaster() override final
Initialize the user run actions for the main thread.
StatusCode getSecondaryActions(std::vector< G4UserSteppingAction * > &actions) override final
ThreadActionHolder< G4AtlasSteppingAction > m_steppingActions
Thread-local stepping action.
StatusCode initialize() override
Initialize the service.
void G4RunTool(IG4RunTool *) override final
StatusCode EndOfAthenaEvent(HitCollectionMap &) override final
Calls EndOfAthenaEvent on each UserAction tool.
UserActionSvc(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
ThreadActionHolder< G4AtlasPrimaryGeneratorAction > m_primaryGeneratorActions
Thread-local primary generator action.
ThreadActionHolder< G4AtlasTrackingAction > m_trackingActions
Thread-local tracking action.
ThreadActionHolder< G4AtlasStackingAction > m_stackingActions
Thread-local stacking action.
StatusCode BeginOfAthenaEvent(HitCollectionMap &) override final
Calls BeginOfAthenaEvent on each UserAction tool.
ThreadActionHolder< G4AtlasRunAction > m_runActions
Thread-local run action.
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