diff --git a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx index 54760df0cf5e3182ba963bf45b76b4a3ffe8cf73..71802d794d10d78b1529b1256fce62d8c050cd0b 100755 --- a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx +++ b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloMgrDetDescrCnv.cxx @@ -41,6 +41,8 @@ #include "TileDetDescr/TileDetDescrManager.h" +#include <GaudiKernel/ThreadLocalContext.h> + long int CaloMgrDetDescrCnv::repSvcType() const { return storageType(); @@ -71,7 +73,12 @@ StatusCode CaloMgrDetDescrCnv::finalize() StatusCode CaloMgrDetDescrCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) { - MsgStream log(msgSvc(), "CaloMgrDetDescrCnv"); + // Ensure that this object is created inside the event loop + auto ctx = Gaudi::Hive::currentContext(); + MsgStream log( msgSvc(), "CaloMgrDetDescrCnv" ); + if ( !ctx.valid() ) { + log << MSG::WARNING << "Attempting to create a Calo Detector Manager object outside of the event loop. Geometry may not be aligned." << endmsg; + } log << MSG::INFO << "in createObj: creating a Calo Detector Manager object in the detector store" << endmsg; bool debug = log.level()<=MSG::DEBUG; diff --git a/Calorimeter/CaloTrackingGeometry/CaloTrackingGeometry/CaloSurfaceBuilder.h b/Calorimeter/CaloTrackingGeometry/CaloTrackingGeometry/CaloSurfaceBuilder.h index cbe92ee49e9f5f062f1653d1043d4e10842e6502..37e72bf9d3785641c26dfbf27814a999178173df 100755 --- a/Calorimeter/CaloTrackingGeometry/CaloTrackingGeometry/CaloSurfaceBuilder.h +++ b/Calorimeter/CaloTrackingGeometry/CaloTrackingGeometry/CaloSurfaceBuilder.h @@ -27,6 +27,8 @@ #include "CaloGeoHelpers/CaloPhiRange.h" #include "CaloDetDescr/CaloSubdetNames.h" +#include <mutex> + class CaloDetDescrManager; class ICaloCoordinateTool; class IMessageSvc; @@ -143,19 +145,20 @@ public: private: // fill cashed surfaces - void fill_tg_surfaces(); + void fill_tg_surfaces() const; // CaloDetDescr usal stuff //const CaloCell_ID* m_calo_id; - const CaloDetDescrManager* m_calo_dd; + const mutable CaloDetDescrManager* m_calo_dd; //TileDetDescr stuff const TileDetDescrManager* m_tile_dd; // cash the surfaces for TG builder - mutable std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > m_layerEntries; - mutable std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > m_layerExits; - + mutable std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > m_layerEntries; + mutable std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > m_layerExits; + mutable std::once_flag m_fillOnce; + // needed to cover TestBeam // ToolHandle<ICaloCoordinateTool> m_calo_tb_coord; @@ -173,11 +176,17 @@ private: //IMessageSvc* m_msgSvc; }; -inline std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > CaloSurfaceBuilder::entrySurfaces() const -{ return m_layerEntries; } +inline std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > CaloSurfaceBuilder::entrySurfaces ATLAS_THREAD_SAFE() const +{ + std::call_once( m_fillOnce, [this](){fill_tg_surfaces();} ); + return m_layerEntries; +} -inline std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > CaloSurfaceBuilder::exitSurfaces() const -{ return m_layerExits; } +inline std::vector<std::pair<const Trk::Surface*,const Trk::Surface*> > CaloSurfaceBuilder::exitSurfaces ATLAS_THREAD_SAFE() const +{ + std::call_once( m_fillOnce, [this](){fill_tg_surfaces();} ); + return m_layerExits; +} #endif // CALOTRACKINGGEOMETRY_CALOSURFACEBUILDER_H diff --git a/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceBuilder.cxx b/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceBuilder.cxx index 1fd7d04e27c22b7aab759740a5d809061163d34a..587a211e719c4fda85951d1f22766d64e80da892 100755 --- a/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceBuilder.cxx +++ b/Calorimeter/CaloTrackingGeometry/src/CaloSurfaceBuilder.cxx @@ -121,19 +121,11 @@ CaloSurfaceBuilder::initialize() ATH_MSG_DEBUG("Sucessfully retrieved "<< m_tileVolumeBuilder << "."); */ - if (detStore()->retrieve(m_calo_dd).isFailure()) { - ATH_MSG_WARNING("Could not find CaloDetDescriptorManager in DetStore, calling CaloDetDescrManager::instance() instead"); - m_calo_dd = CaloDetDescrManager::instance(); - if (!m_calo_dd) return StatusCode::FAILURE; - } - if (detStore()->retrieve(m_tile_dd).isFailure()){ ATH_MSG_FATAL("Could not find TileDetDescrManager in DetStore" ); return StatusCode::FAILURE; } - fill_tg_surfaces(); - return StatusCode::SUCCESS; } @@ -146,16 +138,18 @@ CaloSurfaceBuilder::finalize() delete m_layerEntries[i].second; } - delete m_layerExits[CaloCell_ID::TileBar2].first; - delete m_layerExits[CaloCell_ID::TileBar2].second; - delete m_layerExits[CaloCell_ID::TileExt2].first; - delete m_layerExits[CaloCell_ID::TileExt2].second; - delete m_layerExits[CaloCell_ID::TileGap2].first; - delete m_layerExits[CaloCell_ID::TileGap2].second; - delete m_layerExits[CaloCell_ID::TileGap3].first; - delete m_layerExits[CaloCell_ID::TileGap3].second; - delete m_layerExits[CaloCell_ID::HEC3].first; - delete m_layerExits[CaloCell_ID::HEC3].second; + if ( m_layerExits.size() ) { + delete m_layerExits[CaloCell_ID::TileBar2].first; + delete m_layerExits[CaloCell_ID::TileBar2].second; + delete m_layerExits[CaloCell_ID::TileExt2].first; + delete m_layerExits[CaloCell_ID::TileExt2].second; + delete m_layerExits[CaloCell_ID::TileGap2].first; + delete m_layerExits[CaloCell_ID::TileGap2].second; + delete m_layerExits[CaloCell_ID::TileGap3].first; + delete m_layerExits[CaloCell_ID::TileGap3].second; + delete m_layerExits[CaloCell_ID::HEC3].first; + delete m_layerExits[CaloCell_ID::HEC3].second; + } StatusCode sc = StatusCode::SUCCESS; return sc; @@ -236,9 +230,12 @@ Trk::Surface* CaloSurfaceBuilder:: CreateUserSurface (const CaloCell_ID::CaloSa const double offset, const double etaCaloLocal) const { + if (sample == CaloCell_ID::Unknown) return nullptr; - if (sample == CaloCell_ID::Unknown) return 0; - if (!m_calo_dd) return 0; + // Cannot do this in initialize: see ATLASRECTS-5012 + if (!m_calo_dd) { + if ( detStore()->retrieve(m_calo_dd).isFailure() ) return nullptr; + } // NB: the Transform3D created here belong to the surface, // and will be deleted by it @@ -369,7 +366,10 @@ CaloSurfaceBuilder::CreateLastSurface (const CaloCell_ID::CaloSample sample, { ATH_MSG_DEBUG( "In CreateLastSurface()" ); - if (!m_calo_dd) return 0; + // Cannot do this in initialize: see ATLASRECTS-5012 + if (!m_calo_dd) { + if ( detStore()->retrieve(m_calo_dd).isFailure() ) return nullptr; + } Trk::Surface* surf =0; @@ -640,7 +640,10 @@ CaloSurfaceBuilder::get_cylinder_surface (CaloCell_ID::CaloSample sample, int si bool result = false; - if (!m_calo_dd) return result; + // Cannot do this in initialize: see ATLASRECTS-5012 + if (!m_calo_dd) { + if ( detStore()->retrieve(m_calo_dd).isFailure() ) return result; + } // strips are spread on several descriptor, which all have the same // htrans, radius, hphi, but not the same hlength @@ -731,7 +734,10 @@ CaloSurfaceBuilder::get_disk_surface (CaloCell_ID::CaloSample sample, int side, rmin = 999999.; rmax = 0.; - if (!m_calo_dd) return result; + // Cannot do this in initialize: see ATLASRECTS-5012 + if (!m_calo_dd) { + if ( detStore()->retrieve(m_calo_dd).isFailure() ) return result; + } // strips are spread on several descriptor, which all have the same // htrans, hphisec, but not the same rmin and rmax @@ -1037,7 +1043,7 @@ std::vector<const Trk::Surface*> CaloSurfaceBuilder::allHECSurfaces() const } //store all the surfaces into a vector -void CaloSurfaceBuilder::fill_tg_surfaces() +void CaloSurfaceBuilder::fill_tg_surfaces() const { //for (float eta=1.4; eta<3.2; eta+=0.1 ) { // const Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EME2,0.,eta); diff --git a/Calorimeter/CaloUtils/CMakeLists.txt b/Calorimeter/CaloUtils/CMakeLists.txt index 3dfcd9b94bcde61752282d5dc82d606c74d0b523..a7a37b92e2a3a6f56a9e38a00e5eb14df7241c03 100644 --- a/Calorimeter/CaloUtils/CMakeLists.txt +++ b/Calorimeter/CaloUtils/CMakeLists.txt @@ -66,7 +66,7 @@ atlas_add_test( CaloTowerStore_test atlas_add_test( CaloTowerBuilderTool_test SCRIPT test/CaloTowerBuilderTool_test.sh LOG_IGNORE_PATTERN "Reading file|Unable to locate catalog|Cache alignment" - ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-12" + ENVIRONMENT "ATLAS_REFERENCE_TAG=CaloUtils/CaloUtils-01-00-13" PROPERTIES TIMEOUT 500 ) atlas_add_test( ToolWithConstants_test diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h b/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h index 7dfa8d11030bbbff951f3f3ec08cac6d33df0069..5553571ae5673a06d75e9f8647d5ef931bea470f 100644 --- a/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h +++ b/Calorimeter/CaloUtils/CaloUtils/CaloTowerBuilderTool.h @@ -25,7 +25,6 @@ class CaloTower; class CaloTowerStore; class CaloTowerContainer; -class CaloDetDescrManager; class StoreGateSvc; class MsgStream; @@ -104,7 +103,6 @@ private: // Specific Initialization // ///////////////////////////// - const CaloDetDescrManager* m_caloDDM; CaloTowerStore m_cellStore; virtual StatusCode checkSetup(MsgStream& log); diff --git a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref index e1a355baef8b8ee34aeaa39b12c9659b697a5416..b597552a0de5f775d80f5c35eb038e0b7c555fb4 100644 --- a/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref +++ b/Calorimeter/CaloUtils/share/CaloTowerStore_test.ref @@ -1,16 +1,16 @@ -Tue Aug 6 20:30:51 CEST 2019 +Wed Aug 5 18:46:10 CEST 2020 Preloading tcmalloc_minimal.so Py:Athena INFO including file "AthenaCommon/Preparation.py" -Py:Athena INFO using release [WorkDir-22.0.3] [x86_64-centos7-gcc8-opt] [atlas-work3/da00b53be39] -- built on [2019-08-06T1723] +Py:Athena INFO using release [WorkDir-22.0.17] [x86_64-centos7-gcc8-opt] [CaloMgrTooEarlyError/1cd056abc58] -- built on [2020-08-05T1835] Py:Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" Py:Athena INFO executing ROOT6Setup Py:Athena INFO including file "AthenaCommon/Execution.py" -Py:Athena INFO including file "CaloUtils/CaloTowerStore_test.py" -SetGeometryVersion.py obtained major release version 22 +Py:Athena INFO including file "CaloTowerStore_test.py" +Py:Athena INFO SetGeometryVersion.py obtained major release version 22 Py:Athena INFO including file "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py" -Py:ConfigurableDb INFO Read module info for 5520 configurables from 75 genConfDb files +Py:ConfigurableDb INFO Read module info for 5547 configurables from 23 genConfDb files Py:ConfigurableDb INFO No duplicates have been found: that's good ! -EventInfoMgtInit: Got release version Athena-22.0.3 +EventInfoMgtInit: Got release version Athena-22.0.17 Py:IOVDbSvc.CondDB INFO Setting up conditions DB access to instance OFLP200 Py:Athena INFO including file "CaloIdCnv/CaloIdCnv_joboptions.py" Py:Athena INFO including file "CaloConditions/CaloConditions_jobOptions.py" @@ -18,28 +18,25 @@ Py:Athena INFO including file "CaloConditions/LArTTCellMap_ATLAS_jobO Py:Athena INFO including file "CaloConditions/CaloTTIdMap_ATLAS_jobOptions.py" Py:Athena INFO including file "TileIdCnv/TileIdCnv_jobOptions.py" Py:Athena INFO including file "AthenaCommon/runbatch.py" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v32r0) - running on lxplus724.cern.ch on Tue Aug 6 20:31:01 2019 + Welcome to ApplicationMgr (GaudiCoreSvc v33r2) + running on 05d0ccd909cb on Wed Aug 5 18:46:19 2020 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level= 'PluginDebugLevel':0 -StatusCodeSvc INFO initialize AthDictLoaderSvc INFO in initialize... AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO getRegistryEntries: read 3542 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 3581 CLIDRegistry entries for module ALL CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok] PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-local.cern.ch:8000/atlr)(serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://lcgft-atlas.gridpp.rl.ac.uk:3128/frontierATLAS)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://ca-proxy.cern.ch:3128)(proxyurl=http://ca-proxy-meyrin.cern.ch:3128)(proxyurl=http://ca-proxy-wigner.cern.ch:3128)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data -DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config -DBReplicaSvc INFO Total of 10 servers found for host lxplus724.cern.ch [ATLF ATLAS_COOLPROD atlas_dd ATLAS_CONFIG INT8R INTR ATONR_COOL ATONR_CONF DEVDB11 ATLF ] +DBReplicaSvc INFO Frontier server at (serverurl=http://atlasfrontier-ai.cern.ch:8000/atlr)(serverurl=http://frontier-atlas.lcg.triumf.ca:3128/ATLAS_frontier)(serverurl=http://ccfrontier.in2p3.fr:23128/ccin2p3-AtlasFrontier)(proxyurl=http://atlasbpfrontier.cern.ch:3127)(proxyurl=http://atlasbpfrontier.fnal.gov:3127) will be considered for COOL data +DBReplicaSvc INFO Read replica configuration from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/dbreplica.config +DBReplicaSvc INFO No specific match for domain found - use default fallback +DBReplicaSvc INFO Total of 2 servers found for host 05d0ccd909cb [ATLF atlas_dd ] PoolSvc INFO Successfully setup replica sorting algorithm PoolSvc INFO Setting up APR FileCatalog and Streams PoolSvc WARNING Unable to locate catalog for prfile:poolcond/PoolCat_oflcond.xml check your ATLAS_POOLCOND_PATH and DATAPATH variables @@ -49,6 +46,7 @@ PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.x DbSession INFO Open DbSession Domain[ROOT_All] INFO > Access DbDomain READ [ROOT_All] MetaDataSvc INFO Found MetaDataTools = PublicToolHandleArray([]) +OutputStreamSeq... INFO Initializing OutputStreamSequencerSvc - package version AthenaServices-00-00-00 IOVDbSvc INFO Opened read transaction for POOL PersistencySvc IOVDbSvc INFO Only 5 POOL conditions files will be open at once IOVDbSvc INFO Cache alignment will be done in 3 slices @@ -56,6 +54,7 @@ IOVDbSvc INFO Global tag: OFLCOND-SDR-BS14T-IBL-06 set from joboptio IOVDbFolder INFO Read from meta data only for folder /TagInfo IOVDbSvc INFO Initialised with 3 connections and 7 folders IOVDbSvc INFO Service IOVDbSvc initialised successfully +ClassIDSvc INFO getRegistryEntries: read 1488 CLIDRegistry entries for module ALL IOVDbSvc INFO preLoadAddresses: Removing folder /TagInfo. It should only be in the file meta data and was not found. IOVDbSvc INFO Opening COOL connection for COOLOFL_LAR/OFLP200 IOVSvc INFO No IOVSvcTool associated with store "StoreGateSvc" @@ -69,9 +68,9 @@ IOVDbSvc INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTOn IOVDbSvc INFO Added taginfo remove for /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas IOVDbSvc INFO Added taginfo remove for /LAR/LArCellPositionShift IOVDbSvc INFO Added taginfo remove for /LAR/Identifier/LArTTCellMapAtlas -ClassIDSvc INFO getRegistryEntries: read 2165 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 17 CLIDRegistry entries for module ALL -ClassIDSvc INFO getRegistryEntries: read 287 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 268 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 24 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 239 CLIDRegistry entries for module ALL DetDescrCnvSvc INFO initializing DetDescrCnvSvc INFO Found DetectorStore service DetDescrCnvSvc INFO filling proxies for detector managers @@ -106,8 +105,6 @@ DetDescrCnvSvc INFO filling address for MDTIDHELPER with CLID 4170 and st DetDescrCnvSvc INFO filling address for CSCIDHELPER with CLID 4171 and storage type 68 to detector store DetDescrCnvSvc INFO filling address for RPCIDHELPER with CLID 4172 and storage type 68 to detector store DetDescrCnvSvc INFO filling address for TGCIDHELPER with CLID 4173 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for STGCIDHELPER with CLID 4174 and storage type 68 to detector store -DetDescrCnvSvc INFO filling address for MMIDHELPER with CLID 4175 and storage type 68 to detector store DetDescrCnvSvc INFO filling address for CaloLVL1_ID with CLID 108133391 and storage type 68 to detector store DetDescrCnvSvc INFO filling address for CaloCell_ID with CLID 123500438 and storage type 68 to detector store DetDescrCnvSvc INFO filling address for CaloCell_SuperCell_ID with CLID 128365736 and storage type 68 to detector store @@ -158,7 +155,7 @@ BarrelConstruction INFO Use sagging in geometry ? 0 EMECConstruction INFO multi-layered version of absorbers activated, parameter value is 1 EMECConstruction INFO activating LAr::EMEC::Pos::InnerWheel EMECConstruction INFO activating LAr::EMEC::Pos::OuterWheel -ClassIDSvc INFO getRegistryEntries: read 5934 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 5947 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a TileTBID helper object in the detector store TileTBID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK @@ -176,7 +173,7 @@ TileDddbManager INFO n_tilb = 21 TileDddbManager INFO n_tileSwitches = 1 CaloIDHelper_ID... INFO in createObj: creating a TileID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt +TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/TileNeighbour_reduced.txt TileHWIDDetDesc... INFO in createObj: creating a TileHWID helper object in the detector store TileHWID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK @@ -188,9 +185,9 @@ CaloIDHelper_ID... INFO in createObj: creating a LArHEC_ID helper object in th AtlasDetectorID INFO initialize_from_dictionary - OK CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/FCal2DNeighbors-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsNext-April2011.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/FCal3DNeighborsPrev-April2011.txt CaloIDHelper_ID... INFO in createObj: creating a LArMiniFCAL_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK LArMiniFCAL_ID INFO initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID. @@ -201,9 +198,23 @@ AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version Athe CondInputLoader INFO Initializing CondInputLoader... CondInputLoader INFO Adding base classes: CondInputLoader INFO Will create WriteCondHandle dependencies for the following DataObjects: +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr INFO Application Manager Started successfully +AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== +EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc +EventPersistenc... INFO Added successfully Conversion service:TagInfoMgr +ClassIDSvc INFO getRegistryEntries: read 2529 CLIDRegistry entries for module ALL +IOVDbSvc INFO Opening COOL connection for COOLOFL_LAR/OFLP200 +IOVDbFolder INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARAlign-mc11-00 for folder /LAR/Align +IOVDbFolder INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift +IOVDbFolder INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARIdentifierLArTTCellMapAtlas-HadFcalFix2 for folder /LAR/Identifier/LArTTCellMapAtlas +IOVDbSvc INFO Disconnecting from COOLOFL_LAR/OFLP200 +Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC +Domain[ROOT_All] INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root +RootDatabase.open INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200 CaloMgrDetDescrCnv INFO in createObj: creating a Calo Detector Manager object in the detector store CaloIdMgrDetDes... INFO in createObj: creating a CaloDescrManager object in the detector store -ClassIDSvc INFO getRegistryEntries: read 2409 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 198 CLIDRegistry entries for module ALL CaloIDHelper_ID... INFO in createObj: creating a CaloDM_ID helper object in the detector store CaloDM_ID INFO initialize_from_dictionary AtlasDetectorID INFO initialize_from_dictionary - OK @@ -220,30 +231,15 @@ CaloIDHelper_ID... INFO in createObj: creating a LArHEC_SuperCell_ID helper ob AtlasDetectorID INFO initialize_from_dictionary - OK CaloIDHelper_ID... INFO in createObj: creating a LArFCAL_SuperCell_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt -LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells2DNeighborsNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsNextNew-April2014.txt +LArFCAL_Base_ID INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/FCalSuperCells3DNeighborsPrevNew-April2014.txt CaloIDHelper_ID... INFO in createObj: creating a Tile_SuperCell_ID helper object in the detector store AtlasDetectorID INFO initialize_from_dictionary - OK -TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-08-05T2130/Athena/22.0.3/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt +TileNeighbour INFO Reading file /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2020-08-04T2146/Athena/22.0.17/InstallArea/x86_64-centos7-gcc8-opt/share/TileSuperCellNeighbour.txt AtlasDetectorID INFO initialize_from_dictionary - OK CaloIdMgrDetDes... INFO Finished CaloIdMgrDetDes... INFO Initializing CaloIdMgr from values in CaloIdMgrDetDescrCnv -HistogramPersis...WARNING Histograms saving not required. -ApplicationMgr INFO Application Manager Initialized successfully -ApplicationMgr INFO Application Manager Started successfully -AthenaEventLoopMgr INFO ===>>> start of run 1 <<<=== -EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc -EventPersistenc... INFO Added successfully Conversion service:TagInfoMgr -ClassIDSvc INFO getRegistryEntries: read 109 CLIDRegistry entries for module ALL -IOVDbSvc INFO Opening COOL connection for COOLOFL_LAR/OFLP200 -IOVDbFolder INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARAlign-mc11-00 for folder /LAR/Align -IOVDbFolder INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LArCellPositionShift-ideal for folder /LAR/LArCellPositionShift -IOVDbFolder INFO HVS tag OFLCOND-SDR-BS14T-IBL-06 resolved to LARIdentifierLArTTCellMapAtlas-HadFcalFix2 for folder /LAR/Identifier/LArTTCellMapAtlas -IOVDbSvc INFO Disconnecting from COOLOFL_LAR/OFLP200 -Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 06C9EAE8-6F5B-E011-BAAA-003048F0E7AC -Domain[ROOT_All] INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root -RootDatabase.open INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond09/cond09_mc.000029.gen.COND/cond09_mc.000029.gen.COND._0002.pool.root File version:52200 Domain[ROOT_All] INFO -> Access DbDatabase READ [ROOT_All] 8667C6F2-1559-DE11-A611-000423D9A21A Domain[ROOT_All] INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root RootDatabase.open INFO /cvmfs/atlas-condb.cern.ch/repo/conditions/cond08/cond08_mc.000003.gen.COND/cond08_mc.000003.gen.COND._0064.pool.root File version:52200 @@ -260,25 +256,25 @@ IncidentProcAlg1 INFO Finalize CondInputLoader INFO Finalizing CondInputLoader... IncidentProcAlg2 INFO Finalize IdDictDetDescrCnv INFO in finalize -IOVDbFolder INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 0.04 ))s +IOVDbFolder INFO Folder /LAR/Align (PoolRef) db-read 1/1 objs/chan/bytes 1/1/170 (( 1.07 ))s IOVDbFolder INFO Folder /CALO/Ofl/Identifier/CaloTTOnAttrIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s IOVDbFolder INFO Folder /CALO/Ofl/Identifier/CaloTTOnOffIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s IOVDbFolder INFO Folder /CALO/Ofl/Identifier/CaloTTPpmRxIdMapAtlas (PoolRef) db-read 0/0 objs/chan/bytes 0/1/0 (( 0.00 ))s -IOVDbFolder INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.03 ))s -IOVDbFolder INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 (( 0.03 ))s +IOVDbFolder INFO Folder /LAR/LArCellPositionShift (PoolRef) db-read 1/1 objs/chan/bytes 1/1/195 (( 0.69 ))s +IOVDbFolder INFO Folder /LAR/Identifier/LArTTCellMapAtlas (PoolRef) db-read 1/0 objs/chan/bytes 1/1/173 (( 0.77 ))s IOVDbFolder WARNING Folder /LAR/Identifier/LArTTCellMapAtlas is requested but no data retrieved -IOVDbSvc INFO bytes in (( 0.09 ))s +IOVDbSvc INFO bytes in (( 2.53 ))s IOVDbSvc INFO Connection sqlite://;schema=mycool.db;dbname=OFLP200 : nConnect: 0 nFolders: 0 ReadTime: (( 0.00 ))s -IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: (( 0.09 ))s +IOVDbSvc INFO Connection COOLOFL_LAR/OFLP200 : nConnect: 2 nFolders: 3 ReadTime: (( 2.53 ))s IOVDbSvc INFO Connection COOLOFL_CALO/OFLP200 : nConnect: 1 nFolders: 3 ReadTime: (( 0.00 ))s AthDictLoaderSvc INFO in finalize... ToolSvc INFO Removing all tools created by ToolSvc *****Chrono***** INFO **************************************************************************************************** *****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) *****Chrono***** INFO **************************************************************************************************** -cObjR_ALL INFO Time User : Tot= 370 [ms] Ave/Min/Max= 185(+- 175)/ 10/ 360 [ms] #= 2 -cObj_ALL INFO Time User : Tot= 430 [ms] Ave/Min/Max= 215(+- 185)/ 30/ 400 [ms] #= 2 -ChronoStatSvc INFO Time User : Tot= 2.34 [s] #= 1 +cObjR_ALL INFO Time User : Tot= 210 [ms] Ave/Min/Max= 105(+- 105)/ 0/ 210 [ms] #= 2 +cObj_ALL INFO Time User : Tot= 270 [ms] Ave/Min/Max= 135(+- 125)/ 10/ 260 [ms] #= 2 +ChronoStatSvc INFO Time User : Tot= 1.71 [s] #= 1 *****Chrono***** INFO **************************************************************************************************** ChronoStatSvc.f... INFO Service finalized successfully ApplicationMgr INFO Application Manager Finalized successfully diff --git a/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx b/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx index f55cf88b789af4963969ad7dd3db3f05d0ca71a5..250bcb88c704646ceefccd1eea0c6db4f5483c11 100644 --- a/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx +++ b/Calorimeter/CaloUtils/src/CaloTowerBuilderTool.cxx @@ -28,8 +28,7 @@ CaloTowerBuilderTool::CaloTowerBuilderTool(const std::string& name, const std::string& type, const IInterface* parent) - : CaloTowerBuilderToolBase(name,type,parent), - m_caloDDM(nullptr) + : CaloTowerBuilderToolBase(name,type,parent) // , m_errorCounter(0) { declareInterface<ICaloTowerBuilderToolBase>(this); @@ -52,7 +51,6 @@ CaloTowerBuilderTool::~CaloTowerBuilderTool() // protected! StatusCode CaloTowerBuilderTool::initializeTool() { - ATH_CHECK( detStore()->retrieve (m_caloDDM, "CaloMgr") ); m_caloIndices = parseCalos (m_includedCalos); return this->checkSetup(msg()); } @@ -304,7 +302,12 @@ CaloTowerBuilderTool::parseCalos StatusCode CaloTowerBuilderTool::rebuildLookup() { if (towerSeg().neta() != 0 && towerSeg().nphi() != 0) { - if (m_cellStore.buildLookUp(*m_caloDDM, towerSeg(), m_caloIndices)) { + + // Cannot do this in initialize: see ATLASRECTS-5012 + const CaloDetDescrManager* caloDDM = nullptr; + ATH_CHECK( detStore()->retrieve (caloDDM, "CaloMgr") ); + + if (m_cellStore.buildLookUp(*caloDDM, towerSeg(), m_caloIndices)) { return StatusCode::SUCCESS; } } diff --git a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx index b5bca2b1fd45fcaf7c6bbb0baa17003089c2ecff..0e14584134aae524a0ec8cbb7005a4a5a11b7c4f 100644 --- a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx +++ b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.cxx @@ -23,22 +23,11 @@ */ CaloTowerStoreTestAlg::CaloTowerStoreTestAlg (const std::string& name, ISvcLocator* pSvcLocator) - : AthAlgorithm (name, pSvcLocator), - m_caloDDM (nullptr) + : AthAlgorithm (name, pSvcLocator) { } -/** - * @brief Standard Gaudi initialize method. - */ -StatusCode CaloTowerStoreTestAlg::initialize() -{ - ATH_CHECK( detStore()->retrieve (m_caloDDM, "CaloMgr") ); - return StatusCode::SUCCESS; -} - - void CaloTowerStoreTestAlg::iterate_full (const CaloTowerStore& store, test_tows_t& tows) @@ -90,9 +79,14 @@ CaloTowerStoreTestAlg::test_subseg_iter (const CaloTowerStore& store1, const std::vector<CaloCell_ID::SUBCALO>& calos, const CaloTowerSeg::SubSeg& subseg) { + // Cannot do this in initialize: see ATLASRECTS-5012 + const CaloDetDescrManager* caloDDM = nullptr; + StatusCode sc = detStore()->retrieve( caloDDM, "CaloMgr" ); + if ( !sc.isSuccess() ) std::abort(); + CaloTowerSeg seg = subseg.segmentation(); CaloTowerStore store2; - if (!store2.buildLookUp (*m_caloDDM, seg, calos)) { + if (!store2.buildLookUp (*caloDDM, seg, calos)) { std::abort(); } @@ -111,13 +105,19 @@ CaloTowerStoreTestAlg::test_subseg_iter (const CaloTowerStore& store1, void CaloTowerStoreTestAlg::test1() { std::cout << "test1\n"; + + // Cannot do this in initialize: see ATLASRECTS-5012 + const CaloDetDescrManager* caloDDM = nullptr; + StatusCode sc = detStore()->retrieve( caloDDM, "CaloMgr" ); + if ( !sc.isSuccess() ) std::abort(); + CaloTowerSeg seg (50, 64, -2.5, 2.5); std::vector<CaloCell_ID::SUBCALO> calos; calos.push_back (CaloCell_ID::LAREM); calos.push_back (CaloCell_ID::LARHEC); calos.push_back (CaloCell_ID::TILE); CaloTowerStore store; - if (!store.buildLookUp (*m_caloDDM, seg, calos)) { + if (!store.buildLookUp (*caloDDM, seg, calos)) { std::abort(); } diff --git a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h index 817e9137a9250aa509b917ebf8c12022d1920fc5..b64cdbfe6c920bf0d643aacdaabe48a531ff562c 100644 --- a/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h +++ b/Calorimeter/CaloUtils/src/CaloTowerStoreTestAlg.h @@ -19,7 +19,6 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "CaloUtils/CaloTowerStore.h" -class CaloDetDescrManager; class CaloTowerStoreTestAlg @@ -33,12 +32,6 @@ public: ISvcLocator* pSvcLocator); - /** - * @brief Standard Gaudi initialize method. - */ - virtual StatusCode initialize() override; - - /** * @brief Standard Gaudi execute method. */ @@ -50,8 +43,6 @@ public: void dump_tows (const test_tows_t& t); private: - const CaloDetDescrManager* m_caloDDM; - void iterate_full (const CaloTowerStore& store, test_tows_t& tows); void iterate_subseg (const CaloTowerStore& store, diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h index 60192db003db861549d50582a12e491f31f0dcd4..093f0c8cd9345cfdf8d6b306ea5e78621f6c2c26 100755 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/TrackDepositInCaloTool.h @@ -21,6 +21,7 @@ // --- STL --- #include <map> #include <vector> +#include <mutex> // --- Forward declarations --- class CaloCellContainer; @@ -123,8 +124,10 @@ class TrackDepositInCaloTool: public AthAlgTool, virtual public ITrackDepositInC private: /** Invoked from initialize(), initializes the CaloLayerMap. + Marked const because it must be called from some const methods + Actually will change mutable member variables */ - StatusCode initializeDetectorInfo(); + StatusCode initializeDetectorInfo() const; /** Extrapolate track to cylinder surface along straight line. (x0, y0, z0) is the starting position, (phi0,theta0) is the direction of the momentum, r is the bound of @@ -162,24 +165,25 @@ class TrackDepositInCaloTool: public AthAlgTool, virtual public ITrackDepositInC // Services & Tools ITHistSvc* m_histSvc{}; - ToolHandle<Trk::IExtrapolator> m_extrapolator{this, "ExtrapolatorHandle", ""}; - const CaloDetDescrManager* m_caloDDM{}; //!< Calorimeter detector description manager + ToolHandle<Trk::IExtrapolator> m_extrapolator{this, "ExtrapolatorHandle", ""}; + const mutable CaloDetDescrManager* m_caloDDM{}; //!< Calorimeter detector description manager const TileDetDescrManager* m_tileDDM{}; ToolHandle <Trk::IParticleCaloExtensionTool> m_caloExtensionTool{this, "ParticleCaloExtensionTool", "", "Tool to make the step-wise extrapolation"}; ToolHandle <Rec::IParticleCaloCellAssociationTool> m_caloCellAssociationTool{this, "ParticleCaloCellAssociationTool", ""}; // Members - const CaloCellContainer* m_cellContainer; //!< CaloCell container. - - bool m_doExtr; //!< Flag to perform extrapolations using m_extrapolator - bool m_doHist; //!< Flag to write histograms to track performance - bool m_debugMode; //!< Flag to run in specialized debug mode - bool m_showNeighbours; - double m_solenoidRadius; //!< Radius of the solenoid surrounding the ID - CaloLayerMap m_barrelLayerMap; //!< std::map of \f$r\f$ distance versus descriptor for cylindrical calo regions - CaloLayerMap m_endCapLayerMap; //!< std::map of \f$z\f$ distance versus descriptor for disc-like calo regions - + const CaloCellContainer* m_cellContainer; //!< CaloCell container. + + bool m_doExtr; //!< Flag to perform extrapolations using m_extrapolator + bool m_doHist; //!< Flag to write histograms to track performance + bool m_debugMode; //!< Flag to run in specialized debug mode + bool m_showNeighbours; + double m_solenoidRadius; //!< Radius of the solenoid surrounding the ID + CaloLayerMap mutable m_barrelLayerMap; //!< std::map of \f$r\f$ distance versus descriptor for cylindrical calo regions + CaloLayerMap mutable m_endCapLayerMap; //!< std::map of \f$z\f$ distance versus descriptor for disc-like calo regions + + std::once_flag mutable m_initializeOnce; // Histograms TH1F* m_hDepositLayer12{}; diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx index ae1dcac120dc916a04d4a8bb1c2fac257b5e3273..cad4b2bb14eb7bfa93c8f3f2d51d0b665bc2e92b 100755 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/TrackDepositInCaloTool.cxx @@ -61,15 +61,6 @@ StatusCode TrackDepositInCaloTool::initialize() { return StatusCode::FAILURE; } - if ( detStore()->retrieve(m_caloDDM).isFailure() ) { - ATH_MSG_WARNING("Unable to retrieve CaloDetDescrManager from DetectorStore. Calling the CaloDetDescrManager::instance() method"); - m_caloDDM = CaloDetDescrManager::instance(); - } - if ( !m_caloDDM ) { - ATH_MSG_ERROR("Unfortunately that did not succeed. Sending StatusCode::FAILURE"); - return StatusCode::FAILURE; - } - if ( detStore()->retrieve(m_tileDDM).isFailure() ) { ATH_MSG_ERROR("Could not retrieve TileDetDescrManager from DetectorStore!"); return StatusCode::FAILURE; @@ -91,11 +82,6 @@ StatusCode TrackDepositInCaloTool::initialize() { } } - if ( initializeDetectorInfo().isFailure() ) { - ATH_MSG_ERROR("Could not initialize detector info."); - return StatusCode::FAILURE; - } - ATH_CHECK(m_extrapolator.retrieve()); ATH_CHECK(m_caloExtensionTool.retrieve() ); ATH_CHECK(m_caloCellAssociationTool.retrieve()); @@ -357,6 +343,12 @@ std::vector<const CaloCell*>* TrackDepositInCaloTool::getCaloCellsForTile(const // --- Fill vecHash --- CaloCell_ID::CaloSample sample = descr->getSampling(); + // Cannot do this in initialize: see ATLASRECTS-5012 + if ( !m_caloDDM ) { + StatusCode sc = detStore()->retrieve( m_caloDDM ); + if ( !sc.isSuccess() ) return result; + } + std::vector<IdentifierHash> vecHash; m_caloDDM->cellsInZone(etaMin, etaMax, phiMin, phiMax, sample, vecHash); std::vector<IdentifierHash>::iterator it = vecHash.begin(); @@ -859,7 +851,9 @@ double TrackDepositInCaloTool::calcEnergy(const Trk::TrackParameters* par, const /////////////////////////////////////////////////////////////////////////////// // initializeDetectorInfo() /////////////////////////////////////////////////////////////////////////////// -StatusCode TrackDepositInCaloTool::initializeDetectorInfo() { +StatusCode TrackDepositInCaloTool::initializeDetectorInfo() const { + + if ( !m_caloDDM ) ATH_CHECK( detStore()->retrieve( m_caloDDM ) ); ATH_MSG_DEBUG("In CaloTrkMuIdDetStore::initialize()"); // Initialize LAr @@ -985,6 +979,11 @@ Amg::Vector3D* TrackDepositInCaloTool::extrapolateZ(const Amg::Vector3D& initial /////////////////////////////////////////////////////////////////////////////// StatusCode TrackDepositInCaloTool::getTraversedLayers(const Trk::TrackParameters* par, std::map<double, const CaloDetDescriptor*>& caloInfo , std::vector<Amg::Vector3D>& extrapolations) const { + // Cannot do this in initialize: see ATLASRECTS-5012 + StatusCode sc = StatusCode::SUCCESS; + std::call_once( m_initializeOnce, [this, &sc](){ sc = initializeDetectorInfo(); } ); + if ( !sc.isSuccess() ) return sc; + const Trk::TrackParameters* parAtSolenoid = 0; // --- To be replaced by a check, possibly extrapolating to solenoid surface if needed --- bool parIsAtSolenoid = true; @@ -1163,6 +1162,12 @@ that is closest to the track. /////////////////////////////////////////////////////////////////////////////// const CaloCell* TrackDepositInCaloTool::getClosestCellLAr(const Trk::TrackParameters* par, const CaloDetDescriptor* descr, const CaloCellContainer* caloCellCont) const { + // Cannot do this in initialize: see ATLASRECTS-5012 + if ( !m_caloDDM ) { + StatusCode sc = detStore()->retrieve( m_caloDDM ); + if ( !sc.isSuccess() ) return 0; + } + CaloCell_ID::CaloSample sample = descr->getSampling(); // ATH_MSG_INFO("Sampling = " << sample); const CaloDetDescrElement* cellDescr = m_caloDDM->get_element(sample, par->position().eta(), par->position().phi()); @@ -1196,6 +1201,12 @@ const CaloCell* TrackDepositInCaloTool::getClosestCellTile(const Trk::TrackParam // --- Fill vecHash --- CaloCell_ID::CaloSample sample = descr->getSampling(); + // Cannot do this in initialize: see ATLASRECTS-5012 + if ( !m_caloDDM ) { + StatusCode sc = detStore()->retrieve( m_caloDDM ); + if ( !sc.isSuccess() ) return result; + } + std::vector<IdentifierHash> vecHash; m_caloDDM->cellsInZone(etaMin, etaMax, phiMin, phiMax, sample, vecHash); std::vector<IdentifierHash>::iterator it = vecHash.begin(); @@ -1398,6 +1409,12 @@ std::vector<DepositInCalo> TrackDepositInCaloTool::deposits( const Trk::Track* t void TrackDepositInCaloTool::showNeighbours(const CaloCell* cell) const { + // Cannot do this in initialize: see ATLASRECTS-5012 + if ( !m_caloDDM ) { + StatusCode sc = detStore()->retrieve( m_caloDDM ); + if ( !sc.isSuccess() ) return; + } + // --- Get helper class for finding neighbours --- const CaloCell_ID* cellId = m_caloDDM->getCaloCell_ID(); if (cellId) { diff --git a/Tools/PROCTools/data/master_q221_AOD_digest.ref b/Tools/PROCTools/data/master_q221_AOD_digest.ref index 875c9e0059df7ff7f6de2b3ce537cd10901472ca..210c184fddb4160df7483fcdef624421d6ea4def 100644 --- a/Tools/PROCTools/data/master_q221_AOD_digest.ref +++ b/Tools/PROCTools/data/master_q221_AOD_digest.ref @@ -13,12 +13,12 @@ 284500 87473091 43 49 3 0 2 1 1 5 2 3 284500 87473096 72 76 3 2 2 0 2 3 2 1 284500 87473104 61 63 6 0 6 1 5 5 4 1 - 284500 87473114 93 78 7 2 13 1 12 8 5 3 + 284500 87473114 93 80 7 2 13 1 12 8 5 3 284500 87473121 93 100 6 3 16 4 12 6 5 1 284500 87473132 81 58 9 1 11 0 11 4 4 0 284500 87473137 81 71 8 3 15 0 15 6 6 0 284500 87473144 83 67 7 1 6 0 6 8 5 3 - 284500 87473154 89 89 7 0 10 2 8 8 4 4 + 284500 87473154 89 88 7 0 10 2 8 8 4 4 284500 87473162 52 52 3 0 7 0 7 3 2 1 284500 87473167 74 54 6 3 12 2 10 13 8 5 284500 87473171 82 70 8 3 4 2 2 5 3 2 diff --git a/Tools/PROCTools/data/master_q431_AOD_digest.ref b/Tools/PROCTools/data/master_q431_AOD_digest.ref index 7601ecfd0c02496387da5da6cd41126fc184c31c..b9bf6dd44355088efbc7839004f14a84e4e52589 100644 --- a/Tools/PROCTools/data/master_q431_AOD_digest.ref +++ b/Tools/PROCTools/data/master_q431_AOD_digest.ref @@ -14,11 +14,11 @@ 330470 1183746343 492 465 14 0 330470 1183746710 6 0 0 0 330470 1183751782 239 235 4 0 - 330470 1183752624 347 342 8 2 + 330470 1183752624 347 342 8 3 330470 1183753006 357 377 11 3 330470 1183754806 470 406 15 0 330470 1183769295 342 317 8 1 - 330470 1183769939 348 341 11 3 + 330470 1183769939 348 340 11 3 330470 1183773832 307 198 7 0 330470 1183775209 57 0 0 0 330470 1183787124 431 361 11 2