From 87160a1d7c6ffeb124396c2d9e994ffa0a2c23c1 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 12 Apr 2024 11:13:47 -0400
Subject: [PATCH] EventShapeTools: Use Accessor, etc instead of auxdata().

Replace auxdata, etc. with Accessor classes.
Moving to deprecate these usages in the Athena build.
---
 .../EventShapeTools/Root/EventShapeCopier.cxx    | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/Reconstruction/EventShapes/EventShapeTools/Root/EventShapeCopier.cxx b/Reconstruction/EventShapes/EventShapeTools/Root/EventShapeCopier.cxx
index 8cb552485ac3..1beab7ea1739 100644
--- a/Reconstruction/EventShapes/EventShapeTools/Root/EventShapeCopier.cxx
+++ b/Reconstruction/EventShapes/EventShapeTools/Root/EventShapeCopier.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
 */
 
 // EventShapeCopier.cxx 
@@ -10,6 +10,8 @@
 #include "xAODEventShape/EventShapeAuxInfo.h"
 #include "AsgDataHandles/ReadHandle.h"
 #include "AsgDataHandles/WriteHandle.h"
+#include "AthContainers/Accessor.h"
+#include "AthContainers/ConstAccessor.h"
 
 //**********************************************************************
 
@@ -83,9 +85,15 @@ StatusCode EventShapeCopier::fillEventShape(xAOD::EventShape *evs) const {
     return StatusCode::FAILURE;      
   }
 
-  evs->auxdata<float> ("Density")      = inputES->auxdata<float>( m_eventDensityName ) ;
-  evs->auxdata<float> ("DensitySigma") = inputES->auxdata<float>( m_eventDensityName+"Sigma" ) ;
-  evs->auxdata<float> ("DensityArea")  = inputES->auxdata<float>( m_eventDensityName+"Area" ) ;
+  SG::ConstAccessor<float> InputDensityAcc ( m_eventDensityName ) ;
+  SG::ConstAccessor<float> InputDensitySigmaAcc ( m_eventDensityName+"Sigma" ) ;
+  SG::ConstAccessor<float> InputDensityAreaAcc ( m_eventDensityName+"Area" ) ;
+  static const SG::Accessor<float> DensityAcc ( "Density" ) ;
+  static const SG::Accessor<float> DensitySigmaAcc ( "DensitySigma" ) ;
+  static const SG::Accessor<float> DensityAreaAcc ( "DensityArea" ) ;
+  DensityAcc(*evs)      = InputDensityAcc(*inputES);
+  DensitySigmaAcc(*evs) = InputDensitySigmaAcc(*inputES);
+  DensityAreaAcc(*evs)  = InputDensityAreaAcc(*inputES);
 
   return StatusCode::SUCCESS;      
 }
-- 
GitLab