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

#include <G4HitFilterTool.h>

Inheritance diagram for G4UA::G4HitFilterTool:
Collaboration diagram for G4UA::G4HitFilterTool:

Public Member Functions

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

Protected Member Functions

virtual std::unique_ptr< G4HitFiltermakeAndFillAction (G4AtlasUserActions &) override final
 Construct the user action for current worker thread. More...
 

Protected Attributes

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

Private Attributes

G4HitFilter::Config m_config
 User action configuration options. More...
 

Detailed Description

Tool which constructs/manages the G4HitFilter user action.

Definition at line 18 of file G4HitFilterTool.h.

Constructor & Destructor Documentation

◆ G4HitFilterTool()

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

Standard constructor.

Definition at line 12 of file G4HitFilterTool.cxx.

15  : UserActionToolBase<G4HitFilter>(type, name, parent)
16  {
17  declareProperty("VolumeNames", m_config.volumenames);
18  }

Member Function Documentation

◆ fillUserAction()

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

Finalize the tool.

Definition at line 32 of file G4HitFilterTool.cxx.

33  {
34  // Merge results across worker threads
35  G4HitFilter::Report report;
38 
39  // Report the results
40  ATH_MSG_INFO("processed " << report.ntot << " events, " <<
41  report.npass << " events passed filter ");
42  return StatusCode::SUCCESS;
43  }

◆ makeAndFillAction()

std::unique_ptr< G4HitFilter > G4UA::G4HitFilterTool::makeAndFillAction ( G4AtlasUserActions actionList)
finaloverrideprotectedvirtual

Construct the user action for current worker thread.

Implements G4UA::UserActionToolBase< G4HitFilter >.

Definition at line 22 of file G4HitFilterTool.cxx.

23  {
24  ATH_MSG_DEBUG("Constructing a G4HitFilter action");
25  auto action = std::make_unique<G4HitFilter>(m_config);
26  actionList.runActions.push_back( action.get() );
27  actionList.eventActions.push_back( action.get() );
28  return action;
29  }

Member Data Documentation

◆ m_actions

Thread-specific storage of the user action.

Definition at line 63 of file UserActionToolBase.h.

◆ m_config

G4HitFilter::Config G4UA::G4HitFilterTool::m_config
private

User action configuration options.

Definition at line 39 of file G4HitFilterTool.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
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
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
G4UA::G4HitFilter::Report::merge
void merge(const Report &rep)
Definition: G4HitFilter.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
G4UA::UserActionToolBase< G4HitFilter >::m_actions
ThreadSpecificUserAction< G4HitFilter > 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
G4UA::UserActionToolBase< G4HitFilter >::makeAndFillAction
virtual std::unique_ptr< G4HitFilter > makeAndFillAction(G4AtlasUserActions &actionLists)=0
Make the action and push onto the lists.
G4UA::G4HitFilter::Config::volumenames
std::vector< std::string > volumenames
Definition: G4HitFilter.h:30
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
G4UA::G4HitFilter::getReport
const Report & getReport() const
Definition: G4HitFilter.h:46
G4UA::G4HitFilterTool::m_config
G4HitFilter::Config m_config
User action configuration options.
Definition: G4HitFilterTool.h:39