From 693ce2ff65e66e9540d98d317a5144a832c7d44b Mon Sep 17 00:00:00 2001
From: John Derek Chapman <chapman@hep.phy.cam.ac.uk>
Date: Mon, 7 Mar 2016 15:18:59 +0100
Subject: [PATCH] python/InDetGM.py: Autosetup to run Argon/Krypton simulation
 for the TRT. Requires TRT_GeoModel-00-02-67 or later. ATLASRECTS-2725.
 AtlasGeoModel-00-03-42 (AtlasGeoModel-00-03-42)

	* python/InDetGM.py: Autosetup to run Argon/Krypton simulation for
	the TRT. Requires TRT_GeoModel-00-02-67 or later. ATLASRECTS-2725
	* AtlasGeoModel-00-03-42

2016-03-07  John Chapman  <John.Chapman@cern.ch>
	* python/GeoModelInit.py - fix try/except block for
	AthSimulationBase.
	* AtlasGeoModel-00-03-41
---
 .../AtlasGeoModel/python/GeoModelInit.py      |   3 +-
 .../GeoModel/AtlasGeoModel/python/InDetGM.py  | 122 +++++++++---------
 2 files changed, 65 insertions(+), 60 deletions(-)

diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInit.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInit.py
index 621b50d67fa..0c2619d703f 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInit.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/GeoModelInit.py
@@ -13,7 +13,8 @@ def _setupGeoModel():
             import DetDescrCnvSvc.DetStoreConfig
             svcMgr.DetDescrCnvSvc.IdDictFromRDB = True
     except ImportError:
-        pass
+        import DetDescrCnvSvc.DetStoreConfig
+        svcMgr.DetDescrCnvSvc.IdDictFromRDB = True
 
     # Conditions DB setup and TagInfo
     from IOVDbSvc.CondDB import conddb
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py
index a98896502fb..968c9595ca7 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py
@@ -1,55 +1,55 @@
 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 
-#
-# InDet GeoModel initialization
-#
-from AthenaCommon.GlobalFlags import globalflags
-from AthenaCommon.JobProperties import jobproperties
-from AthenaCommon.DetFlags      import DetFlags
-from AthenaCommon.AppMgr        import ServiceMgr as svcMgr
-
-from AtlasGeoModel.InDetGMJobProperties import GeometryFlags 
+#
+# InDet GeoModel initialization
+#
+from AthenaCommon.GlobalFlags import globalflags
+from AthenaCommon.JobProperties import jobproperties
+from AthenaCommon.DetFlags      import DetFlags
+from AthenaCommon.AppMgr        import ServiceMgr as svcMgr
+
+from AtlasGeoModel.InDetGMJobProperties import GeometryFlags
 if GeometryFlags.isSLHC():
-    #SLHC specific code 
+    #SLHC specific code
     from AthenaCommon.AppMgr import ToolSvc
-
-# Treat CTB separately
-if ( jobproperties.Global.DetGeo() == "ctbh8" or jobproperties.Global.DetGeo() == "ctbh6" ):
-    from AtlasGeoModel import InDetGMCTB
-
-elif ( DetFlags.detdescr.ID_on() ):
-    from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
-    GeoModelSvc = GeoModelSvc()	
-
-    if not hasattr(svcMgr,'InDetGeometryDBSvc'):
-        from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc
-        svcMgr+=GeometryDBSvc("InDetGeometryDBSvc")
+
+# Treat CTB separately
+if ( jobproperties.Global.DetGeo() == "ctbh8" or jobproperties.Global.DetGeo() == "ctbh6" ):
+    from AtlasGeoModel import InDetGMCTB
+
+elif ( DetFlags.detdescr.ID_on() ):
+    from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
+    GeoModelSvc = GeoModelSvc()
+
+    if not hasattr(svcMgr,'InDetGeometryDBSvc'):
+        from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc
+        svcMgr+=GeometryDBSvc("InDetGeometryDBSvc")
         if GeometryFlags.isSLHC():
-            #SLHC specific code 
-            # General service builder tool for SLHC
-            from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatBuilderToolSLHC
-            InDetServMatBuilderToolSLHC = InDetServMatBuilderToolSLHC()
-            ToolSvc+=InDetServMatBuilderToolSLHC
-    
-    if ( DetFlags.detdescr.pixel_on() ):
+            #SLHC specific code
+            # General service builder tool for SLHC
+            from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatBuilderToolSLHC
+            InDetServMatBuilderToolSLHC = InDetServMatBuilderToolSLHC()
+            ToolSvc+=InDetServMatBuilderToolSLHC
+
+    if ( DetFlags.detdescr.pixel_on() ):
         from AthenaCommon import CfgGetter
         GeoModelSvc.DetectorTools += [ CfgGetter.getPrivateTool("PixelDetectorTool", checkType=True) ]
