ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
PFOClusterMLCorrectionAlgorithm.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
PFOClusterMLCorrectionAlgorithm.h
"
6
#include "
xAODCore/ShallowCopy.h
"
7
8
StatusCode
PFOClusterMLCorrectionAlgorithm::initialize
()
9
{
10
ATH_MSG_DEBUG
(
"Initializing"
);
11
ATH_CHECK
(
m_correctionTool
.retrieve());
12
ATH_CHECK
(
m_chargedFEContainerReadHandleKey
.initialize());
13
ATH_CHECK
(
m_chargedFEMLContainerWriteHandleKey
.initialize());
14
ATH_CHECK
(
m_neutralFEContainerReadHandleKey
.initialize());
15
ATH_CHECK
(
m_neutralFEMLContainerWriteHandleKey
.initialize());
16
17
return
StatusCode::SUCCESS;
18
}
19
20
StatusCode
PFOClusterMLCorrectionAlgorithm::execute
(
const
EventContext &ctx)
const
21
{
22
try
{
23
ATH_MSG_DEBUG
(
"Executing"
);
24
25
// Read charged container
26
SG::ReadHandle<xAOD::FlowElementContainer>
chargedFEContainerReadHandle(
m_chargedFEContainerReadHandleKey
, ctx);
27
auto
[chargedFEMLContainer, chargedFEMLContainerAux] =
xAOD::shallowCopy
(*chargedFEContainerReadHandle);
28
29
// Read neutral container
30
SG::ReadHandle<xAOD::FlowElementContainer>
neutralFEContainerReadHandle(
m_neutralFEContainerReadHandleKey
, ctx);
31
auto
[neutralFEMLContainer, neutralFEMLContainerAux] =
xAOD::shallowCopy
(*neutralFEContainerReadHandle);
32
33
// Modification step
34
m_correctionTool
->correctContainer(*neutralFEMLContainer, *chargedFEMLContainer, ctx);
35
36
// Writing containers
37
SG::WriteHandle<xAOD::FlowElementContainer>
chargedFEMLContainerWriteHandle(
m_chargedFEMLContainerWriteHandleKey
, ctx);
38
ATH_CHECK
(chargedFEMLContainerWriteHandle.
record
(std::move(chargedFEMLContainer), std::move(chargedFEMLContainerAux)));
39
SG::WriteHandle<xAOD::FlowElementContainer>
neutralFEMLContainerWriteHandle(
m_neutralFEMLContainerWriteHandleKey
, ctx);
40
ATH_CHECK
(neutralFEMLContainerWriteHandle.
record
(std::move(neutralFEMLContainer), std::move(neutralFEMLContainerAux)));
41
42
return
StatusCode::SUCCESS;
43
44
}
45
catch
(
const
std::exception& e) {
46
ATH_MSG_ERROR
(
"Standard std::exception caught: "
<< e.what());
47
return
StatusCode::FAILURE;
48
}
49
catch
(...) {
50
ATH_MSG_ERROR
(
"Unknown exception caught"
);
51
return
StatusCode::FAILURE;
52
}
53
54
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
PFOClusterMLCorrectionAlgorithm.h
ShallowCopy.h
PFOClusterMLCorrectionAlgorithm::m_neutralFEContainerReadHandleKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_neutralFEContainerReadHandleKey
ReadHandleKey for eflowCaloObjectContainer.
Definition
PFOClusterMLCorrectionAlgorithm.h:38
PFOClusterMLCorrectionAlgorithm::m_neutralFEMLContainerWriteHandleKey
SG::WriteHandleKey< xAOD::FlowElementContainer > m_neutralFEMLContainerWriteHandleKey
WriteHandleKey for neutral FE.
Definition
PFOClusterMLCorrectionAlgorithm.h:41
PFOClusterMLCorrectionAlgorithm::m_correctionTool
ToolHandle< IPFOContainerCorrectionTool > m_correctionTool
Definition
PFOClusterMLCorrectionAlgorithm.h:35
PFOClusterMLCorrectionAlgorithm::initialize
StatusCode initialize()
Definition
PFOClusterMLCorrectionAlgorithm.cxx:8
PFOClusterMLCorrectionAlgorithm::m_chargedFEContainerReadHandleKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_chargedFEContainerReadHandleKey
Definition
PFOClusterMLCorrectionAlgorithm.h:39
PFOClusterMLCorrectionAlgorithm::m_chargedFEMLContainerWriteHandleKey
SG::WriteHandleKey< xAOD::FlowElementContainer > m_chargedFEMLContainerWriteHandleKey
Definition
PFOClusterMLCorrectionAlgorithm.h:42
PFOClusterMLCorrectionAlgorithm::execute
StatusCode execute(const EventContext &ctx) const
Definition
PFOClusterMLCorrectionAlgorithm.cxx:20
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
xAOD::shallowCopy
ShallowCopyResult_t< T > shallowCopy(const T &cont, const EventContext &ctx)
Create a shallow copy of an existing container.
Generated on
for ATLAS Offline Software by
1.17.0