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

Tool which manages the HIPLArVolumeAccept action. More...

#include <HIPLArVolumeAcceptTool.h>

Inheritance diagram for G4UA::HIPLArVolumeAcceptTool:
Collaboration diagram for G4UA::HIPLArVolumeAcceptTool:

Public Member Functions

 HIPLArVolumeAcceptTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor.
virtual StatusCode finalize () override
 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< HIPLArVolumeAcceptmakeAndFillAction (G4AtlasUserActions &) override final
 Create the action for the current thread.

Protected Attributes

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

Detailed Description

Tool which manages the HIPLArVolumeAccept action.

Definition at line 19 of file HIPLArVolumeAcceptTool.h.

Constructor & Destructor Documentation

◆ HIPLArVolumeAcceptTool()

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

Standard constructor.

Definition at line 11 of file HIPLArVolumeAcceptTool.cxx.

14 : UserActionToolBase<HIPLArVolumeAccept>(type, name, parent)
15 {
16 }
UserActionToolBase(const std::string &type, const std::string &name, const IInterface *parent)

Member Function Documentation

◆ BeginOfAthenaEvent()

StatusCode G4UA::UserActionToolBase< HIPLArVolumeAccept >::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< HIPLArVolumeAccept >::EndOfAthenaEvent ( HitCollectionMap & )
inlineoverrideinherited

Calls EndOfAthenaEvent.

Definition at line 61 of file UserActionToolBase.h.

61{return StatusCode::SUCCESS;};

◆ fillUserAction()

virtual StatusCode G4UA::UserActionToolBase< HIPLArVolumeAccept >::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< HIPLArVolumeAccept > makeAndFillAction(G4AtlasUserActions &actionLists)=0

◆ finalize()

StatusCode G4UA::HIPLArVolumeAcceptTool::finalize ( )
overridevirtual

Finalize the tool.

Definition at line 30 of file HIPLArVolumeAcceptTool.cxx.

31 {
32 // Accumulate the results across threads
33 HIPLArVolumeAccept::Report report;
34 m_actions.accumulate(report, &HIPLArVolumeAccept::getReport,
36
37 ATH_MSG_INFO("#########################################");
38 ATH_MSG_INFO("## ##");
39 ATH_MSG_INFO( "## HIPLArVolumeAccept - EndOfRun ##");
40 ATH_MSG_INFO( "## ##");
41 ATH_MSG_INFO( "#########################################");
42 ATH_MSG_INFO(report.HIPevts <<" events were processed by HIPLArVolumeAccept");
43 ATH_MSG_INFO(report.HIPevts_failed<<" events were killed because they had no HIP in EMB or EMEC");
44 double HIPfraction=1.*(report.HIPevts-report.HIPevts_failed)/report.HIPevts;
45 ATH_MSG_INFO("HIP Acceptance: "<<HIPfraction);
46
47 return StatusCode::SUCCESS;
48 }
#define ATH_MSG_INFO(x)
const Report & getReport() const
ThreadSpecificUserAction< HIPLArVolumeAccept > m_actions
list report
Definition checkTP.py:125

◆ makeAndFillAction()

std::unique_ptr< HIPLArVolumeAccept > G4UA::HIPLArVolumeAcceptTool::makeAndFillAction ( G4AtlasUserActions & actionList)
finaloverrideprotectedvirtual

Create the action for the current thread.

Implements G4UA::UserActionToolBase< HIPLArVolumeAccept >.

Definition at line 20 of file HIPLArVolumeAcceptTool.cxx.

21 {
22 ATH_MSG_DEBUG("Making a HIPLArVolumeAccept action");
23 auto action = std::make_unique<HIPLArVolumeAccept>();
24 actionList.eventActions.push_back( action.get() );
25 actionList.steppingActions.push_back( action.get() );
26 return action;
27 }
#define ATH_MSG_DEBUG(x)

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: