From c76e137a5bfe8b4d4124161ae16a2cc9b2479ba3 Mon Sep 17 00:00:00 2001
From: Tulay Cuhadar Donszelmann <tulay.cuhadar.donszelmann@cern.ch>
Date: Thu, 28 Jul 2022 15:44:30 +0200
Subject: [PATCH] Fix OutputKey in CA-based code

---
 .../Overlay/OverlayCopyAlgs/python/OverlayCopyAlgsConfig.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Simulation/Overlay/OverlayCopyAlgs/python/OverlayCopyAlgsConfig.py b/Simulation/Overlay/OverlayCopyAlgs/python/OverlayCopyAlgsConfig.py
index f0cca4777e3c..941cce7341a3 100644
--- a/Simulation/Overlay/OverlayCopyAlgs/python/OverlayCopyAlgsConfig.py
+++ b/Simulation/Overlay/OverlayCopyAlgs/python/OverlayCopyAlgsConfig.py
@@ -170,7 +170,11 @@ def CopyMcEventCollectionCfg(flags, name="CopyMcEventCollection", **kwargs):
         inputs.append(f'McEventCollection#{kwargs["BkgInputKey"]}')
     kwargs.setdefault("SignalInputKey", f"{flags.Overlay.SigPrefix}TruthEvent")
     inputs.append(f'McEventCollection#{kwargs["SignalInputKey"]}')
-    kwargs.setdefault("OutputKey", "TruthEvent")
+
+    if flags.Sim.DoFullChain and flags.Common.isOverlay:
+        kwargs.setdefault("OutputKey", "BeamTruthEvent")
+    else:
+        kwargs.setdefault("OutputKey", "TruthEvent")
 
     from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
     acc.merge(SGInputLoaderCfg(flags, inputs))
-- 
GitLab