Verified Commit 86c8b8b9 authored by Tadej Novak's avatar Tadej Novak
Browse files

Make sure beamspot is always decorated in simulation

parent 0cc193fd
Pipeline #4165485 passed with stage
in 0 seconds
......@@ -115,7 +115,7 @@ def EventInfoUpdateFromContextAlgCfg(flags, name="EventInfoUpdateFromContextAlg"
from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
acc.merge(BeamSpotCondAlgCfg(flags))
kwargs.setdefault("SignalInputKey", "HITs_EventInfo")
kwargs.setdefault("SignalInputKey", "Input_EventInfo")
kwargs.setdefault("OutputKey", "EventInfo")
# Do the xAOD::EventInfo overlay
......@@ -124,8 +124,8 @@ def EventInfoUpdateFromContextAlgCfg(flags, name="EventInfoUpdateFromContextAlg"
# Re-map signal address
from SGComps.AddressRemappingConfig import AddressRemappingCfg
acc.merge(AddressRemappingCfg([
"xAOD::EventInfo#EventInfo->" + "HITs_EventInfo",
"xAOD::EventAuxInfo#EventInfoAux.->" + "HITs_EventInfoAux.",
"xAOD::EventInfo#EventInfo->" + "Input_EventInfo",
"xAOD::EventAuxInfo#EventInfoAux.->" + "Input_EventInfoAux.",
]))
return acc
......@@ -151,7 +151,7 @@ def EventInfoUpdateFromContextCfg(flags, **kwargs):
if "EventInfo" not in flags.Input.Collections and "EventInfo" not in flags.Input.SecondaryCollections:
acc.merge(EventInfoCnvAlgCfg(flags,
inputKey="McEventInfo",
outputKey="HITs_EventInfo",
outputKey="Input_EventInfo",
**kwargs))
acc.merge(EventInfoUpdateFromContextAlgCfg(flags, **kwargs))
......
......@@ -20,10 +20,10 @@ def getEventInfoOverlay(name="EventInfoOverlay", **kwargs):
def getEventInfoUpdateFromContextAlg(name="EventInfoUpdateFromContextAlg", **kwargs):
from SGComps import AddressRemappingSvc
AddressRemappingSvc.addInputRename("xAOD::EventInfo","EventInfo","HITs_EventInfo")
AddressRemappingSvc.addInputRename("xAOD::EventAuxInfo","EventInfoAux.","HITs_EventInfoAux.")
AddressRemappingSvc.addInputRename("xAOD::EventInfo","EventInfo","Input_EventInfo")
AddressRemappingSvc.addInputRename("xAOD::EventAuxInfo","EventInfoAux.","Input_EventInfoAux.")
kwargs.setdefault("SignalInputKey", "HITs_EventInfo")
kwargs.setdefault("SignalInputKey", "Input_EventInfo")
kwargs.setdefault("OutputKey", "EventInfo")
return CfgMgr.xAODMaker__EventInfoUpdateFromContextAlg(name, **kwargs)
......@@ -42,7 +42,7 @@ namespace xAODMaker
SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
#endif
SG::ReadHandleKey<xAOD::EventInfo> m_signalInputKey{ this, "SignalInputKey", "HITs_EventInfo", "ReadHandleKey for Signal xAOD::EventInfo" };
SG::ReadHandleKey<xAOD::EventInfo> m_signalInputKey{ this, "SignalInputKey", "Input_EventInfo", "ReadHandleKey for input xAOD::EventInfo" };
SG::WriteHandleKey<xAOD::EventInfo> m_outputKey{ this, "OutputKey", "EventInfo", "WriteHandleKey for Output xAOD::EventInfo" };
};
......
......@@ -72,7 +72,7 @@ def DigitizationMainContentCfg(flags):
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
acc.merge(EventInfoCnvAlgCfg(flags,
inputKey="McEventInfo",
outputKey="HITs_EventInfo"))
outputKey="Input_EventInfo"))
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoUpdateFromContextAlgCfg
acc.merge(EventInfoUpdateFromContextAlgCfg(flags))
......
......@@ -40,7 +40,7 @@ if 'LegacyEventInfo' in digitizationFlags.experimentalDigi() and \
from xAODEventInfoCnv.xAODEventInfoCnvAlgDefault import xAODEventInfoCnvAlgDefault
alg=xAODEventInfoCnvAlgDefault (sequence = job)
if not (DetFlags.pileup.any_on() or digitizationFlags.doXingByXingPileUp()):
alg.xAODKey="HITs_EventInfo"
alg.xAODKey="Input_EventInfo"
#make copy of xAOD::EventInfo and update information in it
if not (DetFlags.pileup.any_on() or digitizationFlags.doXingByXingPileUp()):
......
......@@ -80,6 +80,8 @@ from G4AtlasApps.G4Atlas_Metadata import checkForContainerInInput
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
else:
topSeq += CfgGetter.getAlgorithm("EventInfoUpdateFromContextAlg")
include("G4AtlasApps/G4Atlas.flat.configuration.py")
......
......@@ -66,6 +66,8 @@ from G4AtlasApps.G4Atlas_Metadata import checkForContainerInInput
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
else:
topSeq += CfgGetter.getAlgorithm("EventInfoUpdateFromContextAlg")
include("G4AtlasApps/G4Atlas.flat.configuration.py")
......
......@@ -70,6 +70,8 @@ from G4AtlasApps.G4Atlas_Metadata import checkForContainerInInput
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
else:
topSeq += CfgGetter.getAlgorithm("EventInfoUpdateFromContextAlg")
## Add alg to alg sequence
from AthenaCommon.CfgGetter import getAlgorithm
......
......@@ -144,6 +144,8 @@ if not ISF_Flags.ReSimulation():
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg() ## TODO: update config so that ReSim can use the same xAOD::EventInfo
else:
topSeq += CfgGetter.getAlgorithm("EventInfoUpdateFromContextAlg")
#--------------------------------------------------------------
# ISF kernel configuration
......
......@@ -68,6 +68,9 @@ def CommonSimulationCfg(ConfigFlags, log):
if "xAOD::EventInfo#EventInfo" not in ConfigFlags.Input.TypedCollections:
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
cfg.merge(EventInfoCnvAlgCfg(ConfigFlags))
else:
from xAODEventInfoCnv.EventInfoBeamSpotDecoratorAlgConfig import EventInfoBeamSpotDecoratorAlgCfg
cfg.merge(EventInfoBeamSpotDecoratorAlgCfg(ConfigFlags))
from McEventCollectionFilter.McEventCollectionFilterConfig import TruthResetAlgCfg
cfg.merge(TruthResetAlgCfg(ConfigFlags))
cfg.addSequence(CompFactory.AthSequencer('SimSequence'), parentName='AthAlgSeq')
......@@ -90,6 +93,9 @@ def CommonSimulationCfg(ConfigFlags, log):
if "xAOD::EventInfo#EventInfo" not in ConfigFlags.Input.TypedCollections:
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
cfg.merge(EventInfoCnvAlgCfg(ConfigFlags)) ## TODO: update config so that ReSim can use the same xAOD::EventInfo
else:
from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoUpdateFromContextAlgCfg
cfg.merge(EventInfoUpdateFromContextAlgCfg(ConfigFlags))
AcceptAlgNames=[]
if ConfigFlags.Sim.ISFRun:
......
......@@ -232,6 +232,8 @@ from G4AtlasApps.G4Atlas_Metadata import checkForContainerInInput
if not checkForContainerInInput("xAOD::EventInfo"):
# If xAOD::EventInfo is not present in the input file then it should be created
topSeq += CfgMgr.xAODMaker__EventInfoCnvAlg()
else:
topSeq += CfgGetter.getAlgorithm("EventInfoUpdateFromContextAlg")
include("G4AtlasApps/G4Atlas.flat.configuration.py")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment