From 8a6e212e89cd78e7a3e792dcb8109f2d2fae875c Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Mon, 2 Nov 2020 17:14:46 +0100
Subject: [PATCH] Eliminate deprecated InDetFlags version of
 useDynamicAlignFolders

---
 .../share/DataQualitySteering_jobOptions.py    |  2 +-
 .../python/InDetGMJobProperties.py             |  2 +-
 .../InDetConfig/python/InDetConfigFlags.py     |  1 -
 .../python/InDetJobProperties.py               | 18 ------------------
 .../share/RecExOnline_globalconfig_HI_2018.py  | 12 ++++--------
 .../share/RecExOnline_globalconfig_pp_2018.py  |  4 ++--
 6 files changed, 8 insertions(+), 31 deletions(-)

diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
index 99cd920a96c6..f9936e3d9c3c 100644
--- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
@@ -331,7 +331,7 @@ if DQMonFlags.doMonitoring():
       elif globalflags.InputFormat() == 'pool':
          ConfigFlags.Input.Files=svcMgr.EventSelector.InputCollections
 
-      ConfigFlags.GeoModel.Align.Dynamic=InDetFlags.useDynamicAlignFolders()
+      ConfigFlags.GeoModel.Align.Dynamic=InDetGeometryFlags.useDynamicAlignFolders()
       ConfigFlags.Detector.GeometryPixel=DetFlags.pixel_on()
       ConfigFlags.Detector.GeometrySCT=DetFlags.SCT_on()
       ConfigFlags.Detector.GeometryTRT=DetFlags.TRT_on()
diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMJobProperties.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMJobProperties.py
index 43c5b63cf211..665448f1bec9 100755
--- a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMJobProperties.py
+++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGMJobProperties.py
@@ -132,7 +132,7 @@ class useDynamicAlignFolders(JobProperty):
     """ Use to turn on dynamic alignment constants folder scheme (first deployed in 2016) """
     statusOn     = True
     allowedTypes = ['bool']
-    StoredValue  = False
+    StoredValue  = True
 
 
 
diff --git a/InnerDetector/InDetConfig/python/InDetConfigFlags.py b/InnerDetector/InDetConfig/python/InDetConfigFlags.py
index f5a76d284f66..9beed0504113 100644
--- a/InnerDetector/InDetConfig/python/InDetConfigFlags.py
+++ b/InnerDetector/InDetConfig/python/InDetConfigFlags.py
@@ -63,7 +63,6 @@ def createInDetConfigFlags():
   icf.addFlag("InDet.doMonitoringSCT", False) # Use to turn on SCT monitoring 
   icf.addFlag("InDet.doMonitoringTRT", False) # Use to turn on TRT monitoring 
   icf.addFlag("InDet.doMonitoringAlignment", False) # Use to turn on alignment monitoring 
-  icf.addFlag("InDet.useDynamicAlignFolders",False) # Deprecated property - use InDetGeometryFlags directly to choose the alignment folder scheme 
   icf.addFlag("InDet.doPerfMon", False) # Use to turn on PerfMon 
   icf.addFlag("InDet.AODall", False) 
   icf.addFlag("InDet.useBeamConstraint", True) # use beam spot service in new tracking 
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
index 3ce9efe20c8c..7c3ac9aebfe2 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
@@ -439,21 +439,6 @@ class doMonitoringAlignment(InDetFlagsJobProperty):
     allowedTypes = ['bool']
     StoredValue  = False
 
-class useDynamicAlignFolders(InDetFlagsJobProperty):
-    """ Deprecated property - use InDetGeometryFlags directly to choose the alignment folder scheme """
-    def _do_action( self, *args, **kwds):
-       self._log.warning('Deprecated property InDetFlags.useDynamicAlignFolders used to control the alignment scheme - update the code to from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags;  InDetGeometryFlags.useDynamicAlignFolders.... ')
-       if self.StoredValue != 'none':
-          from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags
-          InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(self.StoredValue)
-          self._log.info("InDetGeometryFlags.useDynamicAlignFolders set by InDetFlags: %s" % InDetGeometryFlags.useDynamicAlignFolders)
-       else:
-          self._log.warning("Not setting InDetGeometryFlags.useDynamicAlignFolders by InDetFlags: %s" % self.StoredValue)
-          
-    statusOn     = True
-    allowedTypes = ['bool']
-    StoredValue  = True
-
 class doPerfMon(InDetFlagsJobProperty):
     """ Use to turn on PerfMon """
     statusOn     = True
@@ -2515,8 +2500,6 @@ class InDetJobProperties(JobPropertyContainer):
           print('* use non-standard SCT DCS based on ~20V HV cut')
     if self.useTrtDCS():
        print('* use TRT DCS')
-    if self.useDynamicAlignFolders():
-       print('* use of Dynamic alignment folder scheme enabled')
 
     if not self.doPRDFormation():
        print('* PRD Formation is off for all technologies')
@@ -2660,7 +2643,6 @@ _list_InDetJobProperties = [Enabled,
                             doMonitoringSCT,
                             doMonitoringTRT,
                             doMonitoringAlignment,
-                            useDynamicAlignFolders,
                             doPerfMon,
                             AODall,
                             useBeamConstraint,
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig_HI_2018.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig_HI_2018.py
index 90c4f3e0592b..f11dd030a666 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig_HI_2018.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig_HI_2018.py
@@ -224,15 +224,15 @@ from InDetRecExample.InDetJobProperties import InDetFlags
 InDetFlags.doPixelClusterSplitting.set_Value(False) # does not work online
 
 
-from AtlasGeoModel.InDetGMJobProperties import GeometryFlags
+from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags
 if isHI_mode:
     ## ID alignment to test 2015 HI data
-    ## GeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)
+    ## InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(False)
     ## ID alignment for 2018 HI data
-    GeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)
+    InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)
 else:
     ## new ID alignment 26 May 2017
-    GeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)
+    InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)
 
 # ----------------------------------------------- Online flag
 athenaCommonFlags.EvtMax.set_Value_and_Lock(evtMax)
@@ -242,10 +242,6 @@ athenaCommonFlags.isOnlineStateless = isOnlineStateless
 from InDetRecExample.InDetJobProperties import InDetFlags
 InDetFlags.useBeamConstraint.set_Value_and_Lock(False)
 if isHI_mode:
-    ## ID alignment to test 2015 HI data
-    ## InDetFlags.useDynamicAlignFolders.set_Value_and_Lock(False);
-    ## ID alignment to run 2018 HI data
-    InDetFlags.useDynamicAlignFolders.set_Value_and_Lock(True);
     ### InDetFlags.cutLevel.set_Value_and_Lock(2);
     InDetFlags.cutLevel.set_Value_and_Lock(4);  ### (Nov 8th 2018, looser cuts)
 
diff --git a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig_pp_2018.py b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig_pp_2018.py
index 6c97c2d04550..6d4bfc357fdb 100644
--- a/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig_pp_2018.py
+++ b/Reconstruction/RecExample/RecExOnline/share/RecExOnline_globalconfig_pp_2018.py
@@ -211,8 +211,8 @@ from InDetRecExample.InDetJobProperties import InDetFlags
 InDetFlags.doPixelClusterSplitting.set_Value(False) # does not work online
 
 ## new ID alignment 26 May 2017
-from AtlasGeoModel.InDetGMJobProperties import GeometryFlags
-GeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)
+from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags
+InDetGeometryFlags.useDynamicAlignFolders.set_Value_and_Lock(True)
 
 # ----------------------------------------------- Online flag
 athenaCommonFlags.EvtMax.set_Value_and_Lock(evtMax)
-- 
GitLab