3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
8 MdtCsmCache =
"MdtCsmRdoCache"
9 CscCache =
"CscRdoCache"
10 RpcCache =
"RpcRdoCache"
11 TgcCache =
"TgcRdoCache"
22 MuonCacheCreator=CompFactory.MuonCacheCreator
24 CscCacheKey = (MuonCacheNames.CscCache
if flags.Detector.GeometryCSC
else ""),
25 RpcCacheKey = MuonCacheNames.RpcCache,
26 TgcCacheKey = MuonCacheNames.TgcCache)
28 acc.addEventAlgo( cacheCreator, primary=
True )
38 from MuonConfig.MuonCablingConfig
import RPCCablingConfigCfg
42 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
46 RPCRodDecoder = CompFactory.Muon.RpcROD_Decoder(name =
"RpcROD_Decoder",NOBXS=flags.Trigger.L1MuonSim.RPCNBX)
50 keyName = f
"{flags.Overlay.BkgPrefix}RPCPAD" if flags.Overlay.ByteStream
else "RPCPAD"
51 MuonRpcRawDataProviderTool = CompFactory.Muon.RPC_RawDataProviderToolMT(name =
"RPC_RawDataProviderToolMT",
52 Decoder = RPCRodDecoder,
53 RdoLocation = keyName )
54 if flags.Muon.MuonTrigger:
55 MuonRpcRawDataProviderTool.RpcContainerCacheKey = MuonCacheNames.RpcCache
56 MuonRpcRawDataProviderTool.WriteOutRpcSectorLogic =
False
60 Muon__RpcRawDataProvider=CompFactory.Muon.RpcRawDataProvider
61 RpcRawDataProvider = Muon__RpcRawDataProvider(name = name,
62 ProviderTool = MuonRpcRawDataProviderTool, **kwargs )
64 if flags.Muon.MuonTrigger:
66 from RegionSelector.RegSelToolConfig
import regSelTool_RPC_Cfg
67 RpcRawDataProvider.RegionSelectionTool = acc.popToolsAndMerge(
regSelTool_RPC_Cfg( flags ) )
70 acc.addEventAlgo(RpcRawDataProvider, primary=
True)
77 from MuonConfig.MuonCablingConfig
import NRPCCablingConfigCfg
81 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
86 keyName = flags.Overlay.BkgPrefix +
"NRPCRDO" if flags.Common.isOverlay
else "NRPCRDO"
87 MuonNrpcRawDataProviderTool = CompFactory.Muon.NRPC_RawDataProviderTool(name =
"NRPC_RawDataProviderTool",
88 NrpcRdoKey = keyName )
91 NrpcRawDataProvider = CompFactory.Muon.NrpcRawDataProvider(name = name,
92 ProviderTool = MuonNrpcRawDataProviderTool, **kwargs )
94 acc.addEventAlgo(NrpcRawDataProvider, primary=
True)
101 from MuonConfig.MuonCablingConfig
import TGCCablingConfigCfg
105 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
109 Muon__TGC_RodDecoderReadout=CompFactory.Muon.TGC_RodDecoderReadout
110 TGCRodDecoder = Muon__TGC_RodDecoderReadout(name =
"TgcROD_Decoder")
114 keyName = f
"{flags.Overlay.BkgPrefix}TGCRDO" if flags.Overlay.ByteStream
else "TGCRDO"
115 Muon__TGC_RawDataProviderToolMT=CompFactory.Muon.TGC_RawDataProviderToolMT
116 MuonTgcRawDataProviderTool = Muon__TGC_RawDataProviderToolMT(name =
"TGC_RawDataProviderToolMT",
117 Decoder = TGCRodDecoder,
118 RdoLocation = keyName )
120 if flags.Muon.MuonTrigger:
121 MuonTgcRawDataProviderTool.TgcContainerCacheKey = MuonCacheNames.TgcCache
125 Muon__TgcRawDataProvider=CompFactory.Muon.TgcRawDataProvider
126 TgcRawDataProvider = Muon__TgcRawDataProvider(name = name,
127 ProviderTool = MuonTgcRawDataProviderTool, **kwargs )
128 if flags.Muon.MuonTrigger:
130 from RegionSelector.RegSelToolConfig
import regSelTool_TGC_Cfg
131 TgcRawDataProvider.RegionSelectionTool = acc.popToolsAndMerge(
regSelTool_TGC_Cfg( flags ) )
134 acc.addEventAlgo(TgcRawDataProvider,primary=
True)
142 from MuonConfig.MuonCablingConfig
import MDTCablingConfigCfg
146 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
150 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
154 MdtROD_Decoder=CompFactory.MdtROD_Decoder
159 keyName = f
"{flags.Overlay.BkgPrefix}MDTCSM" if flags.Overlay.ByteStream
else "MDTCSM"
160 Muon__MDT_RawDataProviderToolMT=CompFactory.Muon.MDT_RawDataProviderToolMT
161 MuonMdtRawDataProviderTool = Muon__MDT_RawDataProviderToolMT(name =
"MDT_RawDataProviderToolMT",
162 Decoder = MDTRodDecoder,
163 RdoLocation = keyName)
165 if flags.Muon.MuonTrigger:
166 MuonMdtRawDataProviderTool.CsmContainerCacheKey = MuonCacheNames.MdtCsmCache
169 Muon__MdtRawDataProvider=CompFactory.Muon.MdtRawDataProvider
170 MdtRawDataProvider = Muon__MdtRawDataProvider(name = name,
171 ProviderTool = MuonMdtRawDataProviderTool, **kwargs )
172 if flags.Muon.MuonTrigger:
174 from RegionSelector.RegSelToolConfig
import regSelTool_MDT_Cfg
175 MdtRawDataProvider.RegionSelectionTool = acc.popToolsAndMerge(
regSelTool_MDT_Cfg( flags ) )
178 acc.addEventAlgo(MdtRawDataProvider,primary=
True)
186 from MuonConfig.MuonCablingConfig
import CSCCablingConfigCfg
190 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
194 Muon__CscROD_Decoder=CompFactory.Muon.CscROD_Decoder
195 CSCRodDecoder = Muon__CscROD_Decoder(name =
"CscROD_Decoder" )
199 keyName = f
"{flags.Overlay.BkgPrefix}CSCRDO" if flags.Overlay.ByteStream
else "CSCRDO"
200 Muon__CSC_RawDataProviderToolMT=CompFactory.Muon.CSC_RawDataProviderToolMT
201 MuonCscRawDataProviderTool = Muon__CSC_RawDataProviderToolMT(name =
"CSC_RawDataProviderToolMT",
202 Decoder = CSCRodDecoder,
203 RdoLocation = keyName)
204 if flags.Muon.MuonTrigger:
205 MuonCscRawDataProviderTool.CscContainerCacheKey = MuonCacheNames.CscCache
208 Muon__CscRawDataProvider=CompFactory.Muon.CscRawDataProvider
209 CscRawDataProvider = Muon__CscRawDataProvider(name = name,
210 ProviderTool = MuonCscRawDataProviderTool, **kwargs )
211 if flags.Muon.MuonTrigger:
213 from RegionSelector.RegSelToolConfig
import regSelTool_CSC_Cfg
214 CscRawDataProvider.RegionSelectionTool = acc.popToolsAndMerge(
regSelTool_CSC_Cfg( flags ) )
217 acc.addEventAlgo(CscRawDataProvider,primary=
True)
225 if False and not flags.Muon.MuonTrigger
and not flags.Input.isMC:
226 from MuonConfig.MuonCondAlgConfig
import NswDcsDbAlgCfg
229 kwargs.setdefault(
"DcsKey",
"")
231 STGCRodDecoder = CompFactory.Muon.STGC_ROD_Decoder(name = name, **kwargs)
232 result.setPrivateTools(STGCRodDecoder)
244 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
250 keyName = f
"{flags.Overlay.BkgPrefix}sTGCRDO" if flags.Overlay.ByteStream
else "sTGCRDO"
251 Muon__STGC_RawDataProviderToolMT=CompFactory.Muon.STGC_RawDataProviderToolMT
252 MuonsTgcRawDataProviderTool = Muon__STGC_RawDataProviderToolMT(name =
"sTgcRawDataProviderTool",
254 RdoLocation = keyName,
255 SkipDecoding=flags.Muon.MuonTrigger
and flags.Muon.runCommissioningChain )
261 Muon__sTgcRawDataProvider=CompFactory.Muon.sTgcRawDataProvider
262 sTgcRawDataProvider = Muon__sTgcRawDataProvider(name = name,
263 ProviderTool = MuonsTgcRawDataProviderTool, **kwargs )
264 if flags.Muon.MuonTrigger:
266 from RegionSelector.RegSelToolConfig
import regSelTool_STGC_Cfg
267 sTgcRawDataProvider.RegionSelectionTool = acc.popToolsAndMerge(
regSelTool_STGC_Cfg( flags ) )
270 acc.addEventAlgo(sTgcRawDataProvider,primary=
True)
276 the_tool = CompFactory.Muon.NSWTP_ROD_Decoder(name = name, **kwargs)
277 result.setPrivateTools(the_tool)
282 kwargs.setdefault(
"RdoLocation", ( flags.Overlay.BkgPrefix
if flags.Common.isOverlay
else "") +
"NSW_TrigProcessor_RDO" )
283 the_tool = CompFactory.Muon.NSWTP_RawDataProviderToolMT(name = name, **kwargs)
284 result.setPrivateTools(the_tool)
289 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
291 the_alg = CompFactory.Muon.sTgcPadTriggerRawDataProvider(name = name,
293 result.addEventAlgo(the_alg, primary =
True)
301 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
305 Muon__PadTrig_ROD_Decoder = CompFactory.Muon.PadTrig_ROD_Decoder
306 STGCPadTriggerRodDecoder = Muon__PadTrig_ROD_Decoder(name =
"sTgcPadTriggerROD_Decoder")
310 keyName = flags.Overlay.BkgPrefix +
"NSW_PadTrigger_RDO" if flags.Common.isOverlay
else "NSW_PadTrigger_RDO"
311 Muon__PadTrig_RawDataProviderToolMT = CompFactory.Muon.PadTrig_RawDataProviderToolMT
312 MuonsTgcPadTriggerRawDataProviderTool = Muon__PadTrig_RawDataProviderToolMT(name =
"sTgcPadTriggerRawDataProviderTool",
313 Decoder = STGCPadTriggerRodDecoder,
314 RdoLocation = keyName)
318 the_alg = CompFactory.Muon.sTgcPadTriggerRawDataProvider(name = name,
319 ProviderTool = MuonsTgcPadTriggerRawDataProviderTool, **kwargs )
321 acc.addEventAlgo(the_alg, primary =
True)
328 if not flags.Muon.MuonTrigger
and not flags.Input.isMC:
329 from MuonConfig.MuonCondAlgConfig
import NswDcsDbAlgCfg
331 from MuonConfig.MuonCablingConfig
import NswCablingCfg
334 kwargs.setdefault(
"CablingMap",
"")
336 kwargs.setdefault(
"DcsKey",
"")
338 the_tool = CompFactory.Muon.MM_ROD_Decoder(name = name, **kwargs)
339 result.setPrivateTools(the_tool)
349 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
353 keyName = f
"{flags.Overlay.BkgPrefix}MMRDO" if flags.Overlay.ByteStream
else "MMRDO"
354 MuonMmRawDataProviderTool = CompFactory.Muon.MM_RawDataProviderToolMT(name =
"MM_RawDataProviderToolMT",
356 RdoLocation = keyName,
357 SkipDecoding=flags.Muon.MuonTrigger
and flags.Muon.runCommissioningChain)
363 Muon__MmRawDataProvider = CompFactory.Muon.MM_RawDataProvider
364 MmRawDataProvider = Muon__MmRawDataProvider(name = name, ProviderTool = MuonMmRawDataProviderTool, **kwargs )
365 if flags.Muon.MuonTrigger:
367 from RegionSelector.RegSelToolConfig
import regSelTool_MM_Cfg
368 MmRawDataProvider.RegionSelectionTool = acc.popToolsAndMerge(
regSelTool_MM_Cfg( flags ) )
370 acc.addEventAlgo(MmRawDataProvider,primary=
True)
376 the_tool = CompFactory.Muon.NSWMMTP_ROD_Decoder(name = name, **kwargs)
377 result.setPrivateTools(the_tool)
383 kwargs.setdefault(
"RdoLocation", ( flags.Overlay.BkgPrefix
if flags.Common.isOverlay
else "") +
"NSW_MMTrigProcessor_RDO" )
384 the_tool = CompFactory.Muon.NSWMMTP_RawDataProviderToolMT(name = name, **kwargs)
385 result.setPrivateTools(the_tool)
391 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
395 the_alg = CompFactory.Muon.sTgcPadTriggerRawDataProvider(name = name, ProviderTool = result.popToolsAndMerge(
NswMMTPRawDataProviderToolCfg(flags)), **kwargs )
396 result.addEventAlgo(the_alg, primary =
True)
404 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
408 if flags.Detector.EnableRPC:
411 if flags.Muon.enableNRPC:
416 if flags.Detector.EnableTGC:
420 if flags.Detector.EnableMDT:
424 if flags.Detector.GeometryCSC:
427 if flags.Detector.GeometryMM:
433 if flags.Detector.GeometrysTGC:
438 if flags.Detector.GeometrysTGC
and flags.Detector.GeometryMM:
444 if __name__==
"__main__":
448 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
449 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
452 flags.Input.Files = defaultTestFiles.RAW_RUN2
453 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN2_DATA
454 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
455 flags.Concurrency.NumThreads = 1
456 flags.Exec.MaxEvents = 5
458 args = flags.fillFromArgs()
461 if not args.config_only:
462 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
468 cfg.printConfig(withDetails=
True)
470 if not args.config_only:
472 sys.exit(
not cfg.run().isSuccess())