Verified Commit 18468351 authored by Tadej Novak's avatar Tadej Novak
Browse files

Various improvements to get muons running in MC for Run 4

parent c7471355
Pipeline #3250361 failed with stage
in 0 seconds
......@@ -239,7 +239,8 @@ def regSelTool_TRT_Cfg(flags):
# temporary
from PixelConditionsAlgorithms.PixelConditionsConfig import PixelCablingCondAlgCfg
return regSelToolCfg(flags, "TRT", CompFactory.TRT_RegSelCondAlg,
readout_geometry=TRT_ReadoutGeometryCfg(flags), conditions=PixelCablingCondAlgCfg(flags))
readout_geometry=TRT_ReadoutGeometryCfg(flags),
conditions=PixelCablingCondAlgCfg(flags)) # FIXME: TRT should not depend on Pixel
# ITk
def regSelTool_ITkPixel_Cfg(flags):
......@@ -272,18 +273,28 @@ def regSelTool_RPC_Cfg(flags):
conditions=RPCCablingConfigCfg(flags))
def regSelTool_TGC_Cfg(flags):
from MuonConfig.MuonCablingConfig import TGCCablingConfigCfg
from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg, TGCCablingConfigCfg
conditions = ComponentAccumulator()
conditions.merge(MDTCablingConfigCfg(flags)) # FIXME: should not depend on MDT
conditions.merge(TGCCablingConfigCfg(flags))
return regSelToolCfg(flags, "TGC", CompFactory.TGC_RegSelCondAlg,
conditions=TGCCablingConfigCfg(flags))
conditions=conditions)
def regSelTool_CSC_Cfg(flags):
return regSelToolCfg(flags, "CSC", CompFactory.CSC_RegSelCondAlg)
from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
return regSelToolCfg(flags, "CSC", CompFactory.CSC_RegSelCondAlg,
conditions=MDTCablingConfigCfg(flags)) # FIXME: CSC should not depend on MDT
def regSelTool_STGC_Cfg(flags):
return regSelToolCfg(flags, "STGC", CompFactory.sTGC_RegSelCondAlg)
from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
return regSelToolCfg(flags, "STGC", CompFactory.sTGC_RegSelCondAlg,
conditions=MDTCablingConfigCfg(flags)) # FIXME: sTGC should not depend on MDT
def regSelTool_MM_Cfg(flags):
return regSelToolCfg(flags, "MM", CompFactory.MM_RegSelCondAlg)
from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
return regSelToolCfg(flags, "MM", CompFactory.MM_RegSelCondAlg,
conditions=MDTCablingConfigCfg(flags)) # FIXME: MM should not depend on MDT
# calo
......
......@@ -13,9 +13,10 @@ class MuonPrdCacheNames(object):
TgcCache = "TgcPrdCache"
sTgcCache = "sTgcPrdCache"
MmCache = "MmPrdCache"
RpcCoinCache = "RpcCoinCache"
RpcCoinCache = "RpcCoinCache"
TgcCoinCache = "TgcCoinCache"
## This configuration function creates the IdentifiableCaches for PRD
#
# The function returns a ComponentAccumulator which should be loaded first
......@@ -45,161 +46,181 @@ def MuonPrdCacheCfg():
## This configuration function sets up everything for decoding RPC RDO to PRD conversion
#
# The function returns a ComponentAccumulator and the data-converting algorithm, which should be added to the right sequence by the user
def RpcRDODecodeCfg(flags, name="RpcRdoToRpcPrepData"):
from MuonConfig.MuonCondAlgConfig import RpcCondDbAlgCfg # MT-safe conditions access
acc = RpcCondDbAlgCfg(flags)
# We need the RPC cabling to be setup
from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg
acc.merge( RPCCablingConfigCfg(flags) )
def RpcRDODecodeCfg(flags, name="RpcRdoToRpcPrepData", **kwargs):
acc = ComponentAccumulator()
# Make sure muon geometry is configured
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
acc.merge(MuonGeoModelCfg(flags))
# We need the RPC cabling to be setup
from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg
acc.merge( RPCCablingConfigCfg(flags))
# Conditions not needed for online
if not flags.Common.isOnline:
from MuonConfig.MuonCondAlgConfig import RpcCondDbAlgCfg
acc.merge(RpcCondDbAlgCfg(flags))
# Get the RDO -> PRD tool
Muon__RpcRdoToPrepDataToolMT=CompFactory.Muon.RpcRdoToPrepDataToolMT
RpcRdoToRpcPrepDataTool = Muon__RpcRdoToPrepDataToolMT(name = "RpcRdoToRpcPrepDataTool")
if flags.Common.isOnline:
RpcRdoToRpcPrepDataTool.ReadKey = "" ## cond data not needed online
kwargs.setdefault("DecodingTool", CompFactory.Muon.RpcRdoToPrepDataToolMT(name="RpcRdoToRpcPrepDataTool",
ReadKey="RpcCondDbData" if not flags.Common.isOnline else "",
RpcPrdContainerCacheKey=MuonPrdCacheNames.RpcCache if flags.Muon.MuonTrigger else "",
RpcCoinDataContainerCacheKey=MuonPrdCacheNames.RpcCoinCache if flags.Muon.MuonTrigger else ""))
if flags.Muon.MuonTrigger:
RpcRdoToRpcPrepDataTool.RpcPrdContainerCacheKey = MuonPrdCacheNames.RpcCache
RpcRdoToRpcPrepDataTool.RpcCoinDataContainerCacheKey = MuonPrdCacheNames.RpcCoinCache
# Get the RDO -> PRD alorithm
RpcRdoToRpcPrepData=CompFactory.RpcRdoToRpcPrepData
RpcRdoToRpcPrepData = RpcRdoToRpcPrepData(name = name,
DecodingTool = RpcRdoToRpcPrepDataTool,
PrintPrepData = False )
# add RegSelTool
from RegionSelector.RegSelToolConfig import regSelTool_RPC_Cfg
RpcRdoToRpcPrepData.RegSel_RPC = acc.popToolsAndMerge( regSelTool_RPC_Cfg( flags ) )
kwargs.setdefault("RegSel_RPC", acc.popToolsAndMerge(regSelTool_RPC_Cfg(flags)))
if flags.Muon.MuonTrigger:
# Set the algorithm to RoI mode
RpcRdoToRpcPrepData.DoSeededDecoding = True
kwargs.setdefault("DoSeededDecoding", True)
from HLTSeeding.HLTSeedingConfig import mapThresholdToL1RoICollection
RpcRdoToRpcPrepData.RoIs = mapThresholdToL1RoICollection("MU")
kwargs.setdefault("RoIs", mapThresholdToL1RoICollection("MU"))
acc.addEventAlgo(RpcRdoToRpcPrepData)
# Add the RDO -> PRD alorithm
acc.addEventAlgo(CompFactory.RpcRdoToRpcPrepData(name, **kwargs))
return acc
def TgcRDODecodeCfg(flags, name="TgcRdoToTgcPrepData"):
acc = ComponentAccumulator()
# We need the TGC cabling to be setup
from MuonConfig.MuonCablingConfig import TGCCablingConfigCfg
acc.merge( TGCCablingConfigCfg(flags) )
def TgcRDODecodeCfg(flags, name="TgcRdoToTgcPrepData", **kwargs):
acc = ComponentAccumulator()
# Make sure muon geometry is configured
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
acc.merge(MuonGeoModelCfg(flags))
# We need the TGC cabling to be setup
from MuonConfig.MuonCablingConfig import TGCCablingConfigCfg
acc.merge(TGCCablingConfigCfg(flags))
# Get the RDO -> PRD tool
Muon__TgcRdoToPrepDataToolMT=CompFactory.Muon.TgcRdoToPrepDataToolMT
TgcRdoToTgcPrepDataTool = Muon__TgcRdoToPrepDataToolMT(name = "TgcRdoToTgcPrepDataTool")
# Get the RDO -> PRD alorithm
TgcRdoToTgcPrepData=CompFactory.TgcRdoToTgcPrepData
TgcRdoToTgcPrepData = TgcRdoToTgcPrepData(name = name,
DecodingTool = TgcRdoToTgcPrepDataTool,
PrintPrepData = False )
kwargs.setdefault("DecodingTool", CompFactory.Muon.TgcRdoToPrepDataToolMT(name="TgcRdoToTgcPrepDataTool"))
# add RegSelTool
from RegionSelector.RegSelToolConfig import regSelTool_TGC_Cfg
TgcRdoToTgcPrepData.RegSel_TGC = acc.popToolsAndMerge( regSelTool_TGC_Cfg( flags ) )
kwargs.setdefault("RegSel_TGC", acc.popToolsAndMerge(regSelTool_TGC_Cfg(flags)))
if flags.Muon.MuonTrigger:
# Set the algorithm to RoI mode
TgcRdoToTgcPrepData.DoSeededDecoding = True
kwargs.setdefault("DoSeededDecoding", True)
from HLTSeeding.HLTSeedingConfig import mapThresholdToL1RoICollection
TgcRdoToTgcPrepData.RoIs = mapThresholdToL1RoICollection("MU")
kwargs.setdefault("RoIs", mapThresholdToL1RoICollection("MU"))
acc.addEventAlgo(TgcRdoToTgcPrepData)
# Add the RDO -> PRD alorithm
acc.addEventAlgo(CompFactory.TgcRdoToTgcPrepData(name, **kwargs))
return acc
def MdtRDODecodeCfg(flags, name="MdtRdoToMdtPrepData"):
def StgcRDODecodeCfg(flags, name="StgcRdoToStgcPrepData", **kwargs):
acc = ComponentAccumulator()
from MuonConfig.MuonCalibrationConfig import MdtCalibrationToolCfg
# We need the MDT cabling to be setup
from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
acc.merge( MDTCablingConfigCfg(flags) )
# Make sure muon geometry is configured
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
acc.merge(MuonGeoModelCfg(flags))
# Get the RDO -> PRD tool
kwargs.setdefault("DecodingTool", CompFactory.Muon.sTgcRdoToPrepDataToolMT(name="sTgcRdoToTgcPrepDataTool"))
# add RegSelTool
# from RegionSelector.RegSelToolConfig import regSelTool_STGC_Cfg
# kwargs.setdefault("RegSel_STGC", acc.popToolsAndMerge(regSelTool_STGC_Cfg(flags)))
# Add the RDO -> PRD alorithm
acc.addEventAlgo(CompFactory.StgcRdoToStgcPrepData(name, **kwargs))
return acc
def MMRDODecodeCfg(flags, name="MM_RdoToMM_PrepData", **kwargs):
acc = ComponentAccumulator()
# Make sure muon geometry is configured
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
acc.merge(MuonGeoModelCfg(flags))
# Get the RDO -> PRD tool
kwargs.setdefault("DecodingTool", CompFactory.Muon.MmRdoToPrepDataToolMT(name="MmRdoToPrepDataTool"))
# add RegSelTool
# from RegionSelector.RegSelToolConfig import regSelTool_MM_Cfg
# kwargs.setdefault("RegSel_MM", acc.popToolsAndMerge(regSelTool_MM_Cfg(flags)))
from MuonConfig.MuonCalibrationConfig import MdtCalibDbAlgCfg
acc.merge (MdtCalibDbAlgCfg(flags))
# Add the RDO -> PRD alorithm
acc.addEventAlgo(CompFactory.MM_RdoToMM_PrepData(name, **kwargs))
return acc
def MdtRDODecodeCfg(flags, name="MdtRdoToMdtPrepData", **kwargs):
acc = ComponentAccumulator()
from MuonConfig.MuonCalibrationConfig import MdtCalibrationToolCfg
# Make sure muon geometry is configured
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
acc.merge(MuonGeoModelCfg(flags))
# We need the MDT cabling to be setup
from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
acc.merge(MDTCablingConfigCfg(flags))
# Get the RDO -> PRD tool
Muon__MdtRdoToPrepDataToolMT=CompFactory.Muon.MdtRdoToPrepDataToolMT
calibTool = acc.popToolsAndMerge( MdtCalibrationToolCfg(flags))
MdtRdoToMdtPrepDataTool = Muon__MdtRdoToPrepDataToolMT(name = "MdtRdoToMdtPrepDataTool", CalibrationTool = calibTool)
# Get the RDO -> PRD alorithm
MdtRdoToMdtPrepData=CompFactory.MdtRdoToMdtPrepData
MdtRdoToMdtPrepData = MdtRdoToMdtPrepData(name = name,
DecodingTool = MdtRdoToMdtPrepDataTool,
PrintPrepData = False)
kwargs.setdefault("DecodingTool", CompFactory.Muon.MdtRdoToPrepDataToolMT(name="MdtRdoToMdtPrepDataTool",
CalibrationTool=acc.popToolsAndMerge(MdtCalibrationToolCfg(flags))))
# add RegSelTool
from RegionSelector.RegSelToolConfig import regSelTool_MDT_Cfg
MdtRdoToMdtPrepData.RegSel_MDT = acc.popToolsAndMerge( regSelTool_MDT_Cfg( flags ) )
kwargs.setdefault("RegSel_MDT", acc.popToolsAndMerge(regSelTool_MDT_Cfg(flags)))
if flags.Muon.MuonTrigger:
# Set the algorithm to RoI mode
MdtRdoToMdtPrepData.DoSeededDecoding = True
kwargs.setdefault("DoSeededDecoding", True)
from HLTSeeding.HLTSeedingConfig import mapThresholdToL1RoICollection
MdtRdoToMdtPrepData.RoIs = mapThresholdToL1RoICollection("MU")
kwargs.setdefault("RoIs", mapThresholdToL1RoICollection("MU"))
acc.addEventAlgo(MdtRdoToMdtPrepData)
# Add the RDO -> PRD alorithm
acc.addEventAlgo(CompFactory.MdtRdoToMdtPrepData(name, **kwargs))
return acc
def CscRDODecodeCfg(flags, name="CscRdoToCscPrepData"):
def CscRDODecodeCfg(flags, name="CscRdoToCscPrepData", **kwargs):
acc = ComponentAccumulator()
# Make sure muon geometry is configured
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
acc.merge(MuonGeoModelCfg(flags))
# We need the CSC cabling to be setup
from MuonConfig.MuonCablingConfig import CSCCablingConfigCfg # Not yet been prepared
acc.merge( CSCCablingConfigCfg(flags) )
acc.merge(CSCCablingConfigCfg(flags))
from MuonConfig.MuonCondAlgConfig import CscCondDbAlgCfg
acc.merge( CscCondDbAlgCfg(flags) )
# Make sure muon geometry is configured
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
acc.merge(MuonGeoModelCfg(flags))
acc.merge(CscCondDbAlgCfg(flags))
# Get the RDO -> PRD tool
Muon__CscRdoToCscPrepDataToolMT=CompFactory.Muon.CscRdoToCscPrepDataToolMT
CscRdoToCscPrepDataTool = Muon__CscRdoToCscPrepDataToolMT(name = "CscRdoToCscPrepDataTool")
# Get the RDO -> PRD alorithm
CscRdoToCscPrepData=CompFactory.CscRdoToCscPrepData
CscRdoToCscPrepData = CscRdoToCscPrepData(name = name,
CscRdoToCscPrepDataTool = CscRdoToCscPrepDataTool,
PrintPrepData = False )
# TODO: setup dependencies properly
kwargs.setdefault("CscRdoToCscPrepDataTool", CompFactory.Muon.CscRdoToCscPrepDataToolMT(name="CscRdoToCscPrepDataTool"))
# add RegSelTool
from RegionSelector.RegSelToolConfig import regSelTool_CSC_Cfg
CscRdoToCscPrepData.RegSel_CSC = acc.popToolsAndMerge( regSelTool_CSC_Cfg( flags ) )
kwargs.setdefault("RegSel_CSC", acc.popToolsAndMerge(regSelTool_CSC_Cfg(flags)))
if flags.Muon.MuonTrigger:
# Set the algorithm to RoI mode
CscRdoToCscPrepData.DoSeededDecoding = True
kwargs.setdefault("DoSeededDecoding", True)
from HLTSeeding.HLTSeedingConfig import mapThresholdToL1RoICollection
CscRdoToCscPrepData.RoIs = mapThresholdToL1RoICollection("MU")
kwargs.setdefault("RoIs", mapThresholdToL1RoICollection("MU"))
acc.addEventAlgo(CscRdoToCscPrepData)
# Add the RDO -> PRD alorithm
acc.addEventAlgo(CompFactory.CscRdoToCscPrepData(name, **kwargs))
return acc
def CscClusterBuildCfg(flags, name= "CscThresholdClusterBuilder"):
def CscClusterBuildCfg(flags, name="CscThresholdClusterBuilder"):
acc = ComponentAccumulator()
# Get cluster creator tool
CscThresholdClusterBuilderTool=CompFactory.CscThresholdClusterBuilderTool
CscClusterBuilderTool = CscThresholdClusterBuilderTool(name = "CscThresholdClusterBuilderTool" )
#CSC cluster building
CscThresholdClusterBuilder=CompFactory.CscThresholdClusterBuilder
CscClusterBuilder = CscThresholdClusterBuilder(name = name,
......@@ -208,26 +229,43 @@ def CscClusterBuildCfg(flags, name= "CscThresholdClusterBuilder"):
return acc
def MuonPRD_MultiTruthMakerCfg(flags, name="MuonPRD_MultiTruthMaker", **kwargs):
acc = ComponentAccumulator()
# TODO: properly declare dependencies
acc.addEventAlgo(CompFactory.MuonPRD_MultiTruthMaker(name, **kwargs))
return acc
def MuonRDOtoPRDConvertorsCfg(flags):
# Schedule RDO conversion
# Schedule RDO conversion
acc = ComponentAccumulator()
rpcdecodingAcc = RpcRDODecodeCfg( flags )
acc.merge(rpcdecodingAcc)
if flags.Detector.GeometryRPC:
acc.merge(RpcRDODecodeCfg(flags))
if flags.Detector.GeometryTGC:
acc.merge(TgcRDODecodeCfg(flags))
if flags.Detector.GeometrysTGC:
acc.merge(StgcRDODecodeCfg(flags))
if flags.Detector.GeometryMM:
acc.merge(MMRDODecodeCfg(flags))
tgcdecodingAcc = TgcRDODecodeCfg( flags )
acc.merge(tgcdecodingAcc)
if flags.Detector.GeometryMDT:
acc.merge(MdtRDODecodeCfg(flags))
mdtdecodingAcc = MdtRDODecodeCfg( flags )
acc.merge(mdtdecodingAcc)
if flags.Detector.GeometryCSC:
acc.merge(CscRDODecodeCfg(flags))
acc.merge(CscClusterBuildCfg(flags))
cscdecodingAcc = CscRDODecodeCfg( flags )
acc.merge(cscdecodingAcc)
if flags.Input.isMC:
acc.merge(MuonPRD_MultiTruthMakerCfg(flags))
cscbuildingAcc = CscClusterBuildCfg( flags )
acc.merge(cscbuildingAcc)
return acc
# This function runs the decoding on a data file
def muonRdoDecodeTestData( forTrigger = False ):
from AthenaCommon.Configurable import Configurable
......@@ -236,7 +274,7 @@ def muonRdoDecodeTestData( forTrigger = False ):
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.TestDefaults import defaultTestFiles
ConfigFlags.Input.Files = defaultTestFiles.RAW
# Set global tag by hand for now
ConfigFlags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2018-13"#"CONDBR2-BLKPA-2015-17"
ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01"#"ATLAS-R2-2015-03-01-00"
......@@ -248,7 +286,7 @@ def muonRdoDecodeTestData( forTrigger = False ):
log.setLevel(INFO)
log.info('About to setup Raw data decoding')
cfg=ComponentAccumulator()
......@@ -305,7 +343,7 @@ def muonRdoDecodeTestMC():
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
cfg.merge(PoolReadCfg(ConfigFlags))
# Schedule RDO conversion
# Schedule RDO conversion
cfg.merge( MuonRDOtoPRDConvertorsCfg( ConfigFlags) )
log.info('Print Config')
......@@ -317,9 +355,9 @@ def muonRdoDecodeTestMC():
cfg.store(f)
f.close()
return cfg
if __name__=="__main__":
# To run this, do e.g.
# To run this, do e.g.
# python ../athena/MuonSpectrometer/MuonConfig/python/MuonRdoDecodeConfig.py
cfg = muonRdoDecodeTestData()
#muonRdoDecodeTestMC()
......
......@@ -406,19 +406,18 @@ def MuonPhiHitSelector(flags, name="MuonPhiHitSelector",**kwargs):
def MuPatHitToolCfg(flags, name="MuPatHitTool",**kwargs):
Muon__MuPatHitTool=CompFactory.Muon.MuPatHitTool
from MuonConfig.MuonRIO_OnTrackCreatorConfig import CscClusterOnTrackCreatorCfg,MdtDriftCircleOnTrackCreatorCfg
from MuonConfig.MuonRIO_OnTrackCreatorConfig import MdtDriftCircleOnTrackCreatorCfg
result = MdtDriftCircleOnTrackCreatorCfg(flags)
mdt_creator=result.getPrimary()
kwargs.setdefault("MdtRotCreator", mdt_creator)
acc = CscClusterOnTrackCreatorCfg(flags)
csc_cluster_creator = acc.popPrivateTools()
result.merge(acc)
kwargs.setdefault("CscRotCreator", csc_cluster_creator)
result.setPrivateTools(Muon__MuPatHitTool(name,**kwargs))
if flags.Detector.GeometryCSC:
from MuonConfig.MuonRIO_OnTrackCreatorConfig import CscClusterOnTrackCreatorCfg
kwargs.setdefault("CscRotCreator", result.popToolsAndMerge(CscClusterOnTrackCreatorCfg(flags)))
else:
kwargs.setdefault("CscRotCreator", "")
result.setPrivateTools(CompFactory.Muon.MuPatHitTool(name,**kwargs))
return result
......
......@@ -616,27 +616,31 @@ def MooSegmentFinderAlgCfg(flags, name = "MuonSegmentMaker", **kwargs):
def MooSegmentFinderAlg_NCBCfg(flags, name = "MuonSegmentMaker_NCB", **kwargs):
result = ComponentAccumulator()
# Configure NCB MooSegmentFinder
acc = CscSegmentUtilToolCfg(flags, name='CscSegmentUtilTool_NCB', TightenChi2 = False, IPconstraint=False)
csc_segment_util_tool = acc.getPrimary()
result.merge(acc)
acc = Csc2dSegmentMakerCfg(flags, name='Csc2dSegmentMaker_NCB', segmentTool=csc_segment_util_tool)
csc_2d_segment_maker = acc.getPrimary()
result.merge(acc)
acc = Csc4dSegmentMakerCfg(flags, name='Csc4dSegmentMaker_NCB', segmentTool=csc_segment_util_tool)
csc_4d_segment_maker = acc.getPrimary()
result.merge(acc)
if flags.Detector.GeometryCSC:
acc = CscSegmentUtilToolCfg(flags, name='CscSegmentUtilTool_NCB', TightenChi2 = False, IPconstraint=False)
csc_segment_util_tool = acc.getPrimary()
result.merge(acc)
acc = Csc2dSegmentMakerCfg(flags, name='Csc2dSegmentMaker_NCB', segmentTool=csc_segment_util_tool)
csc_2d_segment_maker = acc.getPrimary()
result.merge(acc)
acc = Csc4dSegmentMakerCfg(flags, name='Csc4dSegmentMaker_NCB', segmentTool=csc_segment_util_tool)
csc_4d_segment_maker = acc.getPrimary()
result.merge(acc)
else:
csc_2d_segment_maker = ""
csc_4d_segment_maker = ""
acc = MooSegmentFinderCfg(flags, name='MooSegmentFinder_NCB', Csc2dSegmentMaker=csc_2d_segment_maker,
Csc4dSegmentMaker=csc_4d_segment_maker,
DoMdtSegments=False,DoSegmentCombinations=False,DoSegmentCombinationCleaning=False)
segment_finder_tool=(acc.popPrivateTools())
result.addPublicTool(segment_finder_tool)
result.merge(acc)
kwargs.setdefault('SegmentFinder', segment_finder_tool)
# Now set other NCB properties
......@@ -651,7 +655,7 @@ def MooSegmentFinderAlg_NCBCfg(flags, name = "MuonSegmentMaker_NCB", **kwargs):
kwargs.setdefault('UseTGCNextBC', False)
kwargs.setdefault('doTGCClust', False)
kwargs.setdefault('doRPCClust', False)
acc = MooSegmentFinderAlgCfg(flags, name=name, **kwargs)
result.merge(acc)
return result
......@@ -672,7 +676,7 @@ def MuonSegmentFindingCfg(flags, cardinality=1):
from MuonConfig.MuonBytestreamDecodeConfig import MuonByteStreamDecodersCfg
result.merge( MuonByteStreamDecodersCfg(flags) )
if flags.Input.Format == 'BS' or 'StreamRDO' in flags.Input.ProcessingTags:
if flags.Input.Format == 'BS' or 'StreamRDO' in flags.Input.ProcessingTags or 'OutputStreamRDO' in flags.Input.ProcessingTags:
from MuonConfig.MuonRdoDecodeConfig import MuonRDOtoPRDConvertorsCfg
result.merge( MuonRDOtoPRDConvertorsCfg(flags) )
......
......@@ -333,42 +333,36 @@ def MuonSegmentRegionRecoveryToolCfg(flags, name="MuonSegmentRegionRecoveryTool"
return result
def MuPatCandidateToolCfg(flags, name="MuPatCandidateTool", **kwargs):
Muon__MuPatCandidateTool=CompFactory.Muon.MuPatCandidateTool
# https://gitlab.cern.ch/atlas/athena/blob/release/22.0.3/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuPatTools.py#L32
from MuonConfig.MuonRIO_OnTrackCreatorConfig import CscClusterOnTrackCreatorCfg,MdtDriftCircleOnTrackCreatorCfg
from MuonConfig.MuonRecToolsConfig import MuPatHitToolCfg
from MuonConfig.MuonRIO_OnTrackCreatorConfig import MdtDriftCircleOnTrackCreatorCfg
result = MdtDriftCircleOnTrackCreatorCfg(flags)
mdt_dcot_creator = result.getPrimary()
kwargs.setdefault("MdtRotCreator", mdt_dcot_creator)
acc = CscClusterOnTrackCreatorCfg(flags)
csc_cluster_creator = acc.popPrivateTools()
result.merge(acc)
kwargs.setdefault("CscRotCreator", csc_cluster_creator)
if flags.Detector.GeometryCSC:
from MuonConfig.MuonRIO_OnTrackCreatorConfig import CscClusterOnTrackCreatorCfg
kwargs.setdefault("CscRotCreator", result.popToolsAndMerge(CscClusterOnTrackCreatorCfg(flags)))
else:
kwargs.setdefault("CscRotCreator", "")
kwargs.setdefault("MuonPrinterTool", MuonEDMPrinterTool(flags) )
acc = MuPatHitToolCfg(flags)
mu_pat_hit_tool = acc.getPrimary()
result.merge(acc)
kwargs.setdefault("HitTool", mu_pat_hit_tool)
from MuonConfig.MuonRecToolsConfig import MuPatHitToolCfg
kwargs.setdefault("HitTool", result.getPrimaryAndMerge(MuPatHitToolCfg(flags)))
mu_pat_cand_tool = Muon__MuPatCandidateTool(name, **kwargs)
result.setPrivateTools(mu_pat_cand_tool)
result.setPrivateTools(CompFactory.Muon.MuPatCandidateTool(name, **kwargs))
return result
def MuonChamberHoleRecoveryToolCfg(flags, name="MuonChamberHoleRecoveryTool", **kwargs):
from MuonConfig.MuonRIO_OnTrackCreatorConfig import CscClusterOnTrackCreatorCfg,MdtDriftCircleOnTrackCreatorCfg
from MuonConfig.MuonRecToolsConfig import MuonExtrapolatorCfg
Muon__MuonChamberHoleRecoveryTool=CompFactory.Muon.MuonChamberHoleRecoveryTool
result=ComponentAccumulator()
# Not setting explicitly MuonStationIntersectSvc
from MuonConfig.MuonRecToolsConfig import MuonExtrapolatorCfg
acc = MuonExtrapolatorCfg(flags)
kwargs.setdefault("Extrapolator", result.popToolsAndMerge(acc))
from MuonConfig.MuonRIO_OnTrackCreatorConfig import MdtDriftCircleOnTrackCreatorCfg
acc = MdtDriftCircleOnTrackCreatorCfg(flags)
mdt_dcot_creator = acc.getPrimary()
kwargs.setdefault("MdtRotCreator", mdt_dcot_creator)
......@@ -379,10 +373,8 @@ def MuonChamberHoleRecoveryToolCfg(flags, name="MuonChamberHoleRecoveryTool", **
extrakwargs={}
if flags.Muon.enableErrorTuning or not flags.Input.isMC:
extrakwargs["ErrorScalerBeta"] = 0.200
acc = CscClusterOnTrackCreatorCfg(flags, **extrakwargs)
csc_cluster_creator = acc.popPrivateTools()
result.merge(acc)
kwargs.setdefault("CscRotCreator", csc_cluster_creator)
from MuonConfig.MuonRIO_OnTrackCreatorConfig import CscClusterOnTrackCreatorCfg
kwargs.setdefault("CscRotCreator", result.popToolsAndMerge(CscClusterOnTrackCreatorCfg(flags, **extrakwargs)))
else:
kwargs["CscRotCreator"] = None