From fb1e25f331cc87baa8410610159bff5513cf4898 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Mon, 17 May 2021 15:12:47 +0200
Subject: [PATCH] Move ITk.useLocalGeometry to GeoModel.useLocalGeometry

---
 Control/AthenaConfiguration/python/GeoModelConfigFlags.py     | 2 ++
 .../DetDescrCnvSvc/python/DetDescrCnvSvcConfig.py             | 2 +-
 InnerDetector/InDetConfig/python/ITkConfigFlags.py            | 3 +--
 InnerDetector/InDetConfig/test/ITkTest.py                     | 2 +-
 .../PixelGeoModelXml/python/ITkPixelGeoModelConfig.py         | 2 +-
 .../StripGeoModelXml/python/ITkStripGeoModelConfig.py         | 4 ++--
 Simulation/Tools/HitAnalysis/tools/RunHitAnalysis.py          | 2 +-
 7 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/Control/AthenaConfiguration/python/GeoModelConfigFlags.py b/Control/AthenaConfiguration/python/GeoModelConfigFlags.py
index d75a5a84b4e..7916248fb28 100644
--- a/Control/AthenaConfiguration/python/GeoModelConfigFlags.py
+++ b/Control/AthenaConfiguration/python/GeoModelConfigFlags.py
@@ -33,4 +33,6 @@ def createGeoModelConfigFlags():
                 lambda prevFlags : DetDescrInfo(prevFlags.GeoModel.AtlasVersion)['Pixel']['IBLlayout'])
                 # IBL layer layout  in {"planar", "3D", "noIBL"}
 
+    gcf.addFlag("GeoModel.useLocalGeometry", False)  # use local XML files for development
+
     return gcf
diff --git a/DetectorDescription/DetDescrCnvSvc/python/DetDescrCnvSvcConfig.py b/DetectorDescription/DetDescrCnvSvc/python/DetDescrCnvSvcConfig.py
index 5e399ba993e..ff4c58f283d 100644
--- a/DetectorDescription/DetDescrCnvSvc/python/DetDescrCnvSvcConfig.py
+++ b/DetectorDescription/DetDescrCnvSvc/python/DetDescrCnvSvcConfig.py
@@ -9,7 +9,7 @@ def DetDescrCnvSvcCfg(flags, **kwargs):
     kwargs.setdefault("HasSTgc", flags.Detector.GeometrysTGC)
     kwargs.setdefault("HasMM", flags.Detector.GeometryMM)
 
-    if flags.ITk.useLocalGeometry:
+    if flags.GeoModel.useLocalGeometry:
         kwargs.setdefault("IdDictFromRDB", False)
         kwargs.setdefault("InDetIDFileName", "ITKLayouts/IdDictInnerDetector_ITK_LOCAL.xml")
         kwargs.setdefault("MuonIDFileName", "IdDictParser/IdDictMuonSpectrometer_R.09.NSW.xml")
diff --git a/InnerDetector/InDetConfig/python/ITkConfigFlags.py b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
index f23de2e2c19..bd89def14dd 100644
--- a/InnerDetector/InDetConfig/python/ITkConfigFlags.py
+++ b/InnerDetector/InDetConfig/python/ITkConfigFlags.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
 # TODO : Add some exta levels?
@@ -7,7 +7,6 @@ def createITkConfigFlags():
   itkcf = AthConfigFlags()
 
   # take geometry XML files from local instance rather than Detector Database, for development
-  itkcf.addFlag("ITk.useLocalGeometry", False)
   itkcf.addFlag("ITk.pixelGeometryFilename", "ITKLayouts/PixelGeoModelXml/ITkPixel.gmx")
   itkcf.addFlag("ITk.stripGeometryFilename", "ITKLayouts/Strip/ITkStrip.gmx")
 
