 |
ATLAS Offline Software
|
Go to the documentation of this file.
15 return StatusCode::SUCCESS;
26 std::pair<xAOD::FlowElementContainer *, xAOD::ShallowAuxContainer *> shallowCopyPair =
xAOD::shallowCopyContainer(*neutralFEContainerReadHandle);
27 std::unique_ptr<xAOD::FlowElementContainer> neutralFEMLContainer{shallowCopyPair.first};
28 std::unique_ptr<xAOD::ShallowAuxContainer> neutralFEMLContainerAux{shallowCopyPair.second};
30 ATH_CHECK(neutralFEMLContainerWriteHandle.
record(std::move(neutralFEMLContainer), std::move(neutralFEMLContainerAux)));
46 return StatusCode::SUCCESS;
55 const double clusterEMEnergy =
cls.rawE();
56 const double clusterAltEnergy =
cls.altE();
57 const double scaleFactor = clusterEMEnergy != 0 ? clusterAltEnergy / clusterEMEnergy : 1.0;
59 pfo.
setP4(pfo.
pt() * scaleFactor, pfo.
eta(), pfo.
phi(), pfo.
m() * scaleFactor);
67 const std::vector<ElementLink<xAOD::IParticleContainer>> &otherObjectLinks = pfo.
otherObjectLinks();
68 if (otherObjectLinks.size() > 1)
69 ATH_MSG_ERROR(
"Multiple links found for neutral FlowElement with index " << pfo.
index());
71 bool hasValidLink = !otherObjectLinks.empty() && otherObjectLinks[0].isValid();
75 ATH_MSG_ERROR(
"Link for neutral FlowElement with index " << pfo.
index() <<
" is not of type CaloCluster");
76 return otherObjectLinks[0];
virtual double m() const override
The invariant mass of the particle.
void scaleEnergyToAlternativeSignalState(xAOD::FlowElement &pfo, const xAOD::CaloCluster &cls) const
const std::vector< ElementLink< IParticleContainer > > & otherObjectLinks() const
virtual double phi() const override
The azimuthal angle ( ) of the particle.
virtual double pt() const override
bool isValid() const
Test to see if the link can be dereferenced.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Description of a calorimeter cluster.
SG::WriteHandleKey< xAOD::FlowElementContainer > m_neutralFEMLContainerWriteHandleKey
WriteHandleKey for neutral FE.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode execute(const EventContext &ctx) const
size_t index() const
Return the index of this element within its container.
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.
virtual double eta() const override
The pseudorapidity ( ) of the particle.
SG::ReadHandleKey< xAOD::FlowElementContainer > m_neutralFEContainerReadHandleKey
ReadHandleKey for eflowCaloObjectContainer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void setP4(float pt, float eta, float phi, float m)
ElementLink< xAOD::IParticleContainer > getClusterLink(const xAOD::FlowElement &pfo) const
A detector object made of other lower level object(s)