ATLAS Offline Software
Loading...
Searching...
No Matches
HIPLArVolumeAcceptTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace G4UA
8{
9
10 //---------------------------------------------------------------------------
12 const std::string& name,
13 const IInterface* parent)
15 {
16 }
17
18 //---------------------------------------------------------------------------
19 std::unique_ptr<HIPLArVolumeAccept>
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 }
28
29 //---------------------------------------------------------------------------
31 {
32 // Accumulate the results across threads
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 }
49
50} // namespace G4UA
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
virtual std::unique_ptr< HIPLArVolumeAccept > makeAndFillAction(G4AtlasUserActions &) override final
Create the action for the current thread.
HIPLArVolumeAcceptTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
virtual StatusCode finalize() override
Finalize the tool.
const Report & getReport() const
ThreadSpecificUserAction< HIPLArVolumeAccept > m_actions
UserActionToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Struct for passing around user actions.
std::vector< G4UserSteppingAction * > steppingActions
std::vector< G4UserEventAction * > eventActions
Report class for merging per-thread results.