Skip to content
Snippets Groups Projects
Commit eed020d8 authored by Edward Moyse's avatar Edward Moyse Committed by Walter Lampl
Browse files

Fix EventCnvSuperTool config (ATLASRECTS-5160)

The problem seems to be two-fold - the wrong detflag is arguably being tested, and the ToolHandles are retrieved unless the key is set to null.
parent 63301a2e
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,10 @@
from AthenaCommon.DetFlags import DetFlags
from AthenaCommon.AppMgr import ToolSvc
from RecExConfig import RecFlags as rec
from TrkEventCnvTools.TrkEventCnvToolsConf import Trk__EventCnvSuperTool
TrkEventCnvSuperTool = Trk__EventCnvSuperTool(name="EventCnvSuperTool")
ToolSvc+=TrkEventCnvSuperTool
TrkEventCnvSuperTool.DoMuons = DetFlags.detdescr.Muon_on()
TrkEventCnvSuperTool.DoID = DetFlags.detdescr.ID_on()
TrkEventCnvSuperTool.DoMuons = rec.doMuon() and DetFlags.detdescr.Muon_on()
TrkEventCnvSuperTool.DoID = rec.doInDet() and DetFlags.detdescr.ID_on()
......@@ -42,7 +42,11 @@ Trk::EventCnvSuperTool::initialize(){
if( sc.isFailure() ) {
msg(MSG::WARNING) << "Could not get AtlasDetectorID " << endmsg;
}
if (!m_doID && !m_doMuons){
ATH_MSG_WARNING("This tool has been configured without either Muons or ID, and so can't do anything. Problems likely.");
}
//Now try to get the tools
if ( m_doID && !m_idCnvTool.empty() ) {
if (m_idCnvTool.retrieve().isFailure() )
......@@ -54,6 +58,8 @@ Trk::EventCnvSuperTool::initialize(){
msg(MSG::VERBOSE) << "Retrieved tool " << m_idCnvTool << endmsg;
m_haveIdCnvTool=true;
}
} else {
m_idCnvTool.setTypeAndName("");
}
if ( m_doMuons && !m_muonCnvTool.empty() ) {
......@@ -66,6 +72,8 @@ Trk::EventCnvSuperTool::initialize(){
msg(MSG::VERBOSE) << "Retrieved tool " << m_muonCnvTool << endmsg;
m_haveMuonCnvTool=true;
}
} else {
m_muonCnvTool.setTypeAndName("");
}
// Print an extra warning if neither tool found.
......
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