diff --git a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/python/LArGMConfig.py b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/python/LArGMConfig.py index 52f3027a4367b67485e2aa1ae5bdb88f60b6d0e1..b637d90f11978126b94ac9010d2ae29eb3ce0c4f 100644 --- a/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/python/LArGMConfig.py +++ b/LArCalorimeter/LArGeoModel/LArGeoAlgsNV/python/LArGMConfig.py @@ -47,7 +47,7 @@ def LArGMCfg(configFlags): sCellsInInput = True AthReadAlg_ExtraInputs.append(('CaloDetDescrManager', 'ConditionStore+CaloDetDescrManager')) - if (configFlags.GeoModel.Run is LHCPeriod.Run3 and configFlags.Detector.GeometryTile and configFlags.Common.ProductionStep != ProductionStep.Overlay) or sCellsInInput: + if (configFlags.GeoModel.Run is LHCPeriod.Run3 and configFlags.Detector.GeometryTile) or sCellsInInput: # TODO: avoid depending on Tile in SuperCell alignment from TileGeoModel.TileGMConfig import TileGMCfg result.merge(TileGMCfg(configFlags)) diff --git a/LArCalorimeter/LArROD/src/LArNNRawChannelBuilder.cxx b/LArCalorimeter/LArROD/src/LArNNRawChannelBuilder.cxx index e9a991eb6e94f3c21d33dfa1d5e0765643a79d7b..3752acedd929e8abe304f144e601e3f37df3eef0 100644 --- a/LArCalorimeter/LArROD/src/LArNNRawChannelBuilder.cxx +++ b/LArCalorimeter/LArROD/src/LArNNRawChannelBuilder.cxx @@ -12,7 +12,6 @@ #include "CaloIdentifier/CaloIdManager.h" #include "CaloEvent/CaloCellContainer.h" -#include "CaloDetDescr/CaloDetDescrManager.h" #include "CaloDetDescr/CaloDetDescrElement.h" #include "LArRawEvent/LArDigitContainer.h" @@ -45,7 +44,6 @@ StatusCode LArNNRawChannelBuilder::initialize() { const LArOnline_SuperCellID* ll; ATH_CHECK(detStore()->retrieve(ll, "LArOnline_SuperCellID")); m_onlineId = (const LArOnlineID_Base*)ll; - ATH_CHECK( detStore()->retrieve (m_sem_mgr, "CaloSuperCellMgr") ); } else { const LArOnlineID* ll; diff --git a/LArCalorimeter/LArROD/src/LArNNRawChannelBuilder.h b/LArCalorimeter/LArROD/src/LArNNRawChannelBuilder.h index cc13bf7643a47e60a1ab8c8e70042db0828615cb..ac1be941e10d49df1c06d924bd796a20aad35e21 100644 --- a/LArCalorimeter/LArROD/src/LArNNRawChannelBuilder.h +++ b/LArCalorimeter/LArROD/src/LArNNRawChannelBuilder.h @@ -2,8 +2,8 @@ Copyright (C) 2022 CERN for the benefit of the ATLAS collaboration */ -#ifndef LARNNRAWCHANNELBUILDER_H -#define LARNNRAWCHANNELBUILDER_H +#ifndef LARROD_LARNNRAWCHANNELBUILDER_H +#define LARROD_LARNNRAWCHANNELBUILDER_H #include "AthenaBaseComps/AthReentrantAlgorithm.h" @@ -14,7 +14,6 @@ #include "LArRawEvent/LArDigitContainer.h" #include "LArRawEvent/LArRawChannelContainer.h" #include "CaloEvent/CaloCellContainer.h" -#include "CaloDetDescr/CaloDetDescrManager.h" #include "LArElecCalib/ILArPedestal.h" #include "LArRawConditions/LArADC2MeV.h" @@ -68,9 +67,6 @@ Gaudi::Property<bool>m_isSC{this, "IsSuperCell", false, "code should produce Sup //Identifier helper const LArOnlineID_Base* m_onlineId = nullptr; -/// Geometry manager. -const CaloSuperCellDetDescrManager* m_sem_mgr = 0; - Gaudi::Property<std::string>m_nn_json{this, "NNJsonPath", "", "Path to json containing the lwtnn network"}; Gaudi::Property<std::string>m_input_node{this, "NetworkInputNode", "", diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderSCAlg.cxx b/LArCalorimeter/LArROD/src/LArRawChannelBuilderSCAlg.cxx index dce3e0cb966df6479a15137110430d328e419eba..b7f1a1d50313f481ac7797b9ba761a0ed5610871 100644 --- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderSCAlg.cxx +++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderSCAlg.cxx @@ -12,7 +12,7 @@ #include <cmath> LArRawChannelBuilderSCAlg::LArRawChannelBuilderSCAlg(const std::string& name, ISvcLocator* pSvcLocator): - AthReentrantAlgorithm(name, pSvcLocator), m_sem_mgr(0) {} + AthReentrantAlgorithm(name, pSvcLocator) {} StatusCode LArRawChannelBuilderSCAlg::initialize() { ATH_CHECK(m_digitKey.initialize()); @@ -24,8 +24,8 @@ StatusCode LArRawChannelBuilderSCAlg::initialize() { ATH_CHECK(m_cablingKey.initialize() ); ATH_CHECK(detStore()->retrieve(m_onlineId,"LArOnline_SuperCellID")); - ATH_CHECK(detStore()->retrieve (m_sem_mgr, "CaloSuperCellMgr") ); - + ATH_CHECK(m_caloSuperCellMgrKey.initialize()); + return StatusCode::SUCCESS; } @@ -63,7 +63,9 @@ StatusCode LArRawChannelBuilderSCAlg::execute(const EventContext& ctx) const { const ILArShape* shapes=*shapeHdl; SG::ReadCondHandle<LArOnOffIdMapping> cabling(m_cablingKey,ctx); - + + SG::ReadCondHandle<CaloSuperCellDetDescrManager> caloSuperCellMgrHandle{m_caloSuperCellMgrKey,ctx}; + const CaloSuperCellDetDescrManager* caloMgr = *caloSuperCellMgrHandle; //Loop over digits: for (const LArDigit* digit : *inputContainer) { @@ -201,7 +203,7 @@ StatusCode LArRawChannelBuilderSCAlg::execute(const EventContext& ctx) const { CaloCell* ss = dataPool.nextElementPtr(); Identifier offId = cabling->cnvToIdentifier(id); - const CaloDetDescrElement* dde = m_sem_mgr->get_element (offId); + const CaloDetDescrElement* dde = caloMgr->get_element (offId); ss->setCaloDDE(dde); ss->setEnergy(E); ss->setTime(tau); diff --git a/LArCalorimeter/LArROD/src/LArRawChannelBuilderSCAlg.h b/LArCalorimeter/LArROD/src/LArRawChannelBuilderSCAlg.h index 20c5caff570382ed0169fb06c5843bdebac7e252..ed563e1547c1f40da664277549872c213b3989ad 100644 --- a/LArCalorimeter/LArROD/src/LArRawChannelBuilderSCAlg.h +++ b/LArCalorimeter/LArROD/src/LArRawChannelBuilderSCAlg.h @@ -20,6 +20,7 @@ #include "LArCabling/LArOnOffIdMapping.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" +#include "CaloDetDescr/CaloDetDescrManager.h" //Event classes class LArDigitContainer; class CaloCellContainer; @@ -66,9 +67,9 @@ class LArRawChannelBuilderSCAlg : public AthReentrantAlgorithm { //Identifier helper const LArOnline_SuperCellID* m_onlineId = nullptr; - /// Geometry manager. - const CaloSuperCellDetDescrManager* m_sem_mgr; - + // Super Cell DD manager key + SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> m_caloSuperCellMgrKey{ + this,"CaloSuperCellDetDescrManager","CaloSuperCellDetDescrManager","SG key of the resulting CaloSuperCellDetDescrManager"}; }; diff --git a/LArCalorimeter/LArROD/src/LArSCSimpleMaker.cxx b/LArCalorimeter/LArROD/src/LArSCSimpleMaker.cxx index 7f74d9dc3f079032bc1c4b1f85b86f3ffeb1f805..0a1a11773585a27eb4fa58f379962e0a59e601d9 100755 --- a/LArCalorimeter/LArROD/src/LArSCSimpleMaker.cxx +++ b/LArCalorimeter/LArROD/src/LArSCSimpleMaker.cxx @@ -31,7 +31,6 @@ LArSCSimpleMaker::LArSCSimpleMaker(const std::string& name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator), - m_sem_mgr(0), m_calo_id_manager(0) { } @@ -40,7 +39,7 @@ StatusCode LArSCSimpleMaker::initialize(){ ATH_CHECK( m_cellContainerKey.initialize() ); ATH_CHECK( m_sCellContainerKey.initialize() ); ATH_CHECK( m_scidtool.retrieve() ); - ATH_CHECK( detStore()->retrieve (m_sem_mgr, "CaloSuperCellMgr") ); + ATH_CHECK( m_caloSuperCellMgrKey.initialize() ); ATH_CHECK( detStore()->retrieve (m_calo_id_manager, "CaloIdManager") ); ATH_CHECK( m_noise_per_cell_Key.initialize(m_compNoise) ); ATH_CHECK( m_bcidAvgKey.initialize(m_addBCID) ); @@ -181,12 +180,15 @@ StatusCode LArSCSimpleMaker::execute(const EventContext& context) const SG::WriteHandle<CaloCellContainer> scellContainerHandle( m_sCellContainerKey, context); auto superCellContainer = std::make_unique<CaloCellContainer> (); + SG::ReadCondHandle<CaloSuperCellDetDescrManager> caloSuperCellMgrHandle{m_caloSuperCellMgrKey, context}; + const CaloSuperCellDetDescrManager* caloMgr = *caloSuperCellMgrHandle; + superCellContainer->reserve(energies.size()); std::default_random_engine generator; for (unsigned int i=0; i < energies.size(); i++) { - const CaloDetDescrElement* dde = m_sem_mgr->get_element (i); + const CaloDetDescrElement* dde = caloMgr->get_element (i); if (!dde) { // ATH_MSG_WARNING( " Not valid DDE, hash index = "<< i ); continue; @@ -203,7 +205,7 @@ StatusCode LArSCSimpleMaker::execute(const EventContext& context) const //CaloCell* ss = dataPool.nextElementPtr(); CaloCell* ss = new CaloCell(); - ss->setCaloDDE( m_sem_mgr->get_element (i)); + ss->setCaloDDE( caloMgr->get_element (i)); ss->setEnergy( energies[i] ); uint16_t prov (0); if ( timeDef[i] ){ diff --git a/LArCalorimeter/LArROD/src/LArSCSimpleMaker.h b/LArCalorimeter/LArROD/src/LArSCSimpleMaker.h index 7cd0000848a9f5820af06568554d2906cfe0af7a..fceb6890d8921194115dac4c8a5652d7ef2a3864 100755 --- a/LArCalorimeter/LArROD/src/LArSCSimpleMaker.h +++ b/LArCalorimeter/LArROD/src/LArSCSimpleMaker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef LARROD_LARSCSIMPLEMAKER_H @@ -81,8 +81,9 @@ private: // compensate for BCID effect Gaudi::Property<bool> m_addBCID{this,"addBCID",true,"Add BCID compensation back to cells prior to sum them up"}; - /// Geometry manager. - const CaloSuperCellDetDescrManager* m_sem_mgr; + // Super Cell DD manager key + SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> m_caloSuperCellMgrKey{ + this,"CaloSuperCellDetDescrManager","CaloSuperCellDetDescrManager","SG key of the resulting CaloSuperCellDetDescrManager"}; /// Entry point for calorimeter ID helpers. const CaloIdManager* m_calo_id_manager;