Skip to content
Snippets Groups Projects
Commit d3c8b91c authored by scott snyder's avatar scott snyder
Browse files

CaloTriggerTool: Trying to fix MT dictionary error.

CaloTriggerTowerService used to read LArTTCellMap via a conditions callback.
This is not thread-friendly, so it was changed; it is now retrieved from
the detector store during event processing.  However, this can lead
to the I/O system triggering the creation of TClass instances for the
LArTTCellMap persistent classes, and TClass has been observed to sometimes
malfunction when created in a MT context (at least as of root 6.22.00).
The resulting dictionary failures were causing jobs to occasionally
crash with bad_alloc exceptions.  Try to fix by forcing the needed
TClass instances to be created during initialize.
parent 93e95499
No related branches found
No related tags found
No related merge requests found
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
# Declare the package name: # Declare the package name:
atlas_subdir( CaloTriggerTool ) atlas_subdir( CaloTriggerTool )
find_package( ROOT COMPONENTS Core )
# Component(s) in the package: # Component(s) in the package:
atlas_add_library( CaloTriggerToolLib atlas_add_library( CaloTriggerToolLib
src/*.cxx src/*.cxx
PUBLIC_HEADERS CaloTriggerTool PUBLIC_HEADERS CaloTriggerTool
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES AthenaBaseComps AthenaKernel CaloIdentifier GaudiKernel Identifier StoreGateLib TrigT1CaloCalibConditions LINK_LIBRARIES AthenaBaseComps AthenaKernel CaloIdentifier GaudiKernel Identifier StoreGateLib TrigT1CaloCalibConditions
PRIVATE_LINK_LIBRARIES LArCablingLib LArIdentifier ) PRIVATE_LINK_LIBRARIES LArCablingLib LArIdentifier ${ROOT_LIBARIES} )
atlas_add_component( CaloTriggerTool atlas_add_component( CaloTriggerTool
src/components/*.cxx src/components/*.cxx
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "CaloIdentifier/LArEM_ID.h" #include "CaloIdentifier/LArEM_ID.h"
#include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/IToolSvc.h"
#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ServiceHandle.h"
#include "TClass.h"
//=========================================================== //===========================================================
CaloTriggerTowerService::CaloTriggerTowerService( const std::string& type, CaloTriggerTowerService::CaloTriggerTowerService( const std::string& type,
...@@ -94,6 +95,17 @@ StatusCode CaloTriggerTowerService::initialize () ...@@ -94,6 +95,17 @@ StatusCode CaloTriggerTowerService::initialize ()
msg() << MSG::DEBUG << "Successfully accessed LArOnlineID helper" << endmsg; msg() << MSG::DEBUG << "Successfully accessed LArOnlineID helper" << endmsg;
} }
// Make sure the dictionaries for the LArTTCellMap persistent classes
// are available. We used to read this object via a conditions callback,
// but callbacks are not thread-friendly, so this was changed to retrieving
// it from detStore during event processing. However, this meant that
// the TClass's for the persistent objects were also being loaded
// at that time. As of root 6.22.00, at least, TClass can sometimes
// fail to properly load a dictionary when it's being run in a multithreaded
// context. So force the needed dictionaries to load now.
TClass::GetClass ("LArTTCell_P");
TClass::GetClass ("LArTTCell_P::LArTTCell_P_t");
msg()<<MSG::INFO<<" ====> ...CaloTriggerTowerService::init() OK "<< endmsg; msg()<<MSG::INFO<<" ====> ...CaloTriggerTowerService::init() OK "<< endmsg;
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment