From 5380055f92914e0007dc933d0265c3e701cacb69 Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Mon, 16 Dec 2019 16:41:46 +0100 Subject: [PATCH 1/3] AthenaPoolTest: Remove deprecated retrieve of DataHandle. Retrieving a DataHandle is deprecated. This will give a thread-safety warning soon, so change it to an ordinary retrieve. --- .../src/InDetRawDataFakeReader.cxx | 17 ++++------------- .../src/InDetRawDataFakeWriter.cxx | 16 ++++------------ .../src/RDOReaderDoubleSelector.cxx | 15 +++------------ 3 files changed, 11 insertions(+), 37 deletions(-) diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/InDetRawDataFakeReader.cxx b/AtlasTest/DatabaseTest/AthenaPoolTest/src/InDetRawDataFakeReader.cxx index a418aea6ee5d..afdf1b69ba80 100755 --- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/InDetRawDataFakeReader.cxx +++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/InDetRawDataFakeReader.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** @@ -60,18 +60,9 @@ StatusCode InDetRawDataFakeReader::initialize() { ATH_MSG_INFO("InDetRawDataFakeReader::initialize()" ); - // Get the pixel helper from the detector store - const DataHandle<PixelID> pixel_id; - ATH_CHECK( detStore()->retrieve(pixel_id, "PixelID") ); - m_pixelId = pixel_id; - - const DataHandle<SCT_ID> sctId; - ATH_CHECK( detStore()->retrieve(sctId, "SCT_ID") ); - m_sctId = sctId; - - const DataHandle<TRT_ID> trtId; - ATH_CHECK( detStore()->retrieve(trtId, "TRT_ID") ); - m_trtId = trtId; + ATH_CHECK( detStore()->retrieve(m_pixelId, "PixelID") ); + ATH_CHECK( detStore()->retrieve(m_sctId, "SCT_ID") ); + ATH_CHECK( detStore()->retrieve(m_trtId, "TRT_ID") ); return StatusCode::SUCCESS; } diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/InDetRawDataFakeWriter.cxx b/AtlasTest/DatabaseTest/AthenaPoolTest/src/InDetRawDataFakeWriter.cxx index 716b1aa21af0..1c4a16bd26bc 100755 --- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/InDetRawDataFakeWriter.cxx +++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/InDetRawDataFakeWriter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** @@ -55,17 +55,9 @@ StatusCode InDetRawDataFakeWriter::initialize() { ATH_MSG_INFO("InDetRawDataFakeWriter::initialize()" ); - const DataHandle<PixelID> pixel_id; - ATH_CHECK( detStore()->retrieve(pixel_id, "PixelID") ); - m_pixelId = pixel_id; - - const DataHandle<SCT_ID> sct_id; - ATH_CHECK( detStore()->retrieve(sct_id, "SCT_ID") ); - m_sctId = sct_id; - - const DataHandle<TRT_ID> trt_id; - ATH_CHECK( detStore()->retrieve(trt_id, "TRT_ID") ); - m_trtId = trt_id; + ATH_CHECK( detStore()->retrieve(m_pixelId, "PixelID") ); + ATH_CHECK( detStore()->retrieve(m_sctId, "SCT_ID") ); + ATH_CHECK( detStore()->retrieve(m_trtId, "TRT_ID") ); // create the IdentifiableContainers to contain the rdo collections try { diff --git a/AtlasTest/DatabaseTest/AthenaPoolTest/src/RDOReaderDoubleSelector.cxx b/AtlasTest/DatabaseTest/AthenaPoolTest/src/RDOReaderDoubleSelector.cxx index 0e8a48977556..0df2f52dbb82 100644 --- a/AtlasTest/DatabaseTest/AthenaPoolTest/src/RDOReaderDoubleSelector.cxx +++ b/AtlasTest/DatabaseTest/AthenaPoolTest/src/RDOReaderDoubleSelector.cxx @@ -65,18 +65,9 @@ StatusCode RDOReaderDoubleSelector::initialize() { ATH_MSG_INFO("RDOReaderDoubleSelector::initialize()" ); - // Get the pixel helper from the detector store - const DataHandle<PixelID> pixel_id; - ATH_CHECK( detStore()->retrieve(pixel_id, "PixelID") ); - m_pixelId = pixel_id; - - const DataHandle<SCT_ID> sctId; - ATH_CHECK( detStore()->retrieve(sctId, "SCT_ID") ); - m_sctId = sctId; - - const DataHandle<TRT_ID> trtId; - ATH_CHECK( detStore()->retrieve(trtId, "TRT_ID") ); - m_trtId = trtId; + ATH_CHECK( detStore()->retrieve(m_pixelId, "PixelID") ); + ATH_CHECK( detStore()->retrieve(m_sctId, "SCT_ID") ); + ATH_CHECK( detStore()->retrieve(m_trtId, "TRT_ID") ); ATH_CHECK( detStore()->retrieve(m_calocellId, "CaloCell_ID") ); ATH_CHECK( detStore()->retrieve(m_caloMgr) ); -- GitLab From 3eb48bacc132c6a9aa86fb37cc5dc73bc2cb2ca7 Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Mon, 16 Dec 2019 18:44:48 +0100 Subject: [PATCH 2/3] TrigConfigSvc: Remove deprecated retrieve of DataHandle. Retrieving a DataHandle is deprecated. This will give a thread-safety warning soon, so change it to an ordinary retrieve. --- .../TrigConfigSvc/src/DSConfigSvc.cxx | 30 +++++++++---------- .../src/TrigConfDataIOVChanger.cxx | 8 ++--- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.cxx index 0b1d349a7038..b6b0cb0a7ebf 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/DSConfigSvc.cxx @@ -234,7 +234,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // read the runwise configuration keys (master + HLT prescales) if( update_HLTKEYS ) { ATH_MSG_INFO( "Updating trigger configuration: HLT keys" ); - const DataHandle< AthenaAttributeList > keysAttrList; + const AthenaAttributeList* keysAttrList = nullptr; CHECK( m_detstore->retrieve( keysAttrList, TRIGGER_CONF_HLTKEYS ) ); uint32_t old_masterkey = m_masterKey; readHltConfigKeys( *keysAttrList, m_masterKey, m_hltPsKey, m_configSrc ); @@ -261,7 +261,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // read the lb-wise configuration keys (LVL1 prescale key) if( update_LVL1KEY ) { ATH_MSG_INFO( "Updating trigger configuration: LVL1 keys" ); - const DataHandle< AthenaAttributeList > keysAttrList; + const AthenaAttributeList* keysAttrList = nullptr; CHECK( m_detstore->retrieve( keysAttrList, TRIGGER_CONF_LVL1KEY ) ); unsigned int old_l1psk = m_lvl1PsKey; readLvl1ConfigKey( *keysAttrList, m_lvl1PsKey ); @@ -273,7 +273,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // Bunchgroup key if( update_LVL1BGK ) { ATH_MSG_INFO( "Updating trigger configuration: LVL1 bunchgroup keys" ); - const DataHandle< AthenaAttributeList > bgkcoll; + const AthenaAttributeList* bgkcoll = nullptr; CHECK( m_detstore->retrieve( bgkcoll, TRIGGER_CONF_LVL1BGKEY ) ); uint32_t old_lvl1BgKey = m_lvl1BgKey; m_lvl1BgKey = readLvl1BGKey( *bgkcoll ); @@ -285,7 +285,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // HLT PSK if( update_HLTPSK ) { ATH_MSG_INFO( "Updating trigger configuration: HLT prescale key and prescales" ); - const DataHandle< AthenaAttributeList > keysAL; + const AthenaAttributeList* keysAL = nullptr; CHECK( m_detstore->retrieve( keysAL, TRIGGER_CONF_HLTPSK ) ); unsigned int oldPsKey = m_hltPsKey; m_hltPsKey = readHltPrescaleKey( *keysAL ); @@ -304,7 +304,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // read the LVL1 Menu object if( update_LVL1MENU ) { - const DataHandle< CondAttrListCollection > lvl1MenuAttrColl; + const CondAttrListCollection* lvl1MenuAttrColl = nullptr; CHECK( m_detstore->retrieve(lvl1MenuAttrColl, TRIGGER_CONF_LVL1MENU ) ); ATH_MSG_INFO( "Updating trigger configuration: LVL1 menu" ); m_ctpConfig.menu().clear(); @@ -328,7 +328,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // read the LVL1 PITs if( update_LVL1PIT ) { - const DataHandle< CondAttrListCollection > lvl1PitAttrColl; + const CondAttrListCollection* lvl1PitAttrColl = nullptr; CHECK( m_detstore->retrieve( lvl1PitAttrColl, TRIGGER_CONF_LVL1PIT ) ); ATH_MSG_INFO( "Updating trigger configuration: LVL1 PITs" ); CondAttrListCollection::size_type nCh = lvl1PitAttrColl->size(); @@ -355,7 +355,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // read the HLT Menu object if( update_HLTMENU ) { - const DataHandle< CondAttrListCollection > hltMenuAttrColl; + const CondAttrListCollection* hltMenuAttrColl = nullptr; CHECK( m_detstore->retrieve( hltMenuAttrColl, TRIGGER_CONF_HLTMENU ) ); ATH_MSG_INFO( "Updating trigger configuration: HLT menu" ); m_hltFrame.theHLTChainList().clear(); @@ -372,8 +372,8 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { if( update_HLTPS ) { - const DataHandle< CondAttrListCollection > prescaleAL; - const DataHandle< CondAttrListCollection > hltMenuAttrColl; + const CondAttrListCollection* prescaleAL = nullptr; + const CondAttrListCollection* hltMenuAttrColl = nullptr; CHECK( m_detstore->retrieve( prescaleAL, TRIGGER_CONF_HLTPS ) ); CHECK( m_detstore->retrieve( hltMenuAttrColl, TRIGGER_CONF_HLTMENU ) ); ATH_MSG_INFO( "Updating trigger configuration: HLT prescale key and prescales" ); @@ -419,7 +419,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // read the lb-wise prescale set object if( update_LVL1PS ) { - const DataHandle< CondAttrListCollection > lvl1PsAtrColl; + const CondAttrListCollection* lvl1PsAtrColl = nullptr; CHECK( m_detstore->retrieve( lvl1PsAtrColl, TRIGGER_CONF_LVL1PS ) ); ATH_MSG_INFO( "Updating trigger configuration: LVL1 prescales" ); CondAttrListCollection::size_type nCh = lvl1PsAtrColl->size(); @@ -454,7 +454,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { if( update_HLTGRP ) { - const DataHandle< CondAttrListCollection > hltgrpAtrColl; + const CondAttrListCollection* hltgrpAtrColl = nullptr; CHECK( m_detstore->retrieve( hltgrpAtrColl, TRIGGER_CONF_HLTGRP ) ); ATH_MSG_INFO( "Updating trigger configuration: HLT chain groups" ); size_t nGroups(0); @@ -468,7 +468,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { if( update_LVL1THR ) { - const DataHandle< CondAttrListCollection > l1thrAtrColl; + const CondAttrListCollection* l1thrAtrColl = nullptr; CHECK( m_detstore->retrieve( l1thrAtrColl, TRIGGER_CONF_LVL1THR ) ); ATH_MSG_INFO( "Updating trigger configuration: LVL1 thresholds" ); CondAttrListCollection::size_type nCh = l1thrAtrColl->size(); @@ -536,7 +536,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { if( update_LVL1ITD ) { - const DataHandle< CondAttrListCollection > l1itemdefAttrColl; + const CondAttrListCollection* l1itemdefAttrColl = nullptr; CHECK( m_detstore->retrieve( l1itemdefAttrColl, TRIGGER_CONF_LVL1ITD ) ); ATH_MSG_INFO( "Updating trigger configuration: LVL1 item definition" ); @@ -556,7 +556,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // Bunchgroup content if( update_LVL1BGC ) { - const DataHandle< AthenaAttributeList > bgcontlist; + const AthenaAttributeList* bgcontlist = nullptr; CHECK( m_detstore->retrieve( bgcontlist, TRIGGER_CONF_LVL1BGDEF ) ); ATH_MSG_INFO( "Updating trigger configuration: LVL1 bunchgroup definition (BG names)" ); std::vector< TrigConf::BunchGroup > bgs = readLvl1BGContent( *bgcontlist ); @@ -566,7 +566,7 @@ TrigConf::DSConfigSvc::update( IOVSVC_CALLBACK_ARGS_K( keys ) ) { // Bunchgroup description if( update_LVL1BGD ) { - const DataHandle< AthenaAttributeList > bgdesclist; + const AthenaAttributeList* bgdesclist = nullptr; CHECK( m_detstore->retrieve( bgdesclist, TRIGGER_CONF_LVL1BGDESC ) ); ATH_MSG_INFO( "Updating trigger configuration: LVL1 bunchgroup description " << "(name + item)" ); diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.cxx b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.cxx index 95a439e3d216..58652697b275 100644 --- a/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.cxx +++ b/Trigger/TrigConfiguration/TrigConfigSvc/src/TrigConfDataIOVChanger.cxx @@ -111,8 +111,8 @@ TrigConf::TrigConfDataIOVChanger::execute() { // (perhaps at some point a forced copy flag // will be implemented, but for now...) // ---------------------------------------- - const DataHandle<CondAttrListCollection> listColl; - const DataHandle<AthenaAttributeList> attList; + const CondAttrListCollection* listColl = nullptr; + const AthenaAttributeList* attList = nullptr; if( detStore()->retrieve(listColl, TRIGGER_CONF_HLTMENU ).isSuccess() && listColl) { ATH_MSG_INFO("Triggered reading of " << TRIGGER_CONF_HLTMENU); @@ -165,8 +165,8 @@ TrigConf::TrigConfDataIOVChanger::execute() { // Second retrieve all meta data containers from the MetaDataStore // (the one that goes out into the ESD/AOD) - const DataHandle<IOVMetaDataContainer> cont; - const DataHandle<IOVMetaDataContainer> contEnd; + SG::ConstIterator<IOVMetaDataContainer> cont; + SG::ConstIterator<IOVMetaDataContainer> contEnd; CHECK(m_metaDataStore->retrieve(cont, contEnd)); -- GitLab From 9d1652cd7b33d58ea104d972e61fe04e1af0bf64 Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Mon, 16 Dec 2019 16:44:30 +0100 Subject: [PATCH 3/3] AthenaServices: Remove deprecated retrieve of DataHandle. Retrieving a DataHandle is deprecated. This will give a thread-safety warning soon, so change it to an ordinary retrieve. --- Control/AthenaServices/src/AthenaOutputStreamTool.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Control/AthenaServices/src/AthenaOutputStreamTool.cxx b/Control/AthenaServices/src/AthenaOutputStreamTool.cxx index 8382bd1fedba..09ac8d7afcbe 100644 --- a/Control/AthenaServices/src/AthenaOutputStreamTool.cxx +++ b/Control/AthenaServices/src/AthenaOutputStreamTool.cxx @@ -277,7 +277,7 @@ StatusCode AthenaOutputStreamTool::connectOutput(const std::string& outputName) ATH_MSG_DEBUG("Added stream decision for " << *it << " to " << m_attrListKey); } // record new attribute list with old key + suffix - const DataHandle<AthenaAttributeList> attrList2; + const AthenaAttributeList* attrList2 = nullptr; if (!m_store->contains<AthenaAttributeList>(m_attrListWrite)) { if (m_store->record(newone,m_attrListWrite).isFailure()) { ATH_MSG_ERROR("Unable to record att list " << m_attrListWrite); -- GitLab