ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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. More...
 
virtual StatusCode initialize () override final
 Initialize the tool. More...
 
virtual StatusCode finalize () override final
 Finalize the tool. More...
 
virtual StatusCode fillUserAction (G4AtlasUserActions &actionLists) override final
 Fill the user action lists. More...
 

Protected Member Functions

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

Protected Attributes

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

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  }

Member Function Documentation

◆ fillUserAction()

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

Fill the user action lists.

Definition at line 45 of file UserActionToolBase.h.

46  {
47  auto myAction = makeAndFillAction(actionLists);
48  if(myAction == nullptr) {
49  ATH_MSG_ERROR( "Failed to construct user action in " << name() );
50  return StatusCode::FAILURE;
51  }
52  m_actions.set( std::move(myAction) );
53  return StatusCode::SUCCESS;
54  }

◆ 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;
94  ATH_MSG_INFO("Final accumulated results: " <<
95  results.numEvent << " events processed, " <<
96  results.numStep << " steps processed");
97 
98  return StatusCode::SUCCESS;
99  }

◆ 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 63 of file UserActionToolBase.h.


The documentation for this class was generated from the following files:
G4UA::TestAction::getReport
const Report & getReport() const
Get the results report.
Definition: TestActionTool.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
G4UA::ThreadSpecificUserAction::set
void set(std::unique_ptr< ActionType > action)
Assign the object of the current thread.
Definition: ThreadSpecificUserAction.h:61
G4UA::ThreadSpecificUserAction::accumulate
void accumulate(ResultType &result, Mapper mapOp, Reducer reduceOp)
Accumulate results across user actions with specified operations.
Definition: ThreadSpecificUserAction.h:88
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
G4UA::UserActionToolBase< TestAction >::m_actions
ThreadSpecificUserAction< TestAction > m_actions
Thread-specific storage of the user action.
Definition: UserActionToolBase.h:63
test_pyathena.parent
parent
Definition: test_pyathena.py:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.ami.results
def results
Definition: ami.py:386
G4UA::UserActionToolBase< TestAction >::makeAndFillAction
virtual std::unique_ptr< TestAction > makeAndFillAction(G4AtlasUserActions &actionLists)=0
Make the action and push onto the lists.
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
G4UA::TestAction::Report::merge
void merge(const Report &other)
Definition: TestActionTool.h:39