3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaConfiguration.Enums
import Format
6 from IOVDbSvc.IOVDbSvcConfig
import addFolders
12 if flags.Input.Format
is Format.POOL:
13 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
14 acc.merge(
SGInputLoaderCfg(flags, [
"TileRawChannelContainer/MuRcvRawChCnt"]))
16 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamReadCfg
19 from TileConditions.TileInfoLoaderConfig
import TileInfoLoaderCfg
22 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
25 from TileConditions.TileEMScaleConfig
import TileEMScaleCondAlgCfg
28 tmdbAlg = CompFactory.TileMuonReceiverDecision(
'TileMuonReceiverDecision'
29 , TileRawChannelContainer =
"MuRcvRawChCnt"
30 , TileMuonReceiverContainer =
"rerunTileMuRcvCnt"
33 , MuonReceiverEneThreshCellD6Low = 500
34 , MuonReceiverEneThreshCellD6andD5Low = 500
35 , MuonReceiverEneThreshCellD6High = 600
36 , MuonReceiverEneThreshCellD6andD5High = 600
38 , MuonReceiverEneThreshCellD5 = 500
39 , MuonReceiverEneThreshCellD6 = 500
40 , MuonReceiverEneThreshCellD5andD6 = 500)
41 acc.addEventAlgo(tmdbAlg)
49 postFix =
"_L1MuonSim"
50 from MuonConfig.MuonBytestreamDecodeConfig
import MuonCacheNames
51 cacheCreator = CompFactory.MuonCacheCreator(RpcCacheKey = MuonCacheNames.RpcCache,
52 TgcCacheKey = MuonCacheNames.TgcCache,
53 MdtCsmCacheKey = MuonCacheNames.MdtCsmCache,
54 CscCacheKey = (MuonCacheNames.CscCache
if flags.Detector.GeometryCSC
else ""))
55 acc.addEventAlgo(cacheCreator)
57 RPCRodDecoder = CompFactory.Muon.RpcROD_Decoder(name =
"RpcROD_Decoder" + postFix, NOBXS=flags.Trigger.L1MuonSim.RPCNBX)
58 MuonRpcRawDataProviderTool = CompFactory.Muon.RPC_RawDataProviderToolMT(name =
"RPC_RawDataProviderToolMT" + postFix,
59 RpcContainerCacheKey = MuonCacheNames.RpcCache,
60 WriteOutRpcSectorLogic =
False,
61 Decoder = RPCRodDecoder,
62 RdoLocation =
"RPCPAD_L1" )
63 RpcRawDataProvider = CompFactory.Muon.RpcRawDataProvider(name =
"RpcRawDataProvider" + postFix,
64 ProviderTool = MuonRpcRawDataProviderTool)
65 acc.addEventAlgo(RpcRawDataProvider)
67 TGCRodDecoder = CompFactory.Muon.TGC_RodDecoderReadout(name =
"TGC_RodDecoderReadout" + postFix)
68 MuonTgcRawDataProviderTool = CompFactory.Muon.TGC_RawDataProviderToolMT(name =
"TGC_RawDataProviderToolMT" + postFix,
69 TgcContainerCacheKey = MuonCacheNames.TgcCache,
70 Decoder = TGCRodDecoder,
71 RdoLocation =
"TGCRDO_L1")
72 TgcRawDataProvider = CompFactory.Muon.TgcRawDataProvider(name =
"TgcRawDataProvider" + postFix,
73 ProviderTool = MuonTgcRawDataProviderTool)
74 acc.addEventAlgo(TgcRawDataProvider)
76 if flags.Detector.GeometrysTGC:
77 Muon__STGC_RawDataProviderToolMT=CompFactory.Muon.STGC_RawDataProviderToolMT
78 from MuonConfig.MuonBytestreamDecodeConfig
import sTgcRODDecoderCfg
79 MuonsTgcRawDataProviderTool = Muon__STGC_RawDataProviderToolMT(name =
"STGC_RawDataProviderToolMT"+postFix,
81 name =
"sTgcROD_Decoder"+postFix)),
82 RdoLocation =
"sTGCRDO_L1")
83 Muon__sTgcRawDataProvider=CompFactory.Muon.sTgcRawDataProvider
84 sTgcRawDataProvider = Muon__sTgcRawDataProvider(name =
"sTgcRawDataProvider"+postFix,
85 ProviderTool = MuonsTgcRawDataProviderTool )
86 acc.addEventAlgo(sTgcRawDataProvider)
89 if flags.Detector.GeometryMM:
90 from MuonConfig.MuonBytestreamDecodeConfig
import MmRDODDecoderCfg
91 Muon_MM_RawDataProviderToolMT = CompFactory.Muon.MM_RawDataProviderToolMT
92 MuonMmRawDataProviderTool = Muon_MM_RawDataProviderToolMT(name =
"MM_RawDataProviderToolMT"+postFix,
94 name=
"MM_RODDecoder"+postFix)),
95 RdoLocation =
"MMRDO_L1")
96 Muon__MmRawDataProvider = CompFactory.Muon.MM_RawDataProvider
97 MmRawDataProvider = Muon__MmRawDataProvider(name =
"MmRawDataProvider"+postFix, ProviderTool = MuonMmRawDataProviderTool )
98 acc.addEventAlgo(MmRawDataProvider)
100 if flags.Trigger.L1MuonSim.EmulateNSW
and flags.Trigger.L1MuonSim.NSWVetoMode:
102 MDTRodDecoder = CompFactory.MdtROD_Decoder(name =
"MdtROD_Decoder" + postFix)
103 MuonMdtRawDataProviderTool = CompFactory.Muon.MDT_RawDataProviderToolMT(name =
"MDT_RawDataProviderToolMT" + postFix,
104 CsmContainerCacheKey = MuonCacheNames.MdtCsmCache,
105 Decoder = MDTRodDecoder,
106 RdoLocation =
"MDTCSM_L1")
107 MdtRawDataProvider = CompFactory.Muon.MdtRawDataProvider(name =
"MdtRawDataProvider" + postFix,
108 ProviderTool = MuonMdtRawDataProviderTool)
109 acc.addEventAlgo(MdtRawDataProvider)
111 if flags.Detector.GeometryCSC:
112 CSCRodDecoder = CompFactory.Muon.CscROD_Decoder(name =
"CscROD_Decoder" + postFix,
114 IsOldCosmics =
False )
115 MuonCscRawDataProviderTool = CompFactory.Muon.CSC_RawDataProviderToolMT(name =
"CSC_RawDataProviderToolMT" + postFix,
116 CscContainerCacheKey = MuonCacheNames.CscCache,
117 Decoder = CSCRodDecoder,
118 RdoLocation =
"CSCRDO_L1" )
119 CscRawDataProvider = CompFactory.Muon.CscRawDataProvider(name =
"CscRawDataProvider" + postFix,
120 ProviderTool = MuonCscRawDataProviderTool)
121 acc.addEventAlgo(CscRawDataProvider)
127 if not flags.Trigger.L1MuonSim.EmulateNSW
or not flags.Trigger.L1MuonSim.NSWVetoMode:
129 postFix =
"_L1MuonSim"
130 suffix =
"" if flags.Input.isMC
else "_L1"
131 if flags.Input.Format
is Format.POOL:
133 (
'RpcPadContainer',
'RPCPAD'),
134 (
'TgcRdoContainer',
'TGCRDO'),
135 (
'CscRawDataContainer',
'CSCRDO'),
136 (
'MdtCsmContainer',
'MDTCSM')
138 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
141 if flags.Detector.GeometryCSC:
142 from MuonConfig.MuonRdoDecodeConfig
import CscRDODecodeCfg
143 acc.merge(
CscRDODecodeCfg(flags,name=
"CscRdoToCscPrepData" + postFix, RDOContainer =
"CSCRDO"+suffix))
144 CscClusterBuilderTool = CompFactory.CscThresholdClusterBuilderTool(name =
"CscThresholdClusterBuilderTool" + postFix)
145 CscClusterBuilder = CompFactory.CscThresholdClusterBuilder(name =
"CscThresholdClusterBuilder"+postFix,
146 cluster_builder = CscClusterBuilderTool)
147 acc.addEventAlgo(CscClusterBuilder)
149 from MuonConfig.MuonRdoDecodeConfig
import MdtRDODecodeCfg
150 acc.merge(
MdtRDODecodeCfg(flags, name =
"MdtRdoToMdtPrepData" + postFix,
151 RDOContainer =
"MDTCSM"+suffix ))
153 from MuonConfig.MuonRdoDecodeConfig
import RpcRDODecodeCfg
154 acc.merge(
RpcRDODecodeCfg(flags, name =
"RpcRdoToRpcPrepData" + postFix,
155 RDOContainer =
"RPCPAD"+suffix))
157 from MuonConfig.MuonRdoDecodeConfig
import TgcRDODecodeCfg
159 RDOContainer =
"TGCRDO"+suffix))
164 if not flags.Trigger.L1MuonSim.EmulateNSW
or not flags.Trigger.L1MuonSim.NSWVetoMode:
166 postFix =
"_L1MuonSim"
167 theMuonLayerHough = CompFactory.MuonLayerHoughAlg(
"MuonLayerHoughAlg" + postFix,
168 TgcPrepDataContainer =
"TGC_Measurements",
169 RpcPrepDataContainer =
"RPC_Measurements",
170 CscPrepDataContainer = (
"CSC_Clusters" if flags.Detector.GeometryCSC
else ""),
171 MdtPrepDataContainer =
"MDT_DriftCircles",
172 sTgcPrepDataContainer = (
"STGC_Measurements" if flags.Detector.GeometrysTGC
else ""),
173 MMPrepDataContainer = (
"MM_Measurements" if flags.Detector.GeometryMM
else "") )
174 acc.addEventAlgo(theMuonLayerHough)
175 theSegmentFinderAlg = CompFactory.MuonSegmentFinderAlg(
"MuonSegmentFinderAlg" + postFix)
176 if not flags.Detector.GeometryCSC:
177 theSegmentFinderAlg.CSC_clusterkey =
""
178 theSegmentFinderAlg.Csc2dSegmentMaker =
""
179 theSegmentFinderAlg.Csc4dSegmentMaker =
""
180 acc.addEventAlgo(theSegmentFinderAlg)
181 xAODMuonSegmentCnv = CompFactory.xAODMaker.MuonSegmentCnvAlg(
"MuonSegmentCnvAlg" + postFix)
182 acc.addEventAlgo(xAODMuonSegmentCnv)
189 kwargs.setdefault(
"DecodeSTGC_RDO", flags.Detector.GeometrysTGC)
190 kwargs.setdefault(
"DecodeMM_RDO", flags.Detector.GeometryMM)
191 kwargs.setdefault(
"DecodeNrpcRDO", flags.Muon.enableNRPC)
192 from MuonConfig.MuonByteStreamCnvTestConfig
import STgcRdoDecoderCfg, MMRdoDecoderCfg, MdtRdoDecoderCfg
193 kwargs.setdefault(
"stgcRdoDecoderTool", result.popToolsAndMerge(
STgcRdoDecoderCfg(flags))
194 if flags.Detector.GeometrysTGC
else "" )
195 kwargs.setdefault(
"mmRdoDecoderTool", result.popToolsAndMerge(
MMRdoDecoderCfg(flags))
196 if flags.Detector.GeometryMM
else "" )
197 kwargs.setdefault(
"mdtRdoDecoderTool", result.popToolsAndMerge(
MdtRdoDecoderCfg(flags)))
199 rpcrdo_decode = CompFactory.Muon.RpcRDO_Decoder(
"RpcRDO_Decoder", BCZERO=flags.Trigger.L1MuonSim.RPCNBCZ)
200 kwargs.setdefault(
"rpcRdoDecoderTool", rpcrdo_decode)
202 the_tool = CompFactory.MuonRdoToMuonDigitTool (name, **kwargs)
203 result.setPrivateTools(the_tool)
209 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
212 suffix =
"" if flags.Input.Format
is Format.POOL
else "_L1"
213 RPCRdoName =
"RPCPAD"+suffix
214 TGCRdoName =
"TGCRDO"+suffix
215 MMRdoName =
"MMRDO"+suffix
216 sTGCRdoName =
"sTGCRDO"+suffix
218 if flags.Input.Format
is Format.POOL:
220 (
'RpcPadContainer',
'RPCPAD'),
221 (
'TgcRdoContainer',
'TGCRDO')
224 if flags.Detector.GeometrysTGC
or flags.Detector.GeometryMM:
226 (
'Muon::MM_RawDataContainer',
'MMRDO'),
227 (
'Muon::STGC_RawDataContainer',
'sTGCRDO')
229 if flags.Muon.enableNRPC:
231 (
'xAOD::NRPCRDOContainer' ,
'NRPCRDO'),
232 (
'xAOD::NRPCRDOAuxContainer',
'NRPCRDOAux.')
234 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
237 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
240 from MuonConfig.MuonByteStreamCnvTestConfig
import RpcRdoToRpcDigitCfg, TgcRdoToTgcDigitCfg, STGC_RdoToDigitCfg, MM_RdoToDigitCfg
242 acc.merge(
RpcRdoToRpcDigitCfg(flags, RpcDigitContainer =
"RPC_DIGITS_L1", RpcRdoContainer = RPCRdoName ))
243 acc.merge(
TgcRdoToTgcDigitCfg(flags, TgcDigitContainer =
"TGC_DIGITS_L1", TgcRdoContainer = TGCRdoName ))
244 if flags.Detector.GeometrysTGC:
245 acc.merge(
STGC_RdoToDigitCfg(flags, sTgcRdoContainer = sTGCRdoName, sTgcDigitContainer =
"sTGC_DIGITS_L1"))
246 if flags.Detector.GeometryMM:
247 acc.merge(
MM_RdoToDigitCfg(flags, MmRdoContainer = MMRdoName, MmDigitContainer =
"MM_DIGITS_L1" ))
253 if not flags.Detector.GeometrysTGC
and not flags.Detector.GeometryMM:
256 if flags.Input.Format
is Format.POOL
and flags.Input.isMC:
258 (
'McEventCollection',
'TruthEvent'),
259 (
'TrackRecordCollection',
'MuonEntryLayer'),
260 (
'MuonSimDataCollection',
'sTGC_SDO')
262 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
265 PadTdsTool = CompFactory.NSWL1.PadTdsOfflineTool(
"NSWL1__PadTdsOfflineTool",DoNtuple=flags.Trigger.L1MuonSim.WritesTGCBranches, IsMC = flags.Input.isMC, sTGC_DigitContainerName=
"sTGC_DIGITS_L1")
266 PadTriggerLogicTool = CompFactory.NSWL1.PadTriggerLogicOfflineTool(
"NSWL1__PadTriggerLogicOfflineTool",DoNtuple=flags.Trigger.L1MuonSim.WritesTGCBranches)
267 PadTriggerLookupTool = CompFactory.NSWL1.PadTriggerLookupTool(
"NSWL1__PadTriggerLookupTool")
268 StripTdsTool = CompFactory.NSWL1.StripTdsOfflineTool(
"NSWL1__StripTdsOfflineTool",DoNtuple=flags.Trigger.L1MuonSim.WritesTGCBranches,IsMC=flags.Input.isMC,sTGC_DigitContainerName=
"sTGC_DIGITS_L1")
269 StripClusterTool = CompFactory.NSWL1.StripClusterTool(
"NSWL1__StripClusterTool",DoNtuple=flags.Trigger.L1MuonSim.WritesTGCBranches,IsMC=flags.Input.isMC)
270 StripSegmentTool = CompFactory.NSWL1.StripSegmentTool(
"NSWL1__StripSegmentTool",DoNtuple=flags.Trigger.L1MuonSim.WritesTGCBranches)
271 MMTriggerTool = CompFactory.NSWL1.MMTriggerTool(
"NSWL1__MMTriggerTool",DoNtuple=flags.Trigger.L1MuonSim.WriteMMBranches, IsMC = flags.Input.isMC, MmDigitContainer=
"MM_DIGITS_L1")
272 TriggerProcessorTool = CompFactory.NSWL1.TriggerProcessorTool(
"NSWL1__TriggerProcessorTool")
274 dosTGC = flags.Trigger.L1MuonSim.doPadTrigger
or flags.Trigger.L1MuonSim.doStripTrigger
276 from RegionSelector.RegSelToolConfig
import regSelTool_STGC_Cfg
279 nswAlg = CompFactory.NSWL1.NSWL1Simulation(
"NSWL1Simulation",
281 DoNtuple = flags.Trigger.L1MuonSim.WriteNSWDebugNtuple,
282 DoMM = flags.Trigger.L1MuonSim.doMMTrigger,
283 DoMMDiamonds = flags.Trigger.L1MuonSim.doMMTrigger,
285 DoPad = flags.Trigger.L1MuonSim.doPadTrigger,
286 DoStrip = flags.Trigger.L1MuonSim.doStripTrigger,
287 PadTdsTool = PadTdsTool,
288 PadTriggerTool = PadTriggerLogicTool,
289 PadTriggerLookupTool = PadTriggerLookupTool,
290 StripTdsTool = StripTdsTool,
291 StripClusterTool = StripClusterTool,
292 StripSegmentTool = StripSegmentTool,
293 MMTriggerTool = MMTriggerTool,
294 MMTriggerProcessorTool = TriggerProcessorTool,
295 NSWTrigRDOContainerName =
"L1_NSWTrigContainer" )
296 acc.addEventAlgo(nswAlg)
301 rpcAlg = CompFactory.TrigT1RPC(
"TrigT1RPC",
304 RPCbytestream =
False,
305 RPCbytestreamFile =
"",
306 RPCDigitContainer =
"RPC_DIGITS_L1",
307 useRun3Config =
True,
308 NOBXS=flags.Trigger.L1MuonSim.RPCNBX,
309 BCZERO=flags.Trigger.L1MuonSim.RPCNBCZ)
310 acc.addEventAlgo(rpcAlg)
311 from MuonConfig.MuonCablingConfig
import RPCCablingConfigCfg
317 tgcAlg = CompFactory.LVL1TGCTrigger.LVL1TGCTrigger(
"LVL1TGCTrigger",
318 InputData_perEvent =
"TGC_DIGITS_L1",
319 InputRDO =
"TGCRDO" if flags.Input.isMC
else "TGCRDO_L1",
320 useRun3Config =
True,
321 TileMuRcv_Input =
"rerunTileMuRcvCnt",
323 if (flags.Detector.GeometrysTGC
or flags.Detector.GeometryMM):
324 tgcAlg.MaskFileName12 =
"TrigT1TGCMaskedChannel.noFI._12.db"
326 tgcAlg.NSWSideInfo =
"AC"
327 tgcAlg.NSWTrigger_Input =
"L1_NSWTrigContainer"
328 tgcAlg.FORCENSWCOIN =
not flags.Trigger.L1MuonSim.NSWVetoMode
329 tgcAlg.USEBIS78 = flags.Trigger.L1MuonSim.doBIS78
331 tgcAlg.MaskFileName12 =
"TrigT1TGCMaskedChannel._12.db"
333 if flags.Trigger.L1MuonSim.EmulateNSW:
334 tgcAlg.MuctpiPhase1LocationTGC =
"L1MuctpiStoreTGCint"
336 if flags.Input.Format
is Format.BS:
337 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamReadCfg
338 readBSConfig =
ByteStreamReadCfg(flags, [
'ByteStreamMetadataContainer/ByteStreamMetadata'])
339 acc.merge(readBSConfig)
341 tgcAlg.ByteStreamMetadataRHKey =
''
342 acc.addEventAlgo(tgcAlg)
344 from PathResolver
import PathResolver
346 acc.merge(
addFolders(flags,
'<db>sqlite://;schema={0};dbname=OFLP200</db> /TGC/TRIGGER/CW_BW_RUN3'.
format(bwCW_Run3_filePath),
347 tag=
'TgcTriggerCwBwRun3-01',
348 className=
'CondAttrListCollection'))
349 acc.addCondAlgo(CompFactory.TGCTriggerCondAlg())
350 from MuonConfig.MuonCablingConfig
import TGCCablingConfigCfg
356 if not flags.Trigger.L1MuonSim.EmulateNSW:
358 recTool = CompFactory.LVL1.TrigT1TGCRecRoiTool(
"TrigT1TGCRecRoiToolLegacy")
359 recTool.UseRun3Config=
False
360 tgcModifier = CompFactory.LVL1TGCTrigger.TGCOutputModifier(
"TGCOutputModifier",
361 TrigT1TGCRecRoiTool=recTool,
362 InputMuctpiLocation =
"L1MuctpiStoreTGCint",
363 OutputMuctpiLocation =
"L1MuctpiStoreTGC",
366 NSWVetoMode = flags.Trigger.L1MuonSim.NSWVetoMode )
367 acc.addEventAlgo(tgcModifier)
372 rpcRecRoiTool = CompFactory.LVL1.TrigT1RPCRecRoiTool(
"TrigT1RPCRecRoiTool", UseRun3Config=
True)
373 tgcRecRoiTool = CompFactory.LVL1.TrigT1TGCRecRoiTool(
"TrigT1TGCRecRoiTool", UseRun3Config=
True)
374 trigThresholdDecTool = CompFactory.LVL1.TrigThresholdDecisionTool(name=
"TrigThresholdDecisionTool",
375 RPCRecRoiTool = rpcRecRoiTool,
376 TGCRecRoiTool = tgcRecRoiTool)
377 muctpiTool = CompFactory.LVL1MUCTPIPHASE1.MUCTPI_AthTool(name=
"MUCTPI_AthTool",
378 MuCTPICTPLocation =
'L1MuCTPItoCTPLocation',
379 OverlapStrategyName = flags.Trigger.MUCTPI.OverlapStrategy,
380 LUTXMLFile = flags.Trigger.MUCTPI.LUTXMLFile,
381 BarrelRoIFile = flags.Trigger.MUCTPI.BarrelRoIFile,
382 EndcapForwardRoIFile = flags.Trigger.MUCTPI.EndcapForwardRoIFile,
383 Side0LUTFile = flags.Trigger.MUCTPI.Side0LUTFile,
384 Side1LUTFile = flags.Trigger.MUCTPI.Side1LUTFile,
385 InputSource =
'DIGITIZATION',
386 RPCRecRoiTool = rpcRecRoiTool,
387 TGCRecRoiTool = tgcRecRoiTool,
388 TrigThresholdDecisionTool = trigThresholdDecTool)
389 muctpiAlg = CompFactory.LVL1MUCTPIPHASE1.MUCTPI_AthAlg(name=
"MUCTPI_AthAlg",
390 MUCTPI_AthTool = muctpiTool)
391 acc.addEventAlgo(muctpiAlg)
392 from TrigConfigSvc.TrigConfigSvcCfg
import L1ConfigSvcCfg
413 if __name__ ==
"__main__":
415 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
417 flags.Input.Files = [
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.601229.PhPy8EG_A14_ttbar_hdamp258p75_SingleLep.recon.RDO.e8514_e8528_s4159_s4114_r14799_tid34171421_00/RDO.34171421._000011.pool.root.1']
418 flags.Exec.MaxEvents = 5
419 flags.Concurrency.NumThreads = 1
420 flags.Trigger.triggerMenuSetup =
'Dev_pp_run3_v1'
424 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
427 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
430 from TrigConfigSvc.TrigConfigSvcCfg
import generateL1Menu
435 acc.printConfig(withDetails=
True, summariseProps=
True, printDefaults=
True)
436 sys.exit(acc.run().isFailure())