Skip to content
Snippets Groups Projects
Commit 7a6776af authored by Scott Snyder's avatar Scott Snyder Committed by Johannes Elmsheuser
Browse files

ActsMonitoring+InDetConversionFinderTools: Use Accessor, etc instead of auxdata().

ActsMonitoring: Use Accessor, etc instead of auxdata().

Replace auxdata, etc. with Accessor classes.
Moving to deprecate these usages in the Athena build.
parent 0d2ebd75
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
/***************************************************************************
......@@ -14,6 +14,7 @@
#include "AthLinks/ElementLink.h"
#include "TrkTrack/LinkToTrack.h"
#include "AthContainers/Accessor.h"
#include <vector>
#include <utility>
......@@ -243,12 +244,14 @@ InDetConversionFinderTools::InDetConversionFinderTools(const std::string& t,
"Decorating vertex with values used in track pair selector");
for (const auto& kv :
m_trackPairsSelector->getLastValues(cache)) {
myVertex->auxdata<float>(kv.first) = kv.second;
SG::Accessor<float> acc (kv.first);
acc (*myVertex) = kv.second;
}
ATH_MSG_DEBUG("Decorating vertex with values used in vertex "
"point estimator");
for (const auto& kv : intersectionDecors) {
myVertex->auxdata<float>(kv.first) = kv.second;
SG::Accessor<float> acc (kv.first);
acc (*myVertex) = kv.second;
}
}
......@@ -321,13 +324,17 @@ InDetConversionFinderTools::InDetConversionFinderTools(const std::string& t,
if (m_decorateVertices) {
ATH_MSG_DEBUG("Decorating single track vertex with dummy values "
"used in track pair selector");
for (const auto& kv : m_trackPairsSelector->getLastValues(cache))
sConver->auxdata<float>(kv.first) = 0.;
for (const auto& kv : m_trackPairsSelector->getLastValues(cache)) {
SG::Accessor<float> acc (kv.first);
acc (*sConver) = 0.;
}
ATH_MSG_DEBUG("Decorating single track vertex with dummy values "
"used in vertex point estimator");
for (const std::string& k : m_vertexEstimator->decorKeys())
sConver->auxdata<float>(k) = 0.;
for (const std::string& k : m_vertexEstimator->decorKeys()) {
SG::Accessor<float> acc (k);
acc (*sConver) = 0.;
}
ATH_MSG_DEBUG("Decorating single track vertex with dummy values "
"used in post selector");
......
......@@ -13,6 +13,7 @@
#include "Acts/Definitions/Units.hpp"
#include "Acts/MagneticField/MagneticFieldContext.hpp"
#include "ActsGeometry/ATLASMagneticFieldWrapper.h"
#include "AthContainers/ConstAccessor.h"
namespace ActsTrk {
......@@ -302,11 +303,11 @@ namespace ActsTrk {
const Identifier SeedAnalysisAlg::identify(const xAOD::PixelCluster& cluster) const
{
static const SG::AuxElement::Accessor< ElementLink< InDet::PixelClusterCollection > > pixelLinkAcc("pixelClusterLink");
static const SG::ConstAccessor< ElementLink< InDet::PixelClusterCollection > > pixelLinkAcc("pixelClusterLink");
// TO-DO -- AODs will not have this decoration, we'll need to provide a function for recomputing
// the identifier from local position
if (not cluster.isAvailable< ElementLink< InDet::PixelClusterCollection > >("pixelClusterLink"))
if (not pixelLinkAcc.isAvailable (cluster))
return Identifier();
ElementLink<InDet::PixelClusterCollection> pixelLink = pixelLinkAcc(cluster);
......@@ -315,11 +316,11 @@ namespace ActsTrk {
const Identifier SeedAnalysisAlg::identify(const xAOD::StripCluster& cluster) const
{
static const SG::AuxElement::Accessor< ElementLink< InDet::SCT_ClusterCollection > > stripLinkAcc("sctClusterLink");
static const SG::ConstAccessor< ElementLink< InDet::SCT_ClusterCollection > > stripLinkAcc("sctClusterLink");
// TO-DO -- AODs will not have this decoration, we'll need to provide a function for recomputing
// the identifier from local position
if (not cluster.isAvailable< ElementLink< InDet::SCT_ClusterCollection > >("sctClusterLink"))
if (not stripLinkAcc.isAvailable (cluster))
return Identifier();
ElementLink<InDet::SCT_ClusterCollection> stripLink = stripLinkAcc(cluster);
......
......@@ -9,6 +9,7 @@
#include "xAODInDetMeasurement/ContainerAccessor.h"
#include "xAODMeasurementBase/UncalibratedMeasurementContainer.h"
#include "StoreGate/ReadDecorHandle.h"
#include "AthContainers/ConstAccessor.h"
namespace ActsTrk {
SpacePointAnalysisAlg::SpacePointAnalysisAlg(const std::string& name, ISvcLocator *pSvcLocator)
......@@ -63,8 +64,9 @@ namespace ActsTrk {
using decoration_type = std::vector<const xAOD::UncalibratedMeasurement*>;
SG::ReadDecorHandle< xAOD::SpacePointContainer,
decoration_type > barePointersToClusters( m_clusterDecoration, ctx );
static const SG::ConstAccessor<decoration_type> measurementsAcc ("measurements");
if ( not barePointersToClusters.isAvailable() and
not inputSpacePointCollection->front()->isAvailable<decoration_type>("measurements") ) {
not measurementsAcc.isAvailable (*inputSpacePointCollection->front()) ) {
ATH_MSG_ERROR("Space Point Collection does not have decoration 'measurements', which should contain a vector of bare pointes to clusters");
return StatusCode::FAILURE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment