ATLAS Offline Software
PFOClusterMLCorrectionAlgorithm.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "xAODCore/ShallowCopy.h"
7 
9 {
10  ATH_MSG_DEBUG("Initializing");
11  ATH_CHECK(m_correctionTool.retrieve());
16 
17  return StatusCode::SUCCESS;
18 }
19 
21 {
22 
23  ATH_MSG_DEBUG("Executing");
24 
27 
28  return StatusCode::SUCCESS;
29 }
30 
32  // Just a shallow copy, no modifications
34 
35  std::pair<xAOD::FlowElementContainer *, xAOD::ShallowAuxContainer *> shallowCopyPair = xAOD::shallowCopyContainer(*chargedFEContainerReadHandle);
36  std::unique_ptr<xAOD::FlowElementContainer> chargedFEMLContainer{shallowCopyPair.first};
37  std::unique_ptr<xAOD::ShallowAuxContainer> chargedFEMLContainerAux{shallowCopyPair.second};
38 
40  ATH_CHECK(chargedFEMLContainerWriteHandle.record(std::move(chargedFEMLContainer), std::move(chargedFEMLContainerAux)));
41 
42  return StatusCode::SUCCESS;
43 }
44 
46 
47  // Shallow copy step
49  std::pair<xAOD::FlowElementContainer *, xAOD::ShallowAuxContainer *> shallowCopyPair = xAOD::shallowCopyContainer(*neutralFEContainerReadHandle);
50  std::unique_ptr<xAOD::FlowElementContainer> neutralFEMLContainer{shallowCopyPair.first};
51  std::unique_ptr<xAOD::ShallowAuxContainer> neutralFEMLContainerAux{shallowCopyPair.second};
52 
53  // Modification step
54  m_correctionTool->correctContainer(*neutralFEMLContainer);
55 
56  // Registration of results step
58  ATH_CHECK(neutralFEMLContainerWriteHandle.record(std::move(neutralFEMLContainer), std::move(neutralFEMLContainerAux)));
59 
60  return StatusCode::SUCCESS;
61 }
ShallowCopy.h
PFOClusterMLCorrectionAlgorithm::initialize
StatusCode initialize()
Definition: PFOClusterMLCorrectionAlgorithm.cxx:8
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
PFOClusterMLCorrectionAlgorithm::m_chargedFEMLContainerWriteHandleKey
SG::WriteHandleKey< xAOD::FlowElementContainer > m_chargedFEMLContainerWriteHandleKey
Definition: PFOClusterMLCorrectionAlgorithm.h:45
PFOClusterMLCorrectionAlgorithm::shallowCopyChargedFEContainer
StatusCode shallowCopyChargedFEContainer(const EventContext &ctx) const
Definition: PFOClusterMLCorrectionAlgorithm.cxx:31
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PFOClusterMLCorrectionAlgorithm::m_neutralFEContainerReadHandleKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_neutralFEContainerReadHandleKey
ReadHandleKey for eflowCaloObjectContainer.
Definition: PFOClusterMLCorrectionAlgorithm.h:41
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
PFOClusterMLCorrectionAlgorithm::shallowCopyAndModifyNeutralFEContainer
StatusCode shallowCopyAndModifyNeutralFEContainer(const EventContext &ctx) const
Definition: PFOClusterMLCorrectionAlgorithm.cxx:45
PFOClusterMLCorrectionAlgorithm.h
PFOClusterMLCorrectionAlgorithm::m_correctionTool
ToolHandle< IPFOContainerCorrectionTool > m_correctionTool
Definition: PFOClusterMLCorrectionAlgorithm.h:38
xAOD::shallowCopyContainer
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
Definition: ShallowCopy.h:110
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.
PFOClusterMLCorrectionAlgorithm::m_neutralFEMLContainerWriteHandleKey
SG::WriteHandleKey< xAOD::FlowElementContainer > m_neutralFEMLContainerWriteHandleKey
WriteHandleKey for neutral FE.
Definition: PFOClusterMLCorrectionAlgorithm.h:44
PFOClusterMLCorrectionAlgorithm::execute
StatusCode execute(const EventContext &ctx) const
Definition: PFOClusterMLCorrectionAlgorithm.cxx:20
PFOClusterMLCorrectionAlgorithm::m_chargedFEContainerReadHandleKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_chargedFEContainerReadHandleKey
Definition: PFOClusterMLCorrectionAlgorithm.h:42