ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
CaloRingerTools
src
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
// =============================================================================
6
#include "
CaloRingerElectronsReader.h
"
7
8
#include <algorithm>
9
10
#include "
AthenaKernel/getMessageSvc.h
"
11
#include "
PATCore/AcceptData.h
"
12
#include "
StoreGate/ReadHandle.h
"
13
14
namespace
Ringer
{
15
16
// =============================================================================
17
CaloRingerElectronsReader::CaloRingerElectronsReader
(
const
std::string&
type
,
18
const
std::string& name,
19
const ::IInterface* parent) :
20
CaloRingerInputReader
(
type
, name, parent),
21
m_clRingsBuilderElectronFctor
(nullptr)
22
{
23
24
// declare interface
25
declareInterface<ICaloRingerElectronsReader>(
this
);
26
27
}
28
29
// =============================================================================
30
CaloRingerElectronsReader::~CaloRingerElectronsReader
()
31
{
32
delete
m_clRingsBuilderElectronFctor
;
33
}
34
35
// =============================================================================
36
StatusCode
CaloRingerElectronsReader::initialize
()
37
{
38
39
ATH_CHECK
(
CaloRingerInputReader::initialize
() );
40
41
ATH_CHECK
(
m_inputElectronContainerKey
.initialize());
42
43
if
(
m_builderAvailable
) {
44
// Initialize our fctor
45
m_clRingsBuilderElectronFctor
=
46
new
BuildCaloRingsFctor<xAOD::ElectronContainer>
(
47
m_inputElectronContainerKey
.key(),
48
m_crBuilder
,
49
Athena::getMessageSvc
(),
50
this
51
);
52
ATH_CHECK
(
m_clRingsBuilderElectronFctor
->initialize() );
53
}
54
55
return
StatusCode::SUCCESS;
56
57
}
58
59
// =============================================================================
60
StatusCode
CaloRingerElectronsReader::finalize
()
61
{
62
return
StatusCode::SUCCESS;
63
}
64
65
// =============================================================================
66
StatusCode
CaloRingerElectronsReader::execute
()
67
{
68
69
ATH_MSG_DEBUG
(
"Entering "
<< name() <<
" execute, m_builderAvailable = "
<<
m_builderAvailable
);
70
71
// Retrieve electrons
72
SG::ReadHandle<xAOD::ElectronContainer>
electrons(
m_inputElectronContainerKey
);
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
AcceptData.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloRingerElectronsReader.h
ReadHandle.h
Handle class for reading from StoreGate.
Ringer::BuildCaloRingsFctor
Definition
CaloRingerReaderUtils.h:108
Ringer::CaloRingerElectronsReader::CaloRingerElectronsReader
CaloRingerElectronsReader(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition
CaloRingerElectronsReader.cxx:17
Ringer::CaloRingerElectronsReader::initialize
virtual StatusCode initialize() override
Tool main methods:
Definition
CaloRingerElectronsReader.cxx:36
Ringer::CaloRingerElectronsReader::finalize
virtual StatusCode finalize() override
finalize method
Definition
CaloRingerElectronsReader.cxx:60
Ringer::CaloRingerElectronsReader::m_inputElectronContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_inputElectronContainerKey
Tool CaloRingerElectronsReader props (python configurables):
Definition
CaloRingerElectronsReader.h:84
Ringer::CaloRingerElectronsReader::execute
virtual StatusCode execute() override
execute method
Definition
CaloRingerElectronsReader.cxx:66
Ringer::CaloRingerElectronsReader::~CaloRingerElectronsReader
~CaloRingerElectronsReader()
Destructor.
Definition
CaloRingerElectronsReader.cxx:30
Ringer::CaloRingerElectronsReader::m_clRingsBuilderElectronFctor
BuildCaloRingsFctor< xAOD::ElectronContainer > * m_clRingsBuilderElectronFctor
The CaloRings Builder functor:
Definition
CaloRingerElectronsReader.h:105
Ringer::CaloRingerInputReader::m_crBuilder
PublicToolHandle< ICaloRingsBuilder > m_crBuilder
Tool CaloRingerInputReader props (python configurables):
Definition
CaloRingerInputReader.h:68
Ringer::CaloRingerInputReader::m_builderAvailable
Gaudi::Property< bool > m_builderAvailable
Tool CaloRingerInputReader props (non configurables):If CaloRings builder is available.
Definition
CaloRingerInputReader.h:75
Ringer::CaloRingerInputReader::CaloRingerInputReader
CaloRingerInputReader(const std::string &type, const std::string &name, const ::IInterface *parent)
Default constructor.
Definition
CaloRingerInputReader.cxx:14
Ringer::CaloRingerInputReader::initialize
virtual StatusCode initialize() override
Tool main methods:
Definition
CaloRingerInputReader.cxx:30
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
Ringer
Namespace dedicated for Ringer utilities.
Definition
CaloRingsDefs.h:9
type
Generated on
for ATLAS Offline Software by
1.17.0