9 from AthenaConfiguration.ComponentFactory
import CompFactory
10 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
11 from AthenaConfiguration.Enums
import BeamType
17 if flags.Beam.Type
is BeamType.Cosmics
or flags.Input.isMC:
20 from LumiBlockComps.LuminosityCondAlgConfig
import LuminosityCondAlgCfg
21 result.merge (LuminosityCondAlgCfg (flags))
22 condkey = result.getCondAlgo (
'LuminosityCondAlg').LuminosityOutputKey
24 from AthenaConfiguration.Enums
import ProductionStep
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"
30 kwargs.update({
"actualInteractionsPerCrossingKey" : actualLumiKey,
31 "averageInteractionsPerCrossingKey": averageLumiKey})
33 LumiBlockMuWriter = CompFactory.LumiBlockMuWriter
34 alg = LumiBlockMuWriter (name,
35 LumiDataKey = condkey,
38 if flags.Trigger.doHLT:
39 result.addEventAlgo(alg)
42 result.addCondAlgo(alg)
46 if __name__ ==
"__main__":
47 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
48 from AthenaConfiguration.TestDefaults
import defaultTestFiles
50 print (
'--- collisions')
52 flags1.Input.Files = defaultTestFiles.RAW_RUN2
54 acc1 = LumiBlockMuWriterCfg (flags1)
55 acc1.printCondAlgs (summariseProps=
True)
60 flags2.Input.Files = []
61 flags2.Beam.Type = BeamType.Cosmics
63 acc2 = LumiBlockMuWriterCfg (flags2)
64 acc2.printCondAlgs (summariseProps=
True)