ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
G4UA::G4SimTimerTool Class Reference

Tool which manages the G4SimTimer action. More...

#include <G4SimTimerTool.h>

Inheritance diagram for G4UA::G4SimTimerTool:
Collaboration diagram for G4UA::G4SimTimerTool:

Public Member Functions

 G4SimTimerTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor. More...
 
virtual StatusCode initialize () override
 Initialize the tool. More...
 
virtual StatusCode finalize () override
 Finalize and merge results from all worker threads. More...
 
virtual StatusCode fillUserAction (G4AtlasUserActions &actionLists) override final
 Fill the user action lists. More...
 

Protected Member Functions

virtual std::unique_ptr< G4SimTimermakeAndFillAction (G4AtlasUserActions &) override final
 Create aciton for this thread. More...
 

Protected Attributes

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

Detailed Description

Tool which manages the G4SimTimer action.

Create the G4SimTimer for each worker thread and merges timing results in finalization.

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

Definition at line 28 of file G4SimTimerTool.h.

Constructor & Destructor Documentation

◆ G4SimTimerTool()

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

Standard constructor.

Definition at line 13 of file G4SimTimerTool.cxx.

16  : UserActionToolBase<G4SimTimer>(type, name, parent)
17  {
18  }

Member Function Documentation

◆ fillUserAction()

virtual StatusCode G4UA::UserActionToolBase< G4SimTimer >::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::G4SimTimerTool::finalize ( )
overridevirtual

Finalize and merge results from all worker threads.

Definition at line 32 of file G4SimTimerTool.cxx.

33  {
34  ATH_MSG_DEBUG( "Finalizing " << name() );
35 
36  // Accumulate results across threads
37  G4SimTimer::Report report;
40 
41  // Report the results
42  auto meanSigma = report.meanAndSigma();
43  ATH_MSG_INFO("Finalized timing results for " << report.nEvent <<
44  " events (not all events used)");
45  ATH_MSG_INFO("Average time per event was " <<
46  std::setprecision(4) << meanSigma.first << " +- " <<
47  std::setprecision(4) << meanSigma.second);
48  return StatusCode::SUCCESS;
49  }

◆ initialize()

StatusCode G4UA::G4SimTimerTool::initialize ( )
overridevirtual

Initialize the tool.

Definition at line 23 of file G4SimTimerTool.cxx.

24  {
25  ATH_MSG_DEBUG( "Initializing " << name() );
26  return StatusCode::SUCCESS;
27  }

◆ makeAndFillAction()

std::unique_ptr< G4SimTimer > G4UA::G4SimTimerTool::makeAndFillAction ( G4AtlasUserActions actionList)
finaloverrideprotectedvirtual

Create aciton for this thread.

Implements G4UA::UserActionToolBase< G4SimTimer >.

Definition at line 55 of file G4SimTimerTool.cxx.

56  {
57  ATH_MSG_DEBUG("Making a G4SimTimer action");
58  auto action = std::make_unique<G4SimTimer>();
59  actionList.eventActions.push_back( action.get() );
60  return action;
61  }

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:
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::G4SimTimer::getReport
const Report & getReport() const
Retrieve my timing results.
Definition: G4SimTimer.h:77
checkTP.report
report
Definition: checkTP.py:127
G4UA::ThreadSpecificUserAction::accumulate
void accumulate(ResultType &result, Mapper mapOp, Reducer reduceOp)
Accumulate results across user actions with specified operations.
Definition: ThreadSpecificUserAction.h:88
G4UA::G4SimTimer::Report::merge
void merge(const Report &rep)
Definition: G4SimTimer.h:60
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
G4UA::UserActionToolBase< G4SimTimer >::m_actions
ThreadSpecificUserAction< G4SimTimer > 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:228
G4UA::UserActionToolBase< G4SimTimer >::makeAndFillAction
virtual std::unique_ptr< G4SimTimer > 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