8from AthenaConfiguration.Enums
import LHCPeriod, ProductionStep
12 inputKey="McEventInfo",
13 outputKey="EventInfo",
14 disableBeamSpot=False,
16 """Return a ComponentAccumulator for EventInfoCnvAlg algorithm"""
18 acc = ComponentAccumulator()
20 kwargs.setdefault(
"AODKey", inputKey)
21 kwargs.setdefault(
"xAODKey", outputKey)
23 if f
"PileUpEventInfo#{inputKey}" in flags.Input.TypedCollections:
24 kwargs.setdefault(
"PileupKey", f
"Pileup{outputKey}")
26 kwargs.setdefault(
"PileupKey",
"")
30 if not disableBeamSpot:
31 from BeamSpotConditions.BeamSpotConditionsConfig
import BeamSpotCondAlgCfg
32 acc.merge(BeamSpotCondAlgCfg(flags))
34 acc.addEventAlgo(CompFactory.xAODMaker.EventInfoCnvAlg(name, **kwargs))
40 """Return a ComponentAccumulator for EventInfoOverlay algorithm"""
41 acc = ComponentAccumulator()
44 from BeamSpotConditions.BeamSpotConditionsConfig
import BeamSpotCondAlgCfg
45 acc.merge(BeamSpotCondAlgCfg(flags))
47 kwargs.setdefault(
"BkgInputKey", f
"{flags.Overlay.BkgPrefix}EventInfo")
48 kwargs.setdefault(
"SignalInputKey", f
"{flags.Overlay.SigPrefix}EventInfo")
49 kwargs.setdefault(
"OutputKey",
"EventInfo")
51 kwargs.setdefault(
"DataOverlay", flags.Overlay.DataOverlay)
52 kwargs.setdefault(
"ValidateBeamSpot",
not (flags.Common.ProductionStep == ProductionStep.FastChain
and flags.Common.isOverlay)
and not flags.Overlay.DataOverlay
and flags.GeoModel.Run
is LHCPeriod.Run3)
54 if flags.Input.MCChannelNumber > 0:
55 kwargs.setdefault(
"MCChannelNumber", flags.Input.MCChannelNumber)
58 acc.addEventAlgo(CompFactory.xAODMaker.EventInfoOverlay(name, **kwargs))
61 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
62 if flags.Output.doWriteRDO:
63 acc.merge(OutputStreamCfg(flags,
"RDO"))
66 if flags.Output.doWriteRDO_SGNL:
67 acc.merge(OutputStreamCfg(flags,
"RDO_SGNL", ItemList=[
68 f
"xAOD::EventInfo#{flags.Overlay.SigPrefix}EventInfo",
69 f
"xAOD::EventAuxInfo#{flags.Overlay.SigPrefix}EventInfoAux."
110def EventInfoUpdateFromContextAlgCfg(flags, name="EventInfoUpdateFromContextAlg", **kwargs):
111 """Return a ComponentAccumulator for EventInfoUpdateFromContext algorithm"""
112 acc = ComponentAccumulator()
114 # Add beam spot conditions
115 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
116 acc.merge(BeamSpotCondAlgCfg(flags))
118 kwargs.setdefault("SignalInputKey", "Input_EventInfo")
119 kwargs.setdefault("OutputKey", f"{flags.Overlay.SigPrefix}EventInfo" if flags.Common.ProductionStep == ProductionStep.FastChain and flags.Common.isOverlay else "EventInfo")
121 if flags.Input.MCChannelNumber > 0:
122 kwargs.setdefault("MCChannelNumber", flags.Input.MCChannelNumber)
124 # Do the xAOD::EventInfo overlay
125 acc.addEventAlgo(CompFactory.xAODMaker.EventInfoUpdateFromContextAlg(name, **kwargs))
127 # Re-map signal address
128 from SGComps.AddressRemappingConfig import AddressRemappingCfg
129 acc.merge(AddressRemappingCfg([
130 "xAOD::EventInfo#EventInfo->" + "Input_EventInfo",
131 "xAOD::EventAuxInfo#EventInfoAux.->" + "Input_EventInfoAux.",
137def EventInfoBeamSpotDecoratorAlgCfg(flags, name="EventInfoBeamSpotDecoratorAlg", eventInfoKey="EventInfo", **kwargs):
138 result = ComponentAccumulator()
140 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
141 result.merge(BeamSpotCondAlgCfg(flags))
143 kwargs.setdefault("EventInfoKey", eventInfoKey)
145 result.addEventAlgo(CompFactory.xAODMaker.EventInfoBeamSpotDecoratorAlg(name, **kwargs))