7#include "AthLinks/ElementLink.h"
14 ISvcLocator* pSvcLocator)
34 return StatusCode::SUCCESS;
45 ATH_MSG_DEBUG(
"Retrieved " << spacePoints->size() <<
" elements from space point container");
47 ATH_MSG_DEBUG(
"Reading decoration to space point collection: element links to clusters");
49 using link_type = std::vector< ElementLink<xAOD::UncalibratedMeasurementContainer> >;
52 if (not elementLinksToClusters.isAvailable()) {
53 ATH_MSG_DEBUG(
"Decoration missing: " <<
m_linkDecoration.key() <<
". This may indicate file corruption or non standard processing upstream.");
56 ATH_MSG_DEBUG(
"Adding decoration to space point collection: bare pointers to clusters");
58 using decoration_type = std::vector<const xAOD::UncalibratedMeasurement*>;
62 ATH_MSG_DEBUG(
"Retrieving Element Links to Clusters from the Space Points and attaching the bare pointers to the object");
64 const link_type els = elementLinksToClusters.isAvailable()
65 ? elementLinksToClusters(*
sp)
68 std::vector< const xAOD::UncalibratedMeasurement* > meas;
69 meas.reserve(els.size());
74 barePointersToClusters(*
sp) = std::move(meas);
77 ATH_MSG_DEBUG(
"Decorations have been attached to space point collection");
78 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading a decoration on an object.
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadDecorHandleKey< xAOD::SpacePointContainer > m_linkDecoration
SpacePointReader(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::SpacePointContainer > m_spacePointKey
SG::WriteDecorHandleKey< xAOD::SpacePointContainer > m_clusterDecoration
virtual StatusCode execute(const EventContext &) const override
virtual StatusCode initialize() override
Handle class for reading a decoration on an object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
Handle class for adding a decoration to an object.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
SpacePointContainer_v1 SpacePointContainer
Define the version of the space point container.