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

Tool which manages the LooperKiller action. More...

#include <LooperKillerTool.h>

Inheritance diagram for G4UA::LooperKillerTool:
Collaboration diagram for G4UA::LooperKillerTool:

Public Member Functions

 LooperKillerTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor. More...
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode fillUserAction (G4AtlasUserActions &actionLists) override final
 Fill the user action lists. More...
 

Protected Member Functions

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

Protected Attributes

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

Private Attributes

G4UA::LooperKiller::Config m_config
 Configuration parameters. More...
 

Detailed Description

Tool which manages the LooperKiller action.

Create the LooperKiller for each worker thread

Author
Andrea Di Simone

Definition at line 27 of file LooperKillerTool.h.

Constructor & Destructor Documentation

◆ LooperKillerTool()

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

Standard constructor.

Definition at line 13 of file LooperKillerTool.cxx.

15  : UserActionToolBase<LooperKiller>(type, name, parent)
16  {
17  declareProperty("MaxSteps", m_config.MaxSteps);
18  declareProperty("PrintSteps",m_config.PrintSteps);
19  declareProperty("VerboseLevel", m_config.VerboseLevel);
20  declareProperty("AbortEvent", m_config.AbortEvent);
21  declareProperty("SetError", m_config.SetError);
22  }

Member Function Documentation

◆ fillUserAction()

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

Definition at line 33 of file LooperKillerTool.cxx.

34  {
35  ATH_MSG_DEBUG("finalize");
36 
37  // Accumulate the results across threads
38  LooperKiller::Report report;
41 
42  ATH_MSG_INFO( "******* Report from "<< name()<< " *******");
43  ATH_MSG_INFO(" Set to kill tracks over " << m_config.MaxSteps << " steps");
44  ATH_MSG_INFO(" and give " << m_config.PrintSteps << " steps of verbose output");
45  ATH_MSG_INFO(" We killed " << report.killed_tracks << " tracks this run.");
46  ATH_MSG_INFO(" Was set to " << (m_config.AbortEvent?"":"not ") << "abort events and ");
47  ATH_MSG_INFO( (m_config.SetError?"":"not ") << "set an error state." );
48 
49  return StatusCode::SUCCESS;
50  }

◆ initialize()

StatusCode G4UA::LooperKillerTool::initialize ( )
overridevirtual

Definition at line 27 of file LooperKillerTool.cxx.

28  {
29  ATH_MSG_DEBUG("initialize");
30  return StatusCode::SUCCESS;
31  }

◆ makeAndFillAction()

std::unique_ptr< LooperKiller > G4UA::LooperKillerTool::makeAndFillAction ( G4AtlasUserActions actionList)
finaloverrideprotectedvirtual

Create action for this thread.

Implements G4UA::UserActionToolBase< LooperKiller >.

Definition at line 57 of file LooperKillerTool.cxx.

58  {
59  ATH_MSG_DEBUG("Making a LooperKiller action");
60  auto action = std::make_unique<LooperKiller>(m_config);
61  actionList.steppingActions.push_back( action.get() );
62  return action;
63  }

Member Data Documentation

◆ m_actions

Thread-specific storage of the user action.

Definition at line 63 of file UserActionToolBase.h.

◆ m_config

G4UA::LooperKiller::Config G4UA::LooperKillerTool::m_config
private

Configuration parameters.

Definition at line 48 of file LooperKillerTool.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::LooperKiller::Config::AbortEvent
bool AbortEvent
Definition: LooperKiller.h:32
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::LooperKillerTool::m_config
G4UA::LooperKiller::Config m_config
Configuration parameters.
Definition: LooperKillerTool.h:48
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< LooperKiller >::m_actions
ThreadSpecificUserAction< LooperKiller > m_actions
Thread-specific storage of the user action.
Definition: UserActionToolBase.h:63
test_pyathena.parent
parent
Definition: test_pyathena.py:15
G4UA::LooperKiller::Report::merge
void merge(const Report &rep)
Definition: LooperKiller.h:39
G4UA::LooperKiller::Config::PrintSteps
int PrintSteps
Definition: LooperKiller.h:30
G4UA::LooperKiller::Config::VerboseLevel
int VerboseLevel
Definition: LooperKiller.h:31
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
G4UA::UserActionToolBase< LooperKiller >::makeAndFillAction
virtual std::unique_ptr< LooperKiller > makeAndFillAction(G4AtlasUserActions &actionLists)=0
Make the action and push onto the lists.
G4UA::LooperKiller::getReport
const Report & getReport() const
Retrieve results.
Definition: LooperKiller.h:48
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
G4UA::LooperKiller::Config::SetError
bool SetError
Definition: LooperKiller.h:33
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
G4UA::LooperKiller::Config::MaxSteps
int MaxSteps
Definition: LooperKiller.h:29