ATLAS Offline Software
Loading...
Searching...
No Matches
G4UA::TestActionTool Class Reference

#include <TestActionTool.h>

Inheritance diagram for G4UA::TestActionTool:
Collaboration diagram for G4UA::TestActionTool:

Public Member Functions

 TestActionTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor.
virtual StatusCode initialize () override final
 Initialize the tool.
virtual StatusCode finalize () override final
 Finalize the tool.
virtual StatusCode fillUserAction (G4AtlasUserActions &actionLists) override final
 Fill the user action lists.
StatusCode BeginOfAthenaEvent (HitCollectionMap &) override
 Calls BeginOfAthenaEvent.
StatusCode EndOfAthenaEvent (HitCollectionMap &) override
 Calls EndOfAthenaEvent.

Protected Member Functions

virtual std::unique_ptr< TestActionmakeAndFillAction (G4AtlasUserActions &actions) override final
 Fill user action.

Protected Attributes

ThreadSpecificUserAction< TestActionm_actions
 Thread-specific storage of the user action.

Detailed Description

Author
Steve Farrell Steve.nosp@m.n.Fa.nosp@m.rrell.nosp@m.@cer.nosp@m.n.ch

Definition at line 78 of file TestActionTool.h.

Constructor & Destructor Documentation

◆ TestActionTool()

G4UA::TestActionTool::TestActionTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard constructor.

Definition at line 67 of file TestActionTool.cxx.

70 : UserActionToolBase<TestAction>(type, name, parent)
71 {
72 }
UserActionToolBase(const std::string &type, const std::string &name, const IInterface *parent)

Member Function Documentation

◆ BeginOfAthenaEvent()

StatusCode G4UA::UserActionToolBase< TestAction >::BeginOfAthenaEvent ( HitCollectionMap & )
inlineoverrideinherited

Calls BeginOfAthenaEvent.

Definition at line 59 of file UserActionToolBase.h.

59{return StatusCode::SUCCESS;};
abstract template utility base-class for G4 user-action tools.

◆ EndOfAthenaEvent()

StatusCode G4UA::UserActionToolBase< TestAction >::EndOfAthenaEvent ( HitCollectionMap & )
inlineoverrideinherited

Calls EndOfAthenaEvent.

Definition at line 61 of file UserActionToolBase.h.

61{return StatusCode::SUCCESS;};

◆ fillUserAction()

virtual StatusCode G4UA::UserActionToolBase< TestAction >::fillUserAction ( G4AtlasUserActions & actionLists)
inlinefinaloverridevirtualinherited

Fill the user action lists.

Definition at line 47 of file UserActionToolBase.h.

48 {
50 if(myAction == nullptr) {
51 ATH_MSG_ERROR( "Failed to construct user action in " << name() );
53 }
56 }
#define ATH_MSG_ERROR(x)
virtual std::unique_ptr< TestAction > makeAndFillAction(G4AtlasUserActions &actionLists)=0

◆ finalize()

StatusCode G4UA::TestActionTool::finalize ( )
finaloverridevirtual

Finalize the tool.

Definition at line 86 of file TestActionTool.cxx.

87 {
88 ATH_MSG_INFO( "Finalizing " << name() );
89
90 // Accumulate results across threads
91 TestAction::Report results;
92 m_actions.accumulate(results, &TestAction::getReport,
94 ATH_MSG_INFO("Final accumulated results: " <<
95 results.numEvent << " events processed, " <<
96 results.numStep << " steps processed");
97
98 return StatusCode::SUCCESS;
99 }
#define ATH_MSG_INFO(x)
const Report & getReport() const
Get the results report.
ThreadSpecificUserAction< TestAction > m_actions
void merge(const Report &other)

◆ initialize()

StatusCode G4UA::TestActionTool::initialize ( )
finaloverridevirtual

Initialize the tool.

Definition at line 77 of file TestActionTool.cxx.

78 {
79 ATH_MSG_INFO( "Initializing " << name() );
80 return StatusCode::SUCCESS;
81 }

◆ makeAndFillAction()

std::unique_ptr< TestAction > G4UA::TestActionTool::makeAndFillAction ( G4AtlasUserActions & actions)
finaloverrideprotectedvirtual

Fill user action.

Implements G4UA::UserActionToolBase< TestAction >.

Definition at line 105 of file TestActionTool.cxx.

106 {
107 ATH_MSG_INFO("Constructing and filling a TestAction");
108
109 auto action = std::make_unique<TestAction>();
110 actions.runActions.push_back( action.get() );
111 actions.eventActions.push_back( action.get() );
112 actions.steppingActions.push_back( action.get() );
113 return action;
114 }

Member Data Documentation

◆ m_actions

Thread-specific storage of the user action.

Definition at line 70 of file UserActionToolBase.h.


The documentation for this class was generated from the following files: