ATLAS Offline Software
Loading...
Searching...
No Matches
CaloRingerElectronsReader.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5// =============================================================================
7
8#include <algorithm>
9
11#include "PATCore/AcceptData.h"
13
14namespace Ringer {
15
16// =============================================================================
18 const std::string& name,
19 const ::IInterface* parent) :
20 CaloRingerInputReader(type, name, parent),
22{
23
24 // declare interface
25 declareInterface<ICaloRingerElectronsReader>(this);
26
27}
28
29// =============================================================================
34
35// =============================================================================
37{
38
40
42
43 if ( m_builderAvailable ) {
44 // Initialize our fctor
50 this
51 );
53 }
54
55 return StatusCode::SUCCESS;
56
57}
58
59// =============================================================================
61{
62 return StatusCode::SUCCESS;
63}
64
65// =============================================================================
67{
68
69 ATH_MSG_DEBUG("Entering " << name() << " execute, m_builderAvailable = " << m_builderAvailable);
70
71 // Retrieve electrons
73 // check is only used for serial running; remove when MT scheduler used
74 if(!electrons.isValid()) {
75 ATH_MSG_FATAL("Failed to retrieve "<< m_inputElectronContainerKey.key());
76 return StatusCode::FAILURE;
77 }
78
79 // Check if requested to run CaloRings Builder:
80 if ( m_builderAvailable ) {
81 ATH_CHECK( m_clRingsBuilderElectronFctor->prepareToLoopFor(electrons->size()) );
82
83 // loop over our particles:
84 for ( const auto *const electron : *electrons ){
85 m_clRingsBuilderElectronFctor->operator()( electron );
86 }
87
88 m_clRingsBuilderElectronFctor->checkRelease();
89 }
90
91 return StatusCode::SUCCESS;
92}
93
94} // namespace Ringer
95
96
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading from StoreGate.
CaloRingerElectronsReader(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
virtual StatusCode initialize() override
Tool main methods:
virtual StatusCode finalize() override
finalize method
SG::ReadHandleKey< xAOD::ElectronContainer > m_inputElectronContainerKey
Tool CaloRingerElectronsReader props (python configurables):
virtual StatusCode execute() override
execute method
BuildCaloRingsFctor< xAOD::ElectronContainer > * m_clRingsBuilderElectronFctor
The CaloRings Builder functor:
PublicToolHandle< ICaloRingsBuilder > m_crBuilder
Tool CaloRingerInputReader props (python configurables):
Gaudi::Property< bool > m_builderAvailable
Tool CaloRingerInputReader props (non configurables):If CaloRings builder is available.
CaloRingerInputReader(const std::string &type, const std::string &name, const ::IInterface *parent)
Default constructor.
virtual StatusCode initialize() override
Tool main methods:
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
Namespace dedicated for Ringer utilities.