-            
-        if (DetFlags.detdescr.BCM_on() ) :
-            from AthenaCommon.AppMgr import ToolSvc
-            from BCM_GeoModel.BCM_GeoModelConf import InDetDD__BCM_Builder
-            bcmTool = InDetDD__BCM_Builder()
-            ToolSvc += bcmTool
+
+        if (DetFlags.detdescr.BCM_on() ) :
+            from AthenaCommon.AppMgr import ToolSvc
+            from BCM_GeoModel.BCM_GeoModelConf import InDetDD__BCM_Builder
+            bcmTool = InDetDD__BCM_Builder()
+            ToolSvc += bcmTool
             GeoModelSvc.DetectorTools['PixelDetectorTool'].BCM_Tool = bcmTool
-
-            from BLM_GeoModel.BLM_GeoModelConf import InDetDD__BLM_Builder
-            blmTool = InDetDD__BLM_Builder()
-            ToolSvc += blmTool
+
+            from BLM_GeoModel.BLM_GeoModelConf import InDetDD__BLM_Builder
+            blmTool = InDetDD__BLM_Builder()
+            ToolSvc += blmTool
             GeoModelSvc.DetectorTools['PixelDetectorTool'].BLM_Tool = blmTool
-
-    if ( DetFlags.detdescr.SCT_on() ):
+
+    if ( DetFlags.detdescr.SCT_on() ):
         if GeometryFlags.isSLHC():
-            #SLHC specific code                                                                                                                                   
+            #SLHC specific code
             from SCT_SLHC_GeoModel.SCT_SLHC_GeoModelConf import SCT_SLHC_DetectorTool
             sctSLHCTool = SCT_SLHC_DetectorTool()
             GeoModelSvc.DetectorTools += [ sctSLHCTool ]
@@ -61,23 +61,27 @@ elif ( DetFlags.detdescr.ID_on() ):
                                                        UseMagFieldSvc = False,
                                                        DetectorName = "SCT")
                 svcMgr+=SCTLorentzAngleSvc
-        else:
-            # Current atlas specific code 
+        else:
+            # Current atlas specific code
             from AthenaCommon import CfgGetter
             GeoModelSvc.DetectorTools += [ CfgGetter.getPrivateTool("SCT_DetectorTool", checkType=True) ]
-
-    if ( DetFlags.detdescr.TRT_on() ):
-        from TRT_GeoModel.TRT_GeoModelConf import TRT_DetectorTool
-        GeoModelSvc.DetectorTools += [ TRT_DetectorTool() ]
-
-    from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatTool
+
+    if ( DetFlags.detdescr.TRT_on() ):
+        from TRT_GeoModel.TRT_GeoModelConf import TRT_DetectorTool
+        trtDetectorTool = TRT_DetectorTool()
+        if ( DetFlags.simulate.TRT_on() ):
+            trtDetectorTool.DoXenonArgonMixture = True
+            trtDetectorTool.DoKryptonMixture = True
+        GeoModelSvc.DetectorTools += [ trtDetectorTool ]
+
+    from InDetServMatGeoModel.InDetServMatGeoModelConf import InDetServMatTool
     if GeometryFlags.isSLHC():
-        #SLHC specific code 
-        servMatTool = InDetServMatTool()
-        GeoModelSvc.DetectorTools += [ servMatTool ]
-        servMatTool.ServiceBuilderTool = InDetServMatBuilderToolSLHC
-    else:
-        GeoModelSvc.DetectorTools += [ InDetServMatTool() ]
-       
-    # Make alignable 
-    from InDetCondFolders import InDetAlignFolders
+        #SLHC specific code
+        servMatTool = InDetServMatTool()
+        GeoModelSvc.DetectorTools += [ servMatTool ]
+        servMatTool.ServiceBuilderTool = InDetServMatBuilderToolSLHC
+    else:
+        GeoModelSvc.DetectorTools += [ InDetServMatTool() ]
+
+    # Make alignable
+    from InDetCondFolders import InDetAlignFolders
-- 
GitLab