14def LumiBlockMuWriterCfg (flags, name = 'LumiBlockMuWriter', seqName="AthAlgSeq"):
15 result = ComponentAccumulator(seqName)
16
17 if flags.Beam.Type is BeamType.Cosmics or flags.Input.isMC:
18 condkey = ''
19 else:
20 from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
21 result.merge (LuminosityCondAlgCfg (flags))
22 condkey = result.getCondAlgo ('LuminosityCondAlg').LuminosityOutputKey
23
24 from AthenaConfiguration.Enums import ProductionStep
25 kwargs={}
26 if flags.Common.ProductionStep in [ProductionStep.PileUpPretracking, ProductionStep.MinbiasPreprocessing]:
27 actualLumiKey=f"{flags.Overlay.BkgPrefix}EventInfo.actualInteractionsPerCrossing"
28 averageLumiKey=f"{flags.Overlay.BkgPrefix}EventInfo.averageInteractionsPerCrossing"
29
30 kwargs.update({"actualInteractionsPerCrossingKey" : actualLumiKey,
31 "averageInteractionsPerCrossingKey": averageLumiKey})
32
33 LumiBlockMuWriter = CompFactory.LumiBlockMuWriter
34 alg = LumiBlockMuWriter (name,
35 LumiDataKey = condkey,
36 **kwargs)
37
38 if flags.Trigger.doHLT:
39 result.addEventAlgo(alg)
40
41 else:
42 result.addCondAlgo(alg)
43 return result
44
45