ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
PFLCNeutralFlowElementCreatorAlgorithm.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 "
PFLCNeutralFlowElementCreatorAlgorithm.h
"
6
#include "
xAODCore/ShallowCopy.h
"
7
#include "
xAODCaloEvent/CaloClusterContainer.h
"
8
9
StatusCode
PFLCNeutralFlowElementCreatorAlgorithm::initialize
(){
10
11
ATH_CHECK
(
m_neutralFEContainerReadHandleKey
.initialize());
12
ATH_CHECK
(
m_neutralFELCContainerWriteHandleKey
.initialize());
13
14
return
StatusCode::SUCCESS;
15
}
16
17
StatusCode
PFLCNeutralFlowElementCreatorAlgorithm::execute
(
const
EventContext& ctx)
const
{
18
19
ATH_MSG_DEBUG
(
"Executing"
);
20
21
/* Create Neutral PFOs from all eflowCaloObjects */
22
SG::ReadHandle<xAOD::FlowElementContainer>
neutralFEContainerReadHandle(
m_neutralFEContainerReadHandleKey
,ctx);
23
24
xAOD::ShallowCopyResult_t<xAOD::FlowElementContainer>
shallowCopyPair =
25
xAOD::shallowCopy
(*neutralFEContainerReadHandle, ctx);
26
27
SG::WriteHandle<xAOD::FlowElementContainer>
neutralFELCContainerWriteHandle(
m_neutralFELCContainerWriteHandleKey
,ctx);
28
ATH_CHECK
( neutralFELCContainerWriteHandle.
record
(std::move(shallowCopyPair.first),std::move(shallowCopyPair.second)));
29
const
std::string clusterLinkStr{
"FEShowerSubtractedClusterLink"
};
30
for
(
unsigned
int
counter = 0; counter < (*neutralFEContainerReadHandle).size(); counter++){
31
const
xAOD::FlowElement
* thisFE = (*neutralFEContainerReadHandle)[counter];
32
33
const
static
SG::Accessor<ElementLink<xAOD::CaloClusterContainer>
> accShowerSubtractedClusterLink(clusterLinkStr);
34
const
ElementLink<xAOD::CaloClusterContainer>
& clusElementLink = accShowerSubtractedClusterLink(*thisFE);
35
36
xAOD::FlowElement
* theCopiedFE = (*neutralFELCContainerWriteHandle)[counter];
37
//be careful here - cluster p4 methods do not store sign. Thus -ve energy clusters have +ve pt and hence +ve energy
38
//we use eta,phi at EM scale for both 4-vectors - standard FE are at EM scale
39
theCopiedFE->
setP4
((*clusElementLink)->pt(), (*clusElementLink)->rawEta(), (*clusElementLink)->rawPhi(), (*clusElementLink)->m());
40
}
41
42
43
return
StatusCode::SUCCESS;
44
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloClusterContainer.h
PFLCNeutralFlowElementCreatorAlgorithm.h
ShallowCopy.h
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
PFLCNeutralFlowElementCreatorAlgorithm::initialize
StatusCode initialize()
Definition
PFLCNeutralFlowElementCreatorAlgorithm.cxx:9
PFLCNeutralFlowElementCreatorAlgorithm::execute
StatusCode execute(const EventContext &ctx) const
Definition
PFLCNeutralFlowElementCreatorAlgorithm.cxx:17
PFLCNeutralFlowElementCreatorAlgorithm::m_neutralFELCContainerWriteHandleKey
SG::WriteHandleKey< xAOD::FlowElementContainer > m_neutralFELCContainerWriteHandleKey
WriteHandleKey for neutral FE.
Definition
PFLCNeutralFlowElementCreatorAlgorithm.h:32
PFLCNeutralFlowElementCreatorAlgorithm::m_neutralFEContainerReadHandleKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_neutralFEContainerReadHandleKey
ReadHandleKey for eflowCaloObjectContainer.
Definition
PFLCNeutralFlowElementCreatorAlgorithm.h:29
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition
Control/AthContainers/AthContainers/Accessor.h:68
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::FlowElement_v1::setP4
void setP4(float pt, float eta, float phi, float m)
Definition
FlowElement_v1.cxx:39
xAOD::ShallowCopyResult_t
typename ShallowCopyResult< T >::type ShallowCopyResult_t
Return type of xAOD::shallowCopy.
Definition
ShallowCopy.h:68
xAOD::FlowElement
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition
FlowElement.h:16
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