From 2aaedce8eca9b0420166b8e2deb8bddbcdbbd244 Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Wed, 23 Nov 2022 20:50:38 +0100
Subject: [PATCH] Another try to fix ATLASRECTS-5407

---
 .../GeoModel/AtlasGeoModel/python/InDetGM.py               | 7 ++++++-
 .../TRT_GeoModel/python/TRT_GeoModelConfig.py              | 7 +++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py
index 05b9bb033e64..e71fe41e31f8 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py
@@ -43,10 +43,15 @@ elif ( DetFlags.detdescr.ID_on() ):
 
         GeoModelSvc.DetectorTools['SCT_DetectorTool'].useDynamicAlignFolders = InDetGeometryFlags.useDynamicAlignFolders()
 
-    if ( DetFlags.detdescr.TRT_on() ):
+    if (DetFlags.detdescr.TRT_on()):
         from TRT_GeoModel.TRT_GeoModelConf import TRT_DetectorTool
         trtDetectorTool = TRT_DetectorTool()
         trtDetectorTool.useDynamicAlignFolders = InDetGeometryFlags.useDynamicAlignFolders()
+        # Use default TRT active gas in geo model unless in simulation.
+        if not DetFlags.simulate.TRT_on():
+            trtDetectorTool.DoXenonArgonMixture = False
+            trtDetectorTool.DoKryptonMixture = False
+
         GeoModelSvc.DetectorTools += [ trtDetectorTool ]
 
     from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatTool
diff --git a/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py b/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py
index c00c15470663..342752d70e59 100644
--- a/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py
+++ b/InnerDetector/InDetDetDescr/TRT_GeoModel/python/TRT_GeoModelConfig.py
@@ -14,6 +14,13 @@ def TRT_GeoModelCfg(flags):
     trtDetectorTool = CompFactory.TRT_DetectorTool()
     trtDetectorTool.GeometryDBSvc = db.getPrimary()
     trtDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
+    # Use default TRT active gas in geo model unless in simulation.
+    from AthenaConfiguration.Enums import Project, ProductionStep
+    if (flags.Common.Project is not Project.AthSimulation
+            and flags.Common.ProductionStep is not ProductionStep.Simulation):
+        trtDetectorTool.DoXenonArgonMixture = False
+        trtDetectorTool.DoKryptonMixture = False
+
     from TRT_ConditionsServices.TRT_ConditionsServicesConfig import TRT_StrawStatusSummaryToolCfg
     acc.popToolsAndMerge(TRT_StrawStatusSummaryToolCfg(flags, forceLegacyAccess=True))  # FIXME: if we set the tool, things break for unknown reasons
     geoModelSvc.DetectorTools += [ trtDetectorTool ]
-- 
GitLab