diff --git a/LArCalorimeter/LArTest/LArSCellTest/src/NoiseStudy.cxx b/LArCalorimeter/LArTest/LArSCellTest/src/NoiseStudy.cxx index 28c25e86ca307036648e0637fa46dfb9a39e799c..310ef13f29e902f2d2cddd46f0993879e4d89015 100644 --- a/LArCalorimeter/LArTest/LArSCellTest/src/NoiseStudy.cxx +++ b/LArCalorimeter/LArTest/LArSCellTest/src/NoiseStudy.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ @@ -15,7 +15,6 @@ #include "NoiseStudy.h" #include "CaloIdentifier/CaloCell_SuperCell_ID.h" #include "CaloIdentifier/CaloIdManager.h" -#include "CaloDetDescr/CaloDetDescrManager.h" #include "TFile.h" #include "TH1F.h" #include "TH2F.h" @@ -45,10 +44,8 @@ StatusCode NoiseStudy::initialize(){ if ( m_scidtool.retrieve().isFailure() ){ ATH_MSG_ERROR("cannot perform comparisons between cell and SuperCells"); } - const CaloIdManager* caloMgr; - const CaloSuperCellDetDescrManager* sem_mgr; - ATH_CHECK( detStore()->retrieve (sem_mgr, "CaloSuperCellMgr") ); - + + const CaloIdManager* caloMgr; CHECK( detStore()->retrieve(caloMgr) ); // @@ -70,6 +67,7 @@ StatusCode NoiseStudy::initialize(){ ATH_CHECK( m_cellContainerInKey.initialize() ); ATH_CHECK( m_evtInKey.initialize() ); ATH_CHECK( m_truthInKey.initialize() ); + ATH_CHECK( m_caloSuperCellMgrKey.initialize() ); return StatusCode::SUCCESS; } @@ -84,8 +82,8 @@ StatusCode NoiseStudy::finalize(){ StatusCode NoiseStudy::execute(const EventContext& context) const{ ATH_MSG_DEBUG ("execute NoiseStudy" ); - const CaloSuperCellDetDescrManager* sem_mgr; - ATH_CHECK( detStore()->retrieve (sem_mgr, "CaloSuperCellMgr") ); + SG::ReadCondHandle<CaloSuperCellDetDescrManager> caloSuperCellMgrHandle{m_caloSuperCellMgrKey,context}; + const CaloSuperCellDetDescrManager* sem_mgr = *caloSuperCellMgrHandle; std::default_random_engine generator; // Not really a condition, but almost const CaloBCIDAverage* caloLumiBCID = nullptr; diff --git a/LArCalorimeter/LArTest/LArSCellTest/src/NoiseStudy.h b/LArCalorimeter/LArTest/LArSCellTest/src/NoiseStudy.h index a809ed6311a94a76ff1fdcccdc785fd175c3d76f..d5af31f9985d0e62b3da568e6d432d74f5e03720 100644 --- a/LArCalorimeter/LArTest/LArSCellTest/src/NoiseStudy.h +++ b/LArCalorimeter/LArTest/LArSCellTest/src/NoiseStudy.h @@ -27,6 +27,8 @@ #include "xAODTruth/TruthParticleContainer.h" #include "xAODTracking/VertexContainer.h" #include "xAODEventInfo/EventInfo.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "CaloDetDescr/CaloDetDescrManager.h" class TFile; class TH1I; class TH1F; @@ -85,6 +87,8 @@ private : { this, "TruthInfoKey", "TruthParticles", "SG key for the input TruthParticles container"}; + SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> m_caloSuperCellMgrKey{ + this,"CaloSuperCellDetDescrManager","CaloSuperCellDetDescrManager","SG key of the resulting CaloSuperCellDetDescrManager"}; const CaloCell_SuperCell_ID* m_schelper;