ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
CaloRingerTools
src
CaloRingerPhotonsReader.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// =============================================================================
6
#include "
AthenaKernel/getMessageSvc.h
"
7
#include "
CaloRingerPhotonsReader.h
"
8
#include "
StoreGate/ReadHandle.h
"
9
10
#include <algorithm>
11
12
namespace
Ringer
{
13
14
// =============================================================================
15
CaloRingerPhotonsReader::CaloRingerPhotonsReader
(
const
std::string&
type
,
16
const
std::string& name,
17
const ::IInterface* parent)
18
:
CaloRingerInputReader
(
type
, name, parent),
19
m_clRingsBuilderPhotonFctor
(nullptr)
20
//m_selectorAvailable(false)
21
{
22
23
// declare interface
24
declareInterface<ICaloRingerPhotonsReader>(
this
);
25
26
}
27
28
// =============================================================================
29
CaloRingerPhotonsReader::~CaloRingerPhotonsReader
()
30
{
31
if
(
m_clRingsBuilderPhotonFctor
)
delete
m_clRingsBuilderPhotonFctor
;
32
}
33
34
// =============================================================================
35
StatusCode
CaloRingerPhotonsReader::initialize
()
36
{
37
38
ATH_CHECK
(
CaloRingerInputReader::initialize
() );
39
40
ATH_CHECK
(
m_inputPhotonContainerKey
.initialize());
41
42
if
(
m_builderAvailable
) {
43
// Initialize our fctor
44
m_clRingsBuilderPhotonFctor
=
45
new
BuildCaloRingsFctor<xAOD::PhotonContainer>
(
46
m_inputPhotonContainerKey
.key(),
47
m_crBuilder
,
48
Athena::getMessageSvc
(),
49
this
);
50
ATH_CHECK
(
m_clRingsBuilderPhotonFctor
->initialize() );
51
}
52
53
return
StatusCode::SUCCESS;
54
}
55
56
// =============================================================================
57
StatusCode
CaloRingerPhotonsReader::finalize
()
58
{
59
return
StatusCode::SUCCESS;
60
}
61
62
// =============================================================================
63
StatusCode
CaloRingerPhotonsReader::execute
()
64
{
65
66
ATH_MSG_DEBUG
(
"Entering "
<< name() <<
" execute."
);
67
68
// Retrieve photons
69
SG::ReadHandle<xAOD::PhotonContainer>
photons(
m_inputPhotonContainerKey
);
70
// check is only used for serial running; remove when MT scheduler used
71
if
(!photons.
isValid
()) {
72
ATH_MSG_FATAL
(
"Failed to retrieve "
<<
m_inputPhotonContainerKey
.key());
73
return
StatusCode::FAILURE;
74
}
75
76
if
(
m_builderAvailable
) {
77
ATH_CHECK
(
m_clRingsBuilderPhotonFctor
->prepareToLoopFor(photons->size()) );
78
79
// loop over our particles:
80
for
(
const
auto
*
const
photon : *photons ){
81
m_clRingsBuilderPhotonFctor
->operator()( photon );
82
}
83
84
}
85
86
87
return
StatusCode::SUCCESS;
88
89
}
90
91
}
// namespace Ringer
92
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
CaloRingerPhotonsReader.h
ReadHandle.h
Handle class for reading from StoreGate.
Ringer::BuildCaloRingsFctor
Definition
CaloRingerReaderUtils.h:108
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
Ringer::CaloRingerPhotonsReader::execute
virtual StatusCode execute() override
execute method
Definition
CaloRingerPhotonsReader.cxx:63
Ringer::CaloRingerPhotonsReader::~CaloRingerPhotonsReader
~CaloRingerPhotonsReader()
Destructor.
Definition
CaloRingerPhotonsReader.cxx:29
Ringer::CaloRingerPhotonsReader::m_inputPhotonContainerKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_inputPhotonContainerKey
photon collection input name
Definition
CaloRingerPhotonsReader.h:86
Ringer::CaloRingerPhotonsReader::CaloRingerPhotonsReader
CaloRingerPhotonsReader(const std::string &type, const std::string &name, const ::IInterface *parent)
Default constructor.
Definition
CaloRingerPhotonsReader.cxx:15
Ringer::CaloRingerPhotonsReader::finalize
virtual StatusCode finalize() override
finalize method
Definition
CaloRingerPhotonsReader.cxx:57
Ringer::CaloRingerPhotonsReader::initialize
virtual StatusCode initialize() override
Tool main methods:
Definition
CaloRingerPhotonsReader.cxx:35
Ringer::CaloRingerPhotonsReader::m_clRingsBuilderPhotonFctor
BuildCaloRingsFctor< xAOD::PhotonContainer > * m_clRingsBuilderPhotonFctor
Tool CaloRingerPhotonsReader props (non configurables):
Definition
CaloRingerPhotonsReader.h:97
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
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