diff --git a/InnerDetector/InDetDigitization/FastTRT_Digitization/share/preInclude.FastTRT_Digi.Validation.py b/InnerDetector/InDetDigitization/FastTRT_Digitization/share/preInclude.FastTRT_Digi.Validation.py index 1613a0a6dc308a2590b0077a56f8eee8cf316495..29dbc3c3a7a6d264abba1b4c6b94c61d5cea9590 100644 --- a/InnerDetector/InDetDigitization/FastTRT_Digitization/share/preInclude.FastTRT_Digi.Validation.py +++ b/InnerDetector/InDetDigitization/FastTRT_Digitization/share/preInclude.FastTRT_Digi.Validation.py @@ -21,10 +21,17 @@ InDetTRT_LocalOccupancy = InDet__TRT_LocalOccupancy( name = "InDet_TRT_LocalOccu TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool ) ToolSvc += InDetTRT_LocalOccupancy +from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import TRT_ToT_dEdx +InDetTRT_ToT_dEdx = TRT_ToT_dEdx( name = "InDet_TRT_ToT_dEdx", + TRTStrawSummaryTool = InDetTRTStrawStatusSummaryTool, + TRT_LocalOccupancyTool = InDetTRT_LocalOccupancy ) +ToolSvc += InDetTRT_ToT_dEdx + from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2 InDetTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2( name = "InDetTRT_ElectronPidTool", TRT_LocalOccupancyTool = InDetTRT_LocalOccupancy, TRTStrawSummaryTool = InDetTRTStrawStatusSummaryTool, + TRT_ToT_dEdx_Tool = InDetTrigTRT_ToT_dEdx, isData = (globalflags.DataSource == 'data') ) ToolSvc += InDetTRT_ElectronPidTool diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py index 591e8726b9d66ab0d49483d1206afc2b2db119e1..3651d2f3863e08f1bdba6650d9a3fe219d6e4906 100644 --- a/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py +++ b/InnerDetector/InDetExample/InDetRecExample/python/TrackingCommon.py @@ -896,44 +896,46 @@ def getInDetTRT_LocalOccupancy(name ="InDet_TRT_LocalOccupancy", **kwargs) : return InDet__TRT_LocalOccupancy(name=the_name, **setDefaults( kwargs, isTrigger = False) ) @makePublicTool -def getInDetTRT_ElectronPidTool(name = "InDetTRT_ElectronPidTool", **kwargs) : +def getInDetTRT_dEdxTool(name = "InDetTRT_dEdxTool", **kwargs) : the_name = makeName( name, kwargs) from AthenaCommon.DetFlags import DetFlags from InDetRecExample.InDetJobProperties import InDetFlags - if not DetFlags.haveRIO.TRT_on() or InDetFlags.doSLHC() or InDetFlags.doHighPileup() \ + if not DetFlags.haveRIO.TRT_on() or InDetFlags.doSLHC() or InDetFlags.doHighPileup() \ or InDetFlags.useExistingTracksAsInput(): # TRT_RDOs (used by the TRT_LocalOccupancy tool) are not present in ESD return None - - if 'TRTStrawSummaryTool' not in kwargs : - kwargs = setDefaults( kwargs, TRTStrawSummaryTool = getInDetTRTStrawStatusSummaryTool()) + + from AthenaCommon.GlobalFlags import globalflags + kwargs = setDefaults( kwargs, TRT_dEdx_isData = (globalflags.DataSource == 'data')) if 'TRT_LocalOccupancyTool' not in kwargs : kwargs = setDefaults( kwargs, TRT_LocalOccupancyTool = getInDetTRT_LocalOccupancy()) - from AthenaCommon.GlobalFlags import globalflags - kwargs = setDefaults( kwargs, isData = (globalflags.DataSource == 'data')) - - from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2 - return InDet__TRT_ElectronPidToolRun2(name = the_name, **kwargs) + from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import TRT_ToT_dEdx + return TRT_ToT_dEdx(name = the_name, **kwargs) @makePublicTool -def getInDetTRT_dEdxTool(name = "InDetTRT_dEdxTool", **kwargs) : +def getInDetTRT_ElectronPidTool(name = "InDetTRT_ElectronPidTool", **kwargs) : the_name = makeName( name, kwargs) from AthenaCommon.DetFlags import DetFlags from InDetRecExample.InDetJobProperties import InDetFlags - if not DetFlags.haveRIO.TRT_on() or InDetFlags.doSLHC() or InDetFlags.doHighPileup() \ + if not DetFlags.haveRIO.TRT_on() or InDetFlags.doSLHC() or InDetFlags.doHighPileup() \ or InDetFlags.useExistingTracksAsInput(): # TRT_RDOs (used by the TRT_LocalOccupancy tool) are not present in ESD return None - - from AthenaCommon.GlobalFlags import globalflags - kwargs = setDefaults( kwargs, TRT_dEdx_isData = (globalflags.DataSource == 'data')) + + if 'TRTStrawSummaryTool' not in kwargs : + kwargs = setDefaults( kwargs, TRTStrawSummaryTool = getInDetTRTStrawStatusSummaryTool()) if 'TRT_LocalOccupancyTool' not in kwargs : kwargs = setDefaults( kwargs, TRT_LocalOccupancyTool = getInDetTRT_LocalOccupancy()) - from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import TRT_ToT_dEdx - return TRT_ToT_dEdx(name = the_name, **kwargs) + if 'TRT_ToT_dEdx_Tool' not in kwargs : + kwargs = setDefaults( kwargs, TRT_ToT_dEdx_Tool = getInDetTRT_dEdxTool()) + + from AthenaCommon.GlobalFlags import globalflags + kwargs = setDefaults( kwargs, isData = (globalflags.DataSource == 'data')) + from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2 + return InDet__TRT_ElectronPidToolRun2(name = the_name, **kwargs) @makePublicTool def getInDetSummaryHelper(name='InDetSummaryHelper',**kwargs) : diff --git a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredLowBetaFinder.py b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredLowBetaFinder.py index ef8590a90f8c6f860fb82b50e32bd69b7dbd89fc..aa1984b6bf21b26cc5267021fadecfbe43525bb2 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredLowBetaFinder.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredLowBetaFinder.py @@ -12,6 +12,7 @@ class ConfiguredLowBetaFinder: def __init__(self, InputCollection=None, IsSimulation=False, unslimmed_tracks_container="CombinedInDetTracks"): from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() + from InDetRecExample.TrackingCommon import getInDetTRT_dEdxTool from InDetLowBetaFinder.InDetLowBetaFinderConf import InDet__LowBetaAlg InDetLowBetaTrkAlgorithm = InDet__LowBetaAlg( name = "InDetLowBetaTrkAlgorithm", MinimumTRThitsForIDpid = 5, @@ -22,6 +23,7 @@ class ConfiguredLowBetaFinder: CSMP_Rcorrection_One = -3.0, CSMP_Rcorrection_Two = 0.0, CSMP_TimingOffset = 0.0, + TRT_ToT_dEdx_Tool = getInDetTRT_dEdxTool(), MC_flag = IsSimulation) topSequence += InDetLowBetaTrkAlgorithm diff --git a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/LowBetaAlg.cxx b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/LowBetaAlg.cxx index be3c2c9be1a4ca8a8b54607c69e2de408a9735c6..cb1db3a294bbed4209529490b5cb54d6c76fff7a 100644 --- a/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/LowBetaAlg.cxx +++ b/InnerDetector/InDetRecAlgs/InDetLowBetaFinder/src/LowBetaAlg.cxx @@ -45,7 +45,7 @@ namespace InDet m_trtconddbsvc("TRT_CalDbSvc",name), m_fieldServiceHandle("AtlasFieldSvc",name), m_TrtTool(0), - m_TRTdEdxTool("TRT_ToT_dEdx"), + m_TRTdEdxTool(), m_TrtToolsSuccess{}, m_TrtToolInitSuccess{} {