From 56a72862449a8d4551eae6528069a7ec4d401bcb Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Sat, 30 Jan 2021 11:31:12 +0100
Subject: [PATCH] Properly name thinned MC LAr digits

---
 LArCalorimeter/LArROD/python/LArDigitThinnerConfig.py | 5 ++++-
 LArCalorimeter/LArROD/python/LArDigits.py             | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/LArCalorimeter/LArROD/python/LArDigitThinnerConfig.py b/LArCalorimeter/LArROD/python/LArDigitThinnerConfig.py
index 7bd2641aa24a..c94d76ca6e16 100644
--- a/LArCalorimeter/LArROD/python/LArDigitThinnerConfig.py
+++ b/LArCalorimeter/LArROD/python/LArDigitThinnerConfig.py
@@ -1,6 +1,6 @@
 """Configuration for the LAr Digit Thinner algorithm
 
-Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 """
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaConfiguration.ComponentFactory import CompFactory
@@ -29,5 +29,8 @@ def LArDigitThinnerCfg(flags, **kwargs):
         kwargs.setdefault("EnergyCut_HEC", 5000)
         kwargs.setdefault("EnergyCut_FCAL", 20000)
 
+    if flags.Input.isMC:
+        kwargs.setdefault("OutputContainerName", "LArDigitContainer_MC_Thinned")
+
     acc.addEventAlgo(CompFactory.LArDigitThinner(**kwargs))
     return acc
diff --git a/LArCalorimeter/LArROD/python/LArDigits.py b/LArCalorimeter/LArROD/python/LArDigits.py
index 59a39d212db1..b899c51b2a6e 100644
--- a/LArCalorimeter/LArROD/python/LArDigits.py
+++ b/LArCalorimeter/LArROD/python/LArDigits.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from LArROD.LArRODConf import LArDigitThinner
 from LArCabling.LArCablingAccess import LArOnOffIdMapping 
@@ -28,6 +28,8 @@ class DefaultLArDigitThinner (LArDigitThinner) :
                 if LArRawDataReadingAlg() not in topSequence:
                      topSequence+=LArRawDataReadingAlg()
                 self.InputContainerName="FREE"
+        elif globalflags.DataSource()=='geant4':
+           self.OutputContainerName="LArDigitContainer_MC_Thinned"
 
         LArOnOffIdMapping()
 
-- 
GitLab