From 81a170705b5840c6ea7f843b412d7c111f02436e Mon Sep 17 00:00:00 2001 From: scott snyder <snyder@bnl.gov> Date: Thu, 3 Dec 2020 17:40:51 +0100 Subject: [PATCH] CaloAthenaPool: Update tower builder tool interfaces. Update the tower builder tool interfaces to pass the EventContext to the execute() methods. Should save some TLS looksups. --- .../CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx | 6 ++++-- .../CaloAthenaPool/src/CaloTowerContainerCnv.cxx | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx b/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx index 886867e422d..e8970d9d061 100644 --- a/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx +++ b/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTopoTowerContainerCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CaloTopoTowerContainerCnv.h" @@ -10,6 +10,7 @@ // Gaudi #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/IToolSvc.h" +#include "GaudiKernel/ThreadLocalContext.h" // Athena #include "CaloUtils/CaloTopoTowerBuilderToolBase.h" @@ -70,6 +71,7 @@ CaloTopoTowerContainer* CaloTopoTowerContainerCnv::createTransient() { Cont->init(); // rebuild the CaloTopoTowers in the container. + const EventContext& ctx = Gaudi::Hive::currentContext(); m_TopoTowerBldr= getTool("CaloTopoTowerBuilderTool","TopoTowerTwrBldr"); if(!m_TopoTowerBldr){ @@ -77,7 +79,7 @@ CaloTopoTowerContainer* CaloTopoTowerContainerCnv::createTransient() { return 0; } if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "creating CaloTopoTowerContainerCnv::PoolToDataObject" << endmsg; - StatusCode scfcal = m_TopoTowerBldr->execute(Cont); + StatusCode scfcal = m_TopoTowerBldr->execute(ctx, Cont); if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<" TopoTowers rebuild m_TopoTowerBldr->execute(Cont); Successful "<<endmsg; if (scfcal.isFailure()) { log<<MSG::ERROR<<" TopoTowers rebuild failed "<<endmsg; diff --git a/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTowerContainerCnv.cxx b/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTowerContainerCnv.cxx index 709367333d7..ba46efa930b 100644 --- a/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTowerContainerCnv.cxx +++ b/Calorimeter/CaloCnv/CaloAthenaPool/src/CaloTowerContainerCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "CaloTowerContainerCnv.h" @@ -10,6 +10,7 @@ // Gaudi #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/IToolSvc.h" +#include "GaudiKernel/ThreadLocalContext.h" // Athena #include "CaloUtils/CaloTowerBuilderToolBase.h" @@ -48,6 +49,7 @@ CaloTowerContainerCnv::~CaloTowerContainerCnv() //StatusCode CaloTowerContainerCnv::PoolToDataObject(DataObject*& pObj,const std::string &token) CaloTowerContainer* CaloTowerContainerCnv::createTransient() { + const EventContext& ctx = Gaudi::Hive::currentContext(); MsgStream log(msgSvc(), "CaloTowerContainerCnv::createTransient" ); CaloTowerContainer* Cont = 0; @@ -106,7 +108,7 @@ CaloTowerContainer* CaloTowerContainerCnv::createTransient() { } } if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<" Towers rebuild for FCAL "<<endmsg; - StatusCode scfcal = m_fcalTowerBldr->execute(Cont); + StatusCode scfcal = m_fcalTowerBldr->execute(ctx, Cont); if (scfcal.isFailure()) { log<<MSG::ERROR<<" Towers rebuild for FCAL failed "<<endmsg; } @@ -122,7 +124,7 @@ CaloTowerContainer* CaloTowerContainerCnv::createTransient() { } } if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<" Towers rebuild for Tile "<<endmsg; - StatusCode sctile=m_tileTowerBldr->execute(Cont); + StatusCode sctile=m_tileTowerBldr->execute(ctx, Cont); if (sctile.isFailure()) { log<<MSG::ERROR<<" Towers rebuild for Tile failed "<<endmsg; } @@ -142,7 +144,7 @@ CaloTowerContainer* CaloTowerContainerCnv::createTransient() { } if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<" Towers rebuild for EM and/or HEC "<<endmsg; m_emHecTowerBldr->setCalos(EmHec); - StatusCode scemHec=m_emHecTowerBldr->execute(Cont); + StatusCode scemHec=m_emHecTowerBldr->execute(ctx, Cont); if (scemHec.isFailure()) { log<<MSG::ERROR<<" Towers rebuild for EM and/or HEC failed "<<endmsg; } -- GitLab