diff --git a/InnerDetector/InDetConfig/test/ITkTest.py b/InnerDetector/InDetConfig/test/ITkTest.py
index e3ced2fdebb..4753a573e16 100755
--- a/InnerDetector/InDetConfig/test/ITkTest.py
+++ b/InnerDetector/InDetConfig/test/ITkTest.py
@@ -20,7 +20,7 @@ Configurable.configurableRun3Behavior = True
 def defaultTestFlags(configFlags, args):
     """Fill default ITk flags for testing"""
     if args.localgeo:
-        configFlags.ITk.useLocalGeometry = True
+        configFlags.GeoModel.useLocalGeometry = True
 
     configFlags.Input.Files = [args.inputevntfile]
     
diff --git a/InnerDetector/InDetDetDescr/PixelGeoModelXml/python/ITkPixelGeoModelConfig.py b/InnerDetector/InDetDetDescr/PixelGeoModelXml/python/ITkPixelGeoModelConfig.py
index 56cbf36f893..489db2f7d0d 100644
--- a/InnerDetector/InDetDetDescr/PixelGeoModelXml/python/ITkPixelGeoModelConfig.py
+++ b/InnerDetector/InDetDetDescr/PixelGeoModelXml/python/ITkPixelGeoModelConfig.py
@@ -16,7 +16,7 @@ def ITkPixelGeometryCfg(flags):
     # ITkPixelDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
     ITkPixelDetectorTool.Alignable = False # make this a flag? Set true as soon as decided on folder structure
     ITkPixelDetectorTool.DetectorName = "ITkPixel"
-    if flags.ITk.useLocalGeometry:
+    if flags.GeoModel.useLocalGeometry:
       # Setting this filename triggers reading from local file rather than DB
       ITkPixelDetectorTool.GmxFilename = flags.ITk.pixelGeometryFilename
     geoModelSvc.DetectorTools += [ ITkPixelDetectorTool ]
diff --git a/InnerDetector/InDetDetDescr/StripGeoModelXml/python/ITkStripGeoModelConfig.py b/InnerDetector/InDetDetDescr/StripGeoModelXml/python/ITkStripGeoModelConfig.py
index 1e4b7b75ac0..1931bd0b3aa 100644
--- a/InnerDetector/InDetDetDescr/StripGeoModelXml/python/ITkStripGeoModelConfig.py
+++ b/InnerDetector/InDetDetDescr/StripGeoModelXml/python/ITkStripGeoModelConfig.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 
 from AthenaConfiguration.ComponentFactory import CompFactory
 from AthenaConfiguration.Enums import ProductionStep
@@ -15,7 +15,7 @@ def ITkStripGeometryCfg( flags ):
     #ITkStripDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic #Will we need to do dynamic alignment for ITk?
     ITkStripDetectorTool.Alignable = False # make this a flag? Set true as soon as decided on folder structure
     ITkStripDetectorTool.DetectorName = "ITkStrip"
-    if flags.ITk.useLocalGeometry:
+    if flags.GeoModel.useLocalGeometry:
       #Setting this filename triggers reading from local file rather than DB  
       ITkStripDetectorTool.GmxFilename = flags.ITk.stripGeometryFilename 
     geoModelSvc.DetectorTools += [ ITkStripDetectorTool ]
diff --git a/Simulation/Tools/HitAnalysis/tools/RunHitAnalysis.py b/Simulation/Tools/HitAnalysis/tools/RunHitAnalysis.py
index afef55546de..5cb54d910c8 100755
--- a/Simulation/Tools/HitAnalysis/tools/RunHitAnalysis.py
+++ b/Simulation/Tools/HitAnalysis/tools/RunHitAnalysis.py
@@ -41,7 +41,7 @@ print()
 # Configure
 ConfigFlags.Input.Files = [args.input]
 if args.localgeo:
-    ConfigFlags.ITk.useLocalGeometry = True
+    ConfigFlags.GeoModel.useLocalGeometry = True
 if args.detectors:
     from AthenaConfiguration.DetectorConfigFlags import setupDetectorsFromList
     setupDetectorsFromList(ConfigFlags, args.detectors, toggle_geometry=True)
-- 
GitLab