15 const std::string& name,
16 const IInterface* parent):
20 declareInterface<CaloClusterCollectionProcessor> (
this);
40 return StatusCode::SUCCESS;
58 const size_t nClusters=clusColl->
size();
59 if (nClusters!=outputColl->size()) {
60 ATH_MSG_ERROR(
"After copy of container: Unequal number of entries! Original " << nClusters <<
", copy " << outputColl->size());
61 return StatusCode::FAILURE;
67 for (
size_t i=0;i<nClusters;++i) {
68 (*clusColl)[i]->setSisterClusterLink(
ClusterLink_t(outputEL, i));
75 for (
size_t i=0;i<nClusters;++i) {
76 (*outputColl)[i]->setSisterClusterLink(
ClusterLink_t(finalEL, i));
81 ATH_MSG_DEBUG(
"Can't set element link from snapshot to final cluster, likely mismatch in the FinalClusterContainerName");
91 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Helpers for checking error return status codes and reporting errors.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *) const override
Execute on an entire collection of clusters.
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_cellLinkOutputKey
virtual ~CaloClusterSnapshot() override
virtual StatusCode initialize() override
CaloClusterSnapshot(const std::string &type, const std::string &name, const IInterface *parent)
std::string m_finalContName
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outputKey
static void copyContainer(const xAOD::CaloClusterContainer *oldColl, xAOD::CaloClusterContainer *newColl)
Deep copy of a cluster container.
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.
bool isValid() const
Check if the element can be found.
const std::string & name() const
Return the StoreGate ID for the referenced object.
pointer_type ptr()
Dereference the pointer.
ElementLink< xAOD::CaloClusterContainer > ClusterLink_t
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.