ATLAS Offline Software
Loading...
Searching...
No Matches
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
8
10
13
14 return StatusCode::SUCCESS;
15}
16
17StatusCode PFLCNeutralFlowElementCreatorAlgorithm::execute(const EventContext& ctx) const {
18
19 ATH_MSG_DEBUG("Executing");
20
21 /* Create Neutral PFOs from all eflowCaloObjects */
23
25 xAOD::shallowCopy(*neutralFEContainerReadHandle, ctx);
26
28 ATH_CHECK( neutralFELCContainerWriteHandle.record(std::move(shallowCopyPair.first),std::move(shallowCopyPair.second)));
29
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("FEShowerSubtractedClusterLink");
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
SG::WriteHandleKey< xAOD::FlowElementContainer > m_neutralFELCContainerWriteHandleKey
WriteHandleKey for neutral FE.
SG::ReadHandleKey< xAOD::FlowElementContainer > m_neutralFEContainerReadHandleKey
ReadHandleKey for eflowCaloObjectContainer.
Helper class to provide type-safe access to aux data.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void setP4(float pt, float eta, float phi, float m)
typename ShallowCopyResult< T >::type ShallowCopyResult_t
Return type of xAOD::shallowCopy.
Definition ShallowCopy.h:68
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition FlowElement.h:16
ShallowCopyResult_t< T > shallowCopy(const T &cont, const EventContext &ctx)
Create a shallow copy of an existing container.