From 67e1bd917adeb1c061ebd24db0a8cb8c0aeafa69 Mon Sep 17 00:00:00 2001
From: Menglin Xu <mexu@lblhcbpr10.cern.ch>
Date: Tue, 16 Apr 2024 17:28:29 +0200
Subject: [PATCH 01/10] define GeometryBackend for DD4Hep and DetDesc

---
 Det/DDDB/python/DDDB/Configuration.py | 179 ++++++++++++++++++++++++--
 1 file changed, 169 insertions(+), 10 deletions(-)

diff --git a/Det/DDDB/python/DDDB/Configuration.py b/Det/DDDB/python/DDDB/Configuration.py
index 11fbe899..7aafbc17 100755
--- a/Det/DDDB/python/DDDB/Configuration.py
+++ b/Det/DDDB/python/DDDB/Configuration.py
@@ -20,13 +20,8 @@ import re
 import os
 
 from datetime import datetime, timedelta
-
 from Gaudi.Configuration import *
 
-from DetCond.Configuration import CondDB
-from Configurables import (XmlCnvSvc, XmlParserSvc, EntityResolverDispatcher,
-                           GitEntityResolver)
-
 GIT_CONDDBS = {}
 
 
@@ -90,9 +85,11 @@ class DDDBConf(ConfigurableUser):
         "GeometryLocation":
         "",
         "GeometryVersion":
-        "trunk",
+        "run3/trunk",
         "GeometryMain":
         "LHCb.xml",
+        "GeometryBackend":
+        "",
         "ConditionsLocation":
         "",
         "DD4HepDetectorList": [
@@ -106,7 +103,7 @@ class DDDBConf(ConfigurableUser):
         'DbRoot':
         """ Root file of the detector description """,
         'DataType':
-        """ Symbolic name for the data type. Allowed values: ["2023", "2022", "2018", "2017", "2016", "2015", "2013", "2012", "2011", "2010", "2009","2008","Upgrade"] """,
+        """ Symbolic name for the data type. Allowed values: ["2024", "2023", "2022", "2018", "2017", "2016", "2015", "2013", "2012", "2011", "2010", "2009", "2008", "Run3", "Upgrade"] """,
         'Simulation':
         """ Boolean flag to select the simulation or real-data configuration """,
         'InitialTime':
@@ -123,18 +120,164 @@ class DDDBConf(ConfigurableUser):
         """ Version of the DD4hep geometry that should be used """,
         'GeometryMain':
         """ Main compact file to be loaded """,
+        'GeometryBackend':
+        """ Backend to be used for the geometry, must be DD4Hep or DetDesc, when empty it means not DetDesc """,
         'ConditionsLocation':
         "Location of the conditions repository (lookup from CMAKE_PREFIX_PATH if not specified)",
         'ConditionsVersion':
         """ Tag for the conditions database """,
     }
 
-    __used_configurables__ = [CondDB]
-
     def __apply_configuration__(self):
         """
         Converts the high-level information passed as properties into low-level configuration.
         """
+        print("=======================")
+        print(self.getProp("GeometryBackend"))
+        print("=======================")
+        assert self.getProp("GeometryBackend") in (
+            "DetDesc",
+            "DD4Hep"), "GeometryBackend has to be one of 'DetDesc' or 'DD4Hep'"
+        backend = self.getProp("GeometryBackend")
+        if backend == "DetDesc":
+            from DetCond.Configuration import CondDB
+            from Configurables import (XmlCnvSvc, XmlParserSvc,
+                                       EntityResolverDispatcher,
+                                       GitEntityResolver)
+            __used_configurables__ = [CondDB]
+        ##########################################################################
+        # DD4hep Detector Configuration
+        ##########################################################################
+        ##########################################################################
+        elif backend == "DD4Hep":
+            __used_configurables__ = []
+            from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
+            dd4hepSvc = DD4hepSvc()
+
+            if self.getProp(
+                    "GeometryLocation"
+            ) and not dd4hepSvc.isPropertySet("GeometryLocation"):
+                dd4hepSvc.GeometryLocation = self.getProp("GeometryLocation")
+
+            if self.getProp("GeometryVersion") and not dd4hepSvc.isPropertySet(
+                    "GeometryVersion"):
+                dd4hepSvc.GeometryVersion = self.getProp("GeometryVersion")
+
+            if self.getProp("GeometryMain"
+                            ) and not dd4hepSvc.isPropertySet("GeometryMain"):
+                dd4hepSvc.GeometryMain = self.getProp("GeometryMain")
+
+            if self.getProp(
+                    "ConditionsVersion"
+            ) and not dd4hepSvc.isPropertySet("ConditionsVersion"):
+                dd4hepSvc.ConditionsVersion = self.getProp("ConditionsVersion")
+
+            if self.getProp(
+                    "ConditionsLocation"
+            ) and not dd4hepSvc.isPropertySet("ConditionsLocation"):
+                dd4hepSvc.ConditionsLocation = self.getProp(
+                    "ConditionsLocation")
+            else:
+                if not hasattr(dd4hepSvc, "ConditionsLocation"):
+                    lhcb_cond_db = GIT_CONDDBS.get("lhcb-conditions-database",
+                                                   None)
+                    if not lhcb_cond_db:
+                        log.warning(
+                            "Could not find git repository: lhcb-conditions-database"
+                        )
+                    else:
+                        url = "git:" + lhcb_cond_db
+                        if (not lhcb_cond_db.endswith(".git")):
+                            url = "file:" + lhcb_cond_db + "/"
+                        log.info("Using git repository: " + url)
+                        dd4hepSvc.ConditionsLocation = url
+
+            if self.getProp("DD4HepDetectorList"):
+                if not hasattr(dd4hepSvc, "DetectorList"):
+                    dd4hepSvc.DetectorList = self.getProp("DD4HepDetectorList")
+
+            log.info(dd4hepSvc)
+
+            # make sure we do not use HeartBeat and RunStampCheck in DD4hep mode
+            self._properties["IgnoreHeartBeat"].setDefault(True)
+            self._properties["EnableRunStampCheck"].setDefault(False)
+
+            # FIXME: We need to find a way to configure LHCb__ParticlePropertySvc for Run3
+            from Configurables import LHCb__ParticlePropertySvc
+            pps = LHCb__ParticlePropertySvc()
+            if not pps.isPropertySet("ParticlePropertiesFile"):
+                from PartProp import DEFAULT_PARTICLE_PROPERTY_FILE
+                pps.ParticlePropertiesFile = str(
+                    DEFAULT_PARTICLE_PROPERTY_FILE)
+
+            return  # everything else in this function is about using the old CondDB
+
+        ##########################################################################
+        # DD4hep Detector Configuration
+        ##########################################################################
+        ##########################################################################
+        if (self.getProp("GeometryBackend").upper() == "DD4HEP"):
+            from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
+            dd4hepSvc = DD4hepSvc()
+
+            if self.getProp(
+                    "GeometryLocation"
+            ) and not dd4hepSvc.isPropertySet("GeometryLocation"):
+                dd4hepSvc.GeometryLocation = self.getProp("GeometryLocation")
+
+            if self.getProp("GeometryVersion") and not dd4hepSvc.isPropertySet(
+                    "GeometryVersion"):
+                dd4hepSvc.GeometryVersion = self.getProp("GeometryVersion")
+
+            if self.getProp("GeometryMain"
+                            ) and not dd4hepSvc.isPropertySet("GeometryMain"):
+                dd4hepSvc.GeometryMain = self.getProp("GeometryMain")
+
+            if self.getProp(
+                    "ConditionsVersion"
+            ) and not dd4hepSvc.isPropertySet("ConditionsVersion"):
+                dd4hepSvc.ConditionsVersion = self.getProp("ConditionsVersion")
+
+            if self.getProp(
+                    "ConditionsLocation"
+            ) and not dd4hepSvc.isPropertySet("ConditionsLocation"):
+                dd4hepSvc.ConditionsLocation = self.getProp(
+                    "ConditionsLocation")
+            else:
+                if not hasattr(dd4hepSvc, "ConditionsLocation"):
+                    lhcb_cond_db = GIT_CONDDBS.get("lhcb-conditions-database",
+                                                   None)
+                    if not lhcb_cond_db:
+                        log.warning(
+                            "Could not find git repository: lhcb-conditions-database"
+                        )
+                    else:
+                        url = "git:" + lhcb_cond_db
+                        if (not lhcb_cond_db.endswith(".git")):
+                            url = "file:" + lhcb_cond_db + "/"
+                        log.info("Using git repository: " + url)
+                        dd4hepSvc.ConditionsLocation = url
+
+            if self.getProp("DD4HepDetectorList"):
+                if not hasattr(dd4hepSvc, "DetectorList"):
+                    dd4hepSvc.DetectorList = self.getProp("DD4HepDetectorList")
+
+            log.info(dd4hepSvc)
+
+            # make sure we do not use HeartBeat and RunStampCheck in DD4hep mode
+            self._properties["IgnoreHeartBeat"].setDefault(True)
+            self._properties["EnableRunStampCheck"].setDefault(False)
+
+            # FIXME: We need to find a way to configure LHCb__ParticlePropertySvc for Run3
+            from Configurables import LHCb__ParticlePropertySvc
+            pps = LHCb__ParticlePropertySvc()
+            if not pps.isPropertySet("ParticlePropertiesFile"):
+                from PartProp import DEFAULT_PARTICLE_PROPERTY_FILE
+                pps.ParticlePropertiesFile = str(
+                    DEFAULT_PARTICLE_PROPERTY_FILE)
+
+            return  # everything else in this function is about using the old CondDB
+
         ##########################################################################
         # Detector Transient Store Configuration
         ##########################################################################
@@ -243,7 +386,8 @@ class DDDBConf(ConfigurableUser):
         # by default, use the latest DQFLAGS tag for the requested data type
         # (unless already set by a data type handler)
         if not self.getProp("Simulation") and dataType not in ("Upgrade",
-                                                               "2022", "2023"):
+                                                               "2022", "2023",
+                                                               "2024", "Run3"):
             self.__set_tag__(["DQFLAGS"], "<latest:{0}>".format(dataType))
 
         # Get particle properties table from condDB
@@ -311,6 +455,13 @@ class DDDBConf(ConfigurableUser):
                 "EventClockSvc().InitialTime already set to %s UTC (requested %s UTC)",
                 t.isoformat(), utcDatetime.isoformat())
 
+    def __2024_conf__(self):
+        """
+        Default configuration for 2024 data
+        to be updated after final configuration is taken
+        """
+        pass
+
     def __2023_conf__(self):
         """
         Default configuration for 2023 data
@@ -445,6 +596,12 @@ class DDDBConf(ConfigurableUser):
         else:
             self.__set_tag__(["SIMCOND"], "sim-20090212")
 
+    def __Run3_conf__(self):
+        """
+        Default database for Run3 MonteCarlo production and analysis
+        """
+        pass  # nothing special here
+
     def __Upgrade_conf__(self):
         """
         Default database for Upgrade MonteCarlo production and analysis
@@ -452,6 +609,7 @@ class DDDBConf(ConfigurableUser):
         pass  # nothing special here
 
     __data_types_handlers__ = {
+        "2024": __2024_conf__,
         "2023": __2023_conf__,
         "2022": __2022_conf__,
         "2018": __2018_conf__,
@@ -464,5 +622,6 @@ class DDDBConf(ConfigurableUser):
         "2010": __2010_conf__,
         "2009": __2009_conf__,
         "2008": __2008_conf__,
+        "Run3": __Run3_conf__,
         "Upgrade": __Upgrade_conf__
     }
-- 
GitLab


From b929723b64ac97812609a2ec2330fe53b4a856d2 Mon Sep 17 00:00:00 2001
From: Menglin Xu <mexu@lblhcbpr10.cern.ch>
Date: Tue, 16 Apr 2024 17:31:27 +0200
Subject: [PATCH 02/10] remove the lines used for local test

---
 Det/DDDB/python/DDDB/Configuration.py | 69 ---------------------------
 1 file changed, 69 deletions(-)

diff --git a/Det/DDDB/python/DDDB/Configuration.py b/Det/DDDB/python/DDDB/Configuration.py
index 7aafbc17..9f235c7c 100755
--- a/Det/DDDB/python/DDDB/Configuration.py
+++ b/Det/DDDB/python/DDDB/Configuration.py
@@ -132,9 +132,6 @@ class DDDBConf(ConfigurableUser):
         """
         Converts the high-level information passed as properties into low-level configuration.
         """
-        print("=======================")
-        print(self.getProp("GeometryBackend"))
-        print("=======================")
         assert self.getProp("GeometryBackend") in (
             "DetDesc",
             "DD4Hep"), "GeometryBackend has to be one of 'DetDesc' or 'DD4Hep'"
@@ -212,72 +209,6 @@ class DDDBConf(ConfigurableUser):
 
             return  # everything else in this function is about using the old CondDB
 
-        ##########################################################################
-        # DD4hep Detector Configuration
-        ##########################################################################
-        ##########################################################################
-        if (self.getProp("GeometryBackend").upper() == "DD4HEP"):
-            from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
-            dd4hepSvc = DD4hepSvc()
-
-            if self.getProp(
-                    "GeometryLocation"
-            ) and not dd4hepSvc.isPropertySet("GeometryLocation"):
-                dd4hepSvc.GeometryLocation = self.getProp("GeometryLocation")
-
-            if self.getProp("GeometryVersion") and not dd4hepSvc.isPropertySet(
-                    "GeometryVersion"):
-                dd4hepSvc.GeometryVersion = self.getProp("GeometryVersion")
-
-            if self.getProp("GeometryMain"
-                            ) and not dd4hepSvc.isPropertySet("GeometryMain"):
-                dd4hepSvc.GeometryMain = self.getProp("GeometryMain")
-
-            if self.getProp(
-                    "ConditionsVersion"
-            ) and not dd4hepSvc.isPropertySet("ConditionsVersion"):
-                dd4hepSvc.ConditionsVersion = self.getProp("ConditionsVersion")
-
-            if self.getProp(
-                    "ConditionsLocation"
-            ) and not dd4hepSvc.isPropertySet("ConditionsLocation"):
-                dd4hepSvc.ConditionsLocation = self.getProp(
-                    "ConditionsLocation")
-            else:
-                if not hasattr(dd4hepSvc, "ConditionsLocation"):
-                    lhcb_cond_db = GIT_CONDDBS.get("lhcb-conditions-database",
-                                                   None)
-                    if not lhcb_cond_db:
-                        log.warning(
-                            "Could not find git repository: lhcb-conditions-database"
-                        )
-                    else:
-                        url = "git:" + lhcb_cond_db
-                        if (not lhcb_cond_db.endswith(".git")):
-                            url = "file:" + lhcb_cond_db + "/"
-                        log.info("Using git repository: " + url)
-                        dd4hepSvc.ConditionsLocation = url
-
-            if self.getProp("DD4HepDetectorList"):
-                if not hasattr(dd4hepSvc, "DetectorList"):
-                    dd4hepSvc.DetectorList = self.getProp("DD4HepDetectorList")
-
-            log.info(dd4hepSvc)
-
-            # make sure we do not use HeartBeat and RunStampCheck in DD4hep mode
-            self._properties["IgnoreHeartBeat"].setDefault(True)
-            self._properties["EnableRunStampCheck"].setDefault(False)
-
-            # FIXME: We need to find a way to configure LHCb__ParticlePropertySvc for Run3
-            from Configurables import LHCb__ParticlePropertySvc
-            pps = LHCb__ParticlePropertySvc()
-            if not pps.isPropertySet("ParticlePropertiesFile"):
-                from PartProp import DEFAULT_PARTICLE_PROPERTY_FILE
-                pps.ParticlePropertiesFile = str(
-                    DEFAULT_PARTICLE_PROPERTY_FILE)
-
-            return  # everything else in this function is about using the old CondDB
-
         ##########################################################################
         # Detector Transient Store Configuration
         ##########################################################################
-- 
GitLab


From a1fb5c274077cae18adda4d6729c99cfa2128fbf Mon Sep 17 00:00:00 2001
From: Menglin Xu <mexu@lblhcbpr10.cern.ch>
Date: Tue, 16 Apr 2024 18:47:22 +0200
Subject: [PATCH 03/10] should extract the changes in datatype from this merge
 request

---
 Det/DDDB/python/DDDB/Configuration.py | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/Det/DDDB/python/DDDB/Configuration.py b/Det/DDDB/python/DDDB/Configuration.py
index 9f235c7c..0fc506ee 100755
--- a/Det/DDDB/python/DDDB/Configuration.py
+++ b/Det/DDDB/python/DDDB/Configuration.py
@@ -85,7 +85,7 @@ class DDDBConf(ConfigurableUser):
         "GeometryLocation":
         "",
         "GeometryVersion":
-        "run3/trunk",
+        "trunk",
         "GeometryMain":
         "LHCb.xml",
         "GeometryBackend":
@@ -103,7 +103,7 @@ class DDDBConf(ConfigurableUser):
         'DbRoot':
         """ Root file of the detector description """,
         'DataType':
-        """ Symbolic name for the data type. Allowed values: ["2024", "2023", "2022", "2018", "2017", "2016", "2015", "2013", "2012", "2011", "2010", "2009", "2008", "Run3", "Upgrade"] """,
+        """ Symbolic name for the data type. Allowed values: ["2023", "2022", "2018", "2017", "2016", "2015", "2013", "2012", "2011", "2010", "2009","2008","Upgrade"] """,
         'Simulation':
         """ Boolean flag to select the simulation or real-data configuration """,
         'InitialTime':
@@ -317,8 +317,7 @@ class DDDBConf(ConfigurableUser):
         # by default, use the latest DQFLAGS tag for the requested data type
         # (unless already set by a data type handler)
         if not self.getProp("Simulation") and dataType not in ("Upgrade",
-                                                               "2022", "2023",
-                                                               "2024", "Run3"):
+                                                               "2022", "2023"):
             self.__set_tag__(["DQFLAGS"], "<latest:{0}>".format(dataType))
 
         # Get particle properties table from condDB
@@ -386,13 +385,6 @@ class DDDBConf(ConfigurableUser):
                 "EventClockSvc().InitialTime already set to %s UTC (requested %s UTC)",
                 t.isoformat(), utcDatetime.isoformat())
 
-    def __2024_conf__(self):
-        """
-        Default configuration for 2024 data
-        to be updated after final configuration is taken
-        """
-        pass
-
     def __2023_conf__(self):
         """
         Default configuration for 2023 data
@@ -527,12 +519,6 @@ class DDDBConf(ConfigurableUser):
         else:
             self.__set_tag__(["SIMCOND"], "sim-20090212")
 
-    def __Run3_conf__(self):
-        """
-        Default database for Run3 MonteCarlo production and analysis
-        """
-        pass  # nothing special here
-
     def __Upgrade_conf__(self):
         """
         Default database for Upgrade MonteCarlo production and analysis
@@ -540,7 +526,6 @@ class DDDBConf(ConfigurableUser):
         pass  # nothing special here
 
     __data_types_handlers__ = {
-        "2024": __2024_conf__,
         "2023": __2023_conf__,
         "2022": __2022_conf__,
         "2018": __2018_conf__,
@@ -553,6 +538,5 @@ class DDDBConf(ConfigurableUser):
         "2010": __2010_conf__,
         "2009": __2009_conf__,
         "2008": __2008_conf__,
-        "Run3": __Run3_conf__,
         "Upgrade": __Upgrade_conf__
     }
-- 
GitLab


From 8398ff21b1756f2fff693075037fa779a1ac85d8 Mon Sep 17 00:00:00 2001
From: Menglin Xu <update-trunk-checksum@project_bot>
Date: Wed, 17 Apr 2024 08:49:55 +0100
Subject: [PATCH 04/10] no need to define an additional variabile named backend

---
 Det/DDDB/python/DDDB/Configuration.py | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/Det/DDDB/python/DDDB/Configuration.py b/Det/DDDB/python/DDDB/Configuration.py
index 0fc506ee..91d16030 100755
--- a/Det/DDDB/python/DDDB/Configuration.py
+++ b/Det/DDDB/python/DDDB/Configuration.py
@@ -20,8 +20,13 @@ import re
 import os
 
 from datetime import datetime, timedelta
+
 from Gaudi.Configuration import *
 
+from DetCond.Configuration import CondDB
+from Configurables import (XmlCnvSvc, XmlParserSvc, EntityResolverDispatcher,
+                           GitEntityResolver)
+
 GIT_CONDDBS = {}
 
 
@@ -128,6 +133,8 @@ class DDDBConf(ConfigurableUser):
         """ Tag for the conditions database """,
     }
 
+    __used_configurables__ = [CondDB]
+
     def __apply_configuration__(self):
         """
         Converts the high-level information passed as properties into low-level configuration.
@@ -135,19 +142,11 @@ class DDDBConf(ConfigurableUser):
         assert self.getProp("GeometryBackend") in (
             "DetDesc",
             "DD4Hep"), "GeometryBackend has to be one of 'DetDesc' or 'DD4Hep'"
-        backend = self.getProp("GeometryBackend")
-        if backend == "DetDesc":
-            from DetCond.Configuration import CondDB
-            from Configurables import (XmlCnvSvc, XmlParserSvc,
-                                       EntityResolverDispatcher,
-                                       GitEntityResolver)
-            __used_configurables__ = [CondDB]
         ##########################################################################
         # DD4hep Detector Configuration
         ##########################################################################
         ##########################################################################
-        elif backend == "DD4Hep":
-            __used_configurables__ = []
+        if self.getProp("GeometryBackend") == "DD4Hep":
             from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
             dd4hepSvc = DD4hepSvc()
 
-- 
GitLab


From df70aa52e47a83ae1a13072fc6a42898d9b965ee Mon Sep 17 00:00:00 2001
From: Menglin Xu <mexu@lblhcbpr10.cern.ch>
Date: Wed, 17 Apr 2024 14:00:52 +0200
Subject: [PATCH 05/10] need to specific GeometryBackend for seveal tests

---
 Det/DetCond/tests/options/begin_event_no_reserve.py           | 2 +-
 .../tests/options/begin_event_no_reserve_sharedcond.py        | 2 +-
 Det/DetCond/tests/options/detdesc_cond_as_json.py             | 2 +-
 Det/DetCond/tests/options/detdesc_cond_as_yaml.py             | 2 +-
 Det/DetCond/tests/options/detdesc_cond_no_prop.py             | 2 +-
 Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py        | 2 +-
 Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py      | 2 +-
 Det/DetDescChecks/python/DetDescChecks/Options.py             | 4 +++-
 Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py         | 2 +-
 Det/Magnet/tests/options/test_demagnet.py                     | 3 ++-
 Det/Magnet/tests/options/test_magfieldsvc.py                  | 3 ++-
 .../tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt      | 2 +-
 .../tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt | 2 +-
 Det/VPDet/tests/scripts/VeloAlignmentTest.py                  | 2 +-
 .../tests/qmtest/gitentityresolver.qms/run_stamp.qmt          | 2 +-
 15 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/Det/DetCond/tests/options/begin_event_no_reserve.py b/Det/DetCond/tests/options/begin_event_no_reserve.py
index f66ba017..679fbd67 100644
--- a/Det/DetCond/tests/options/begin_event_no_reserve.py
+++ b/Det/DetCond/tests/options/begin_event_no_reserve.py
@@ -19,7 +19,7 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False)
+DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetCond/tests/options/begin_event_no_reserve_sharedcond.py b/Det/DetCond/tests/options/begin_event_no_reserve_sharedcond.py
index a2c666d0..d0244f79 100644
--- a/Det/DetCond/tests/options/begin_event_no_reserve_sharedcond.py
+++ b/Det/DetCond/tests/options/begin_event_no_reserve_sharedcond.py
@@ -19,7 +19,7 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False)
+DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetCond/tests/options/detdesc_cond_as_json.py b/Det/DetCond/tests/options/detdesc_cond_as_json.py
index df9983fe..da19dc29 100644
--- a/Det/DetCond/tests/options/detdesc_cond_as_json.py
+++ b/Det/DetCond/tests/options/detdesc_cond_as_json.py
@@ -19,7 +19,7 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False)
+DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetCond/tests/options/detdesc_cond_as_yaml.py b/Det/DetCond/tests/options/detdesc_cond_as_yaml.py
index 9365848e..f41fe1bc 100644
--- a/Det/DetCond/tests/options/detdesc_cond_as_yaml.py
+++ b/Det/DetCond/tests/options/detdesc_cond_as_yaml.py
@@ -19,7 +19,7 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False)
+DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetCond/tests/options/detdesc_cond_no_prop.py b/Det/DetCond/tests/options/detdesc_cond_no_prop.py
index a31ec6eb..4462f2a7 100644
--- a/Det/DetCond/tests/options/detdesc_cond_no_prop.py
+++ b/Det/DetCond/tests/options/detdesc_cond_no_prop.py
@@ -19,7 +19,7 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False)
+DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py b/Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py
index 0d90a8a4..345dff04 100755
--- a/Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py
+++ b/Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py
@@ -28,7 +28,7 @@ __version__ = '1.1'
 from Gaudi.Configuration import *
 
 from Configurables import DDDBConf
-DDDBConf(DataType='2015')
+DDDBConf(DataType='2015',GeometryBackend='DetDesc')
 
 from Configurables import DetDesc__CheckOverlap
 
diff --git a/Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py b/Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py
index 4f31cd6d..e3ab318a 100755
--- a/Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py
+++ b/Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py
@@ -28,7 +28,7 @@ __version__ = '1.1'
 from Gaudi.Configuration import *
 
 from Configurables import DDDBConf
-DDDBConf(DataType='2015')
+DDDBConf(DataType='2015',GeometryBackend='DetDesc')
 
 from Configurables import DetDesc__MaterialBudget
 
diff --git a/Det/DetDescChecks/python/DetDescChecks/Options.py b/Det/DetDescChecks/python/DetDescChecks/Options.py
index ed998166..b01900b4 100644
--- a/Det/DetDescChecks/python/DetDescChecks/Options.py
+++ b/Det/DetDescChecks/python/DetDescChecks/Options.py
@@ -23,7 +23,9 @@ def LoadDDDBTest(datatype, sim=False, paths=None):
         DataType=datatype,
         Simulation=sim,
         IgnoreHeartBeat=True,
-        EnableRunStampCheck=False)
+        EnableRunStampCheck=False,
+        GeometryBackend='DetDesc'
+        )
     # Set up conditions database configuration (ignore checks for up-to-date)
     CondDB(
         Upgrade=datatype == "Upgrade", LatestGlobalTagByDataTypes=[datatype])
diff --git a/Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py b/Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py
index cc802e45..6bd12bcf 100755
--- a/Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py
+++ b/Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py
@@ -28,7 +28,7 @@ __version__ = '1.1'
 from Gaudi.Configuration import *
 
 from Configurables import DDDBConf
-DDDBConf(DataType='2015')
+DDDBConf(DataType='2015',GeometryBackend='DetDesc')
 
 from Configurables import DetDesc__VolumeCheck
 
diff --git a/Det/Magnet/tests/options/test_demagnet.py b/Det/Magnet/tests/options/test_demagnet.py
index c98daad5..a23c1647 100644
--- a/Det/Magnet/tests/options/test_demagnet.py
+++ b/Det/Magnet/tests/options/test_demagnet.py
@@ -12,7 +12,7 @@ from Gaudi.Configuration import *
 
 import os
 from DDDB.Configuration import GIT_CONDDBS
-from Configurables import DeMagnetTester, CondDB
+from Configurables import DeMagnetTester, CondDB, DDDBConf
 
 # Main application
 ##################
@@ -23,6 +23,7 @@ from Configurables import LHCbApp, MagneticFieldSvc
 LHCbApp().DataType = "Upgrade"
 LHCbApp().Simulation = True
 CondDB().Upgrade = True
+DDDBConf.GeometryBackend="DetDesc"
 app.ExtSvc += [MagneticFieldSvc()]
 
 # Configure fake run number
diff --git a/Det/Magnet/tests/options/test_magfieldsvc.py b/Det/Magnet/tests/options/test_magfieldsvc.py
index 43844d18..b0ae540a 100644
--- a/Det/Magnet/tests/options/test_magfieldsvc.py
+++ b/Det/Magnet/tests/options/test_magfieldsvc.py
@@ -9,7 +9,7 @@
 # or submit itself to any jurisdiction.                                             #
 #####################################################################################
 from Gaudi.Configuration import *
-from Configurables import MagFielSvcTester, LHCbApp, CondDB
+from Configurables import MagFielSvcTester, LHCbApp, CondDB, DDDBConf
 from PRConfig import TestFileDB
 
 # - Algorithms
@@ -20,6 +20,7 @@ topalgs = [
 # Application manager
 app = LHCbApp(EvtMax=1)
 CondDB().Upgrade = True
+DDDBConf.GeometryBackend="DetDesc"
 
 ApplicationMgr(TopAlg=topalgs)
 TestFileDB.test_file_db['MiniBrunel_2018_MinBias_FTv4_DIGI'].run(
diff --git a/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt b/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt
index 3c5878d0..ede54a7d 100644
--- a/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt
+++ b/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt
@@ -24,7 +24,7 @@ ConditionPaths =  ["/dd/Conditions/Online/Velo/MotionSystem",
                    "/dd/Conditions/Alignment/Velo/VeloLeft",
                    "/dd/Conditions/Alignment/Velo/VeloRight"]
 
-DDDBConf() # detector description
+DDDBConf.GeometryBackend="DetDesc"
 CondDB().addLayer(os.path.join(os.environ.get('TEST_OVERLAY_ROOT',
                                               'Det/VeloDet/test/DB'),
                                'updates'))  # use local test DB
diff --git a/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt b/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt
index fe7e307f..66651928 100644
--- a/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt
+++ b/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt
@@ -28,7 +28,7 @@ ConditionPaths =  ["/dd/Conditions/Online/Velo/MotionSystem",
                    "/dd/Conditions/Alignment/Velo/VeloLeft",
                    "/dd/Conditions/Alignment/Velo/VeloRight"]
 
-DDDBConf() # detector description
+DDDBConf.GeometryBackend="DetDesc" #detector description
 CondDB().addLayer(os.path.join(os.environ.get('TEST_OVERLAY_ROOT',
                                               'Det/VeloDet/test/DB'),
                                'updates'))  # use local test DB
diff --git a/Det/VPDet/tests/scripts/VeloAlignmentTest.py b/Det/VPDet/tests/scripts/VeloAlignmentTest.py
index b9a86e9f..73084d76 100755
--- a/Det/VPDet/tests/scripts/VeloAlignmentTest.py
+++ b/Det/VPDet/tests/scripts/VeloAlignmentTest.py
@@ -40,7 +40,7 @@ def configure(use_case="simple"):
     import Gaudi.Configuration
     from Configurables import (ApplicationMgr, MessageSvc, DDDBConf, CondDB,
                                UpdateManagerSvc)
-    DDDBConf()  # detector description
+    DDDBConf.GeometryBackend="DetDesc"
     CondDB().addLayer(
         os.path.join(
             os.environ.get('TEST_OVERLAY_ROOT', 'Det/VeloDet/test/DB'),
diff --git a/Tools/GitEntityResolver/tests/qmtest/gitentityresolver.qms/run_stamp.qmt b/Tools/GitEntityResolver/tests/qmtest/gitentityresolver.qms/run_stamp.qmt
index 401ae4b3..6cb17e5c 100644
--- a/Tools/GitEntityResolver/tests/qmtest/gitentityresolver.qms/run_stamp.qmt
+++ b/Tools/GitEntityResolver/tests/qmtest/gitentityresolver.qms/run_stamp.qmt
@@ -33,7 +33,7 @@ ecs.EventTimeDecoder.TimeStep = 24 * 60 * 60 * 1000000000 # 1 day
 ecs.EventTimeDecoder.StartRun = 100
 ecs.EventTimeDecoder.EventsPerRun = 1
 
-DDDBConf(EnableRunStampCheck=True)
+DDDBConf(EnableRunStampCheck=True,GeometryBackend='DetDesc')
 
 RunStampCheck(OutputLevel=DEBUG,
               ValidRunsList='git://valid_runs.txt')
-- 
GitLab


From ebd8ea2304c7df52822b8f92641d0162bc0bf520 Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Wed, 17 Apr 2024 12:01:37 +0000
Subject: [PATCH 06/10] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Run2Support/-/jobs/38101588
---
 Det/DetCond/tests/options/begin_event_no_reserve.py         | 6 +++++-
 .../tests/options/begin_event_no_reserve_sharedcond.py      | 6 +++++-
 Det/DetCond/tests/options/detdesc_cond_as_json.py           | 6 +++++-
 Det/DetCond/tests/options/detdesc_cond_as_yaml.py           | 6 +++++-
 Det/DetCond/tests/options/detdesc_cond_no_prop.py           | 6 +++++-
 Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py      | 2 +-
 Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py    | 2 +-
 Det/DetDescChecks/python/DetDescChecks/Options.py           | 3 +--
 Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py       | 2 +-
 Det/Magnet/tests/options/test_demagnet.py                   | 2 +-
 Det/Magnet/tests/options/test_magfieldsvc.py                | 2 +-
 Det/VPDet/tests/scripts/VeloAlignmentTest.py                | 2 +-
 12 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/Det/DetCond/tests/options/begin_event_no_reserve.py b/Det/DetCond/tests/options/begin_event_no_reserve.py
index 679fbd67..3376b260 100644
--- a/Det/DetCond/tests/options/begin_event_no_reserve.py
+++ b/Det/DetCond/tests/options/begin_event_no_reserve.py
@@ -19,7 +19,11 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
+DDDBConf(
+    DataType='2016',
+    DbRoot='git:/lhcb.xml',
+    EnableRunStampCheck=False,
+    GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetCond/tests/options/begin_event_no_reserve_sharedcond.py b/Det/DetCond/tests/options/begin_event_no_reserve_sharedcond.py
index d0244f79..4a76ba4a 100644
--- a/Det/DetCond/tests/options/begin_event_no_reserve_sharedcond.py
+++ b/Det/DetCond/tests/options/begin_event_no_reserve_sharedcond.py
@@ -19,7 +19,11 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
+DDDBConf(
+    DataType='2016',
+    DbRoot='git:/lhcb.xml',
+    EnableRunStampCheck=False,
+    GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetCond/tests/options/detdesc_cond_as_json.py b/Det/DetCond/tests/options/detdesc_cond_as_json.py
index da19dc29..3545a7d2 100644
--- a/Det/DetCond/tests/options/detdesc_cond_as_json.py
+++ b/Det/DetCond/tests/options/detdesc_cond_as_json.py
@@ -19,7 +19,11 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
+DDDBConf(
+    DataType='2016',
+    DbRoot='git:/lhcb.xml',
+    EnableRunStampCheck=False,
+    GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetCond/tests/options/detdesc_cond_as_yaml.py b/Det/DetCond/tests/options/detdesc_cond_as_yaml.py
index f41fe1bc..bc02e456 100644
--- a/Det/DetCond/tests/options/detdesc_cond_as_yaml.py
+++ b/Det/DetCond/tests/options/detdesc_cond_as_yaml.py
@@ -19,7 +19,11 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
+DDDBConf(
+    DataType='2016',
+    DbRoot='git:/lhcb.xml',
+    EnableRunStampCheck=False,
+    GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetCond/tests/options/detdesc_cond_no_prop.py b/Det/DetCond/tests/options/detdesc_cond_no_prop.py
index 4462f2a7..a61bfa18 100644
--- a/Det/DetCond/tests/options/detdesc_cond_no_prop.py
+++ b/Det/DetCond/tests/options/detdesc_cond_no_prop.py
@@ -19,7 +19,11 @@ from Configurables import CondDB, DDDBConf, GitEntityResolver
 GitEntityResolver(
     'GitDDDB',
     PathToRepository=os.path.join(os.environ.get('TEST_DBS_ROOT'), 'TESTCOND'))
-DDDBConf(DataType='2016', DbRoot='git:/lhcb.xml', EnableRunStampCheck=False,GeometryBackend='DetDesc')
+DDDBConf(
+    DataType='2016',
+    DbRoot='git:/lhcb.xml',
+    EnableRunStampCheck=False,
+    GeometryBackend='DetDesc')
 CondDB(Tags={'DDDB': ''})
 
 
diff --git a/Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py b/Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py
index 345dff04..93ff3f4b 100755
--- a/Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py
+++ b/Det/DetDescChecks/python/DetDescChecks/CheckOverlap.py
@@ -28,7 +28,7 @@ __version__ = '1.1'
 from Gaudi.Configuration import *
 
 from Configurables import DDDBConf
-DDDBConf(DataType='2015',GeometryBackend='DetDesc')
+DDDBConf(DataType='2015', GeometryBackend='DetDesc')
 
 from Configurables import DetDesc__CheckOverlap
 
diff --git a/Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py b/Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py
index e3ab318a..3534d6fd 100755
--- a/Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py
+++ b/Det/DetDescChecks/python/DetDescChecks/MaterialBudget.py
@@ -28,7 +28,7 @@ __version__ = '1.1'
 from Gaudi.Configuration import *
 
 from Configurables import DDDBConf
-DDDBConf(DataType='2015',GeometryBackend='DetDesc')
+DDDBConf(DataType='2015', GeometryBackend='DetDesc')
 
 from Configurables import DetDesc__MaterialBudget
 
diff --git a/Det/DetDescChecks/python/DetDescChecks/Options.py b/Det/DetDescChecks/python/DetDescChecks/Options.py
index b01900b4..e77afdad 100644
--- a/Det/DetDescChecks/python/DetDescChecks/Options.py
+++ b/Det/DetDescChecks/python/DetDescChecks/Options.py
@@ -24,8 +24,7 @@ def LoadDDDBTest(datatype, sim=False, paths=None):
         Simulation=sim,
         IgnoreHeartBeat=True,
         EnableRunStampCheck=False,
-        GeometryBackend='DetDesc'
-        )
+        GeometryBackend='DetDesc')
     # Set up conditions database configuration (ignore checks for up-to-date)
     CondDB(
         Upgrade=datatype == "Upgrade", LatestGlobalTagByDataTypes=[datatype])
diff --git a/Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py b/Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py
index 6bd12bcf..41b1f08f 100755
--- a/Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py
+++ b/Det/DetDescChecks/python/DetDescChecks/VolumeCheck.py
@@ -28,7 +28,7 @@ __version__ = '1.1'
 from Gaudi.Configuration import *
 
 from Configurables import DDDBConf
-DDDBConf(DataType='2015',GeometryBackend='DetDesc')
+DDDBConf(DataType='2015', GeometryBackend='DetDesc')
 
 from Configurables import DetDesc__VolumeCheck
 
diff --git a/Det/Magnet/tests/options/test_demagnet.py b/Det/Magnet/tests/options/test_demagnet.py
index a23c1647..8396acb5 100644
--- a/Det/Magnet/tests/options/test_demagnet.py
+++ b/Det/Magnet/tests/options/test_demagnet.py
@@ -23,7 +23,7 @@ from Configurables import LHCbApp, MagneticFieldSvc
 LHCbApp().DataType = "Upgrade"
 LHCbApp().Simulation = True
 CondDB().Upgrade = True
-DDDBConf.GeometryBackend="DetDesc"
+DDDBConf.GeometryBackend = "DetDesc"
 app.ExtSvc += [MagneticFieldSvc()]
 
 # Configure fake run number
diff --git a/Det/Magnet/tests/options/test_magfieldsvc.py b/Det/Magnet/tests/options/test_magfieldsvc.py
index b0ae540a..8fbc300b 100644
--- a/Det/Magnet/tests/options/test_magfieldsvc.py
+++ b/Det/Magnet/tests/options/test_magfieldsvc.py
@@ -20,7 +20,7 @@ topalgs = [
 # Application manager
 app = LHCbApp(EvtMax=1)
 CondDB().Upgrade = True
-DDDBConf.GeometryBackend="DetDesc"
+DDDBConf.GeometryBackend = "DetDesc"
 
 ApplicationMgr(TopAlg=topalgs)
 TestFileDB.test_file_db['MiniBrunel_2018_MinBias_FTv4_DIGI'].run(
diff --git a/Det/VPDet/tests/scripts/VeloAlignmentTest.py b/Det/VPDet/tests/scripts/VeloAlignmentTest.py
index 73084d76..eec27725 100755
--- a/Det/VPDet/tests/scripts/VeloAlignmentTest.py
+++ b/Det/VPDet/tests/scripts/VeloAlignmentTest.py
@@ -40,7 +40,7 @@ def configure(use_case="simple"):
     import Gaudi.Configuration
     from Configurables import (ApplicationMgr, MessageSvc, DDDBConf, CondDB,
                                UpdateManagerSvc)
-    DDDBConf.GeometryBackend="DetDesc"
+    DDDBConf.GeometryBackend = "DetDesc"
     CondDB().addLayer(
         os.path.join(
             os.environ.get('TEST_OVERLAY_ROOT', 'Det/VeloDet/test/DB'),
-- 
GitLab


From fe429ee25606f3dc4586cd02fc81febd3eb798f7 Mon Sep 17 00:00:00 2001
From: Menglin Xu <mexu@lblhcbpr10.cern.ch>
Date: Wed, 17 Apr 2024 15:00:22 +0200
Subject: [PATCH 07/10] speicial GeometryBackend at more places..

---
 Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt  | 2 +-
 .../tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt   | 2 +-
 Det/VPDet/tests/scripts/VeloAlignmentTest.py                    | 2 +-
 .../tests/qmtest/velodet.qms/veloaligncond.qms/updates.qmt      | 2 +-
 Det/VeloDet/tests/scripts/VeloAlignmentTest.py                  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt b/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt
index ede54a7d..acfe1161 100644
--- a/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt
+++ b/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates.qmt
@@ -24,7 +24,7 @@ ConditionPaths =  ["/dd/Conditions/Online/Velo/MotionSystem",
                    "/dd/Conditions/Alignment/Velo/VeloLeft",
                    "/dd/Conditions/Alignment/Velo/VeloRight"]
 
-DDDBConf.GeometryBackend="DetDesc"
+DDDBConf(GeometryBackend="DetDesc") # detector description
 CondDB().addLayer(os.path.join(os.environ.get('TEST_OVERLAY_ROOT',
                                               'Det/VeloDet/test/DB'),
                                'updates'))  # use local test DB
diff --git a/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt b/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt
index 66651928..7a908006 100644
--- a/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt
+++ b/Det/VPDet/tests/qmtest/vpdet.qms/veloaligncond.qms/updates_yaml.qmt
@@ -28,7 +28,7 @@ ConditionPaths =  ["/dd/Conditions/Online/Velo/MotionSystem",
                    "/dd/Conditions/Alignment/Velo/VeloLeft",
                    "/dd/Conditions/Alignment/Velo/VeloRight"]
 
-DDDBConf.GeometryBackend="DetDesc" #detector description
+DDDBConf(GeometryBackend="DetDesc") #detector description
 CondDB().addLayer(os.path.join(os.environ.get('TEST_OVERLAY_ROOT',
                                               'Det/VeloDet/test/DB'),
                                'updates'))  # use local test DB
diff --git a/Det/VPDet/tests/scripts/VeloAlignmentTest.py b/Det/VPDet/tests/scripts/VeloAlignmentTest.py
index eec27725..0748e72a 100755
--- a/Det/VPDet/tests/scripts/VeloAlignmentTest.py
+++ b/Det/VPDet/tests/scripts/VeloAlignmentTest.py
@@ -40,7 +40,7 @@ def configure(use_case="simple"):
     import Gaudi.Configuration
     from Configurables import (ApplicationMgr, MessageSvc, DDDBConf, CondDB,
                                UpdateManagerSvc)
-    DDDBConf.GeometryBackend = "DetDesc"
+    DDDBConf(GeometryBackend = "DetDesc") # detector description
     CondDB().addLayer(
         os.path.join(
             os.environ.get('TEST_OVERLAY_ROOT', 'Det/VeloDet/test/DB'),
diff --git a/Det/VeloDet/tests/qmtest/velodet.qms/veloaligncond.qms/updates.qmt b/Det/VeloDet/tests/qmtest/velodet.qms/veloaligncond.qms/updates.qmt
index 67098c13..926ceb14 100644
--- a/Det/VeloDet/tests/qmtest/velodet.qms/veloaligncond.qms/updates.qmt
+++ b/Det/VeloDet/tests/qmtest/velodet.qms/veloaligncond.qms/updates.qmt
@@ -24,7 +24,7 @@ ConditionPaths =  ["/dd/Conditions/Online/Velo/MotionSystem",
                    "/dd/Conditions/Alignment/Velo/VeloLeft",
                    "/dd/Conditions/Alignment/Velo/VeloRight"]
 
-DDDBConf() # detector description
+DDDBConf(GeometryBackend='DetDesc') # detector description
 CondDB().addLayer(os.path.join(os.environ.get('TEST_OVERLAY_ROOT',
                                               'Det/VeloDet/test/DB'),
                                'updates'))  # use local test DB
diff --git a/Det/VeloDet/tests/scripts/VeloAlignmentTest.py b/Det/VeloDet/tests/scripts/VeloAlignmentTest.py
index 2efb3241..ebef5b10 100755
--- a/Det/VeloDet/tests/scripts/VeloAlignmentTest.py
+++ b/Det/VeloDet/tests/scripts/VeloAlignmentTest.py
@@ -40,7 +40,7 @@ def configure(use_case="simple"):
     import Gaudi.Configuration
     from Configurables import (ApplicationMgr, MessageSvc, DDDBConf, CondDB,
                                UpdateManagerSvc)
-    DDDBConf()  # detector description
+    DDDBConf(GeometryBackend='DetDesc')  # detector description
     CondDB().addLayer(
         os.path.join(
             os.environ.get('TEST_OVERLAY_ROOT', 'Det/VeloDet/test/DB'),
-- 
GitLab


From 4c0dc5a2556b8768c938b46fa4c632f495c5bf2e Mon Sep 17 00:00:00 2001
From: Gitlab CI <noreply@cern.ch>
Date: Wed, 17 Apr 2024 13:00:40 +0000
Subject: [PATCH 08/10] Fixed formatting

patch generated by https://gitlab.cern.ch/lhcb/Run2Support/-/jobs/38105845
---
 Det/VPDet/tests/scripts/VeloAlignmentTest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Det/VPDet/tests/scripts/VeloAlignmentTest.py b/Det/VPDet/tests/scripts/VeloAlignmentTest.py
index 0748e72a..193fcb5d 100755
--- a/Det/VPDet/tests/scripts/VeloAlignmentTest.py
+++ b/Det/VPDet/tests/scripts/VeloAlignmentTest.py
@@ -40,7 +40,7 @@ def configure(use_case="simple"):
     import Gaudi.Configuration
     from Configurables import (ApplicationMgr, MessageSvc, DDDBConf, CondDB,
                                UpdateManagerSvc)
-    DDDBConf(GeometryBackend = "DetDesc") # detector description
+    DDDBConf(GeometryBackend="DetDesc")  # detector description
     CondDB().addLayer(
         os.path.join(
             os.environ.get('TEST_OVERLAY_ROOT', 'Det/VeloDet/test/DB'),
-- 
GitLab


From c8e4ed54e914a022942e6a995faceb475eb7d013 Mon Sep 17 00:00:00 2001
From: Menglin Xu <mexu@lblhcbpr10.cern.ch>
Date: Fri, 19 Apr 2024 16:05:51 +0200
Subject: [PATCH 09/10] keep the exactly same setting with LHCb

---
 Det/DDDB/CMakeLists.txt               |  16 ++--
 Det/DDDB/python/DDDB/Configuration.py | 108 +++++++++++++++++++++++---
 2 files changed, 110 insertions(+), 14 deletions(-)

diff --git a/Det/DDDB/CMakeLists.txt b/Det/DDDB/CMakeLists.txt
index 9895c748..cb4ee3f9 100644
--- a/Det/DDDB/CMakeLists.txt
+++ b/Det/DDDB/CMakeLists.txt
@@ -16,13 +16,19 @@ Det/DDDB
 set(DD4HEP_PYTHON_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/python/DDDB/CheckDD4Hep.py)
 set_property(TARGET target_runtime_paths
     APPEND PROPERTY runtime_pythonpath $<SHELL_PATH:${CMAKE_CURRENT_BINARY_DIR}/python>)
+if (USE_DD4HEP)
+    file(WRITE ${DD4HEP_PYTHON_FILENAME} "UseDD4Hep = True")
+else()
+    file(WRITE ${DD4HEP_PYTHON_FILENAME} "UseDD4Hep = False")
+endif()
 install(FILES ${DD4HEP_PYTHON_FILENAME} DESTINATION python/DDDB)
-file(WRITE ${DD4HEP_PYTHON_FILENAME} "UseDD4Hep = False")
 
 gaudi_install(PYTHON)
 gaudi_generate_confuserdb()
 
-lhcb_add_confuser_dependencies(
-    Tools/GitEntityResolver:GitEntityResolver
-    Tools/XmlTools:XmlTools
-)
+if (NOT USE_DD4HEP)
+    lhcb_add_confuser_dependencies(
+        Tools/GitEntityResolver:GitEntityResolver
+        Tools/XmlTools:XmlTools
+    )
+endif()
diff --git a/Det/DDDB/python/DDDB/Configuration.py b/Det/DDDB/python/DDDB/Configuration.py
index 11fbe899..5ed21849 100755
--- a/Det/DDDB/python/DDDB/Configuration.py
+++ b/Det/DDDB/python/DDDB/Configuration.py
@@ -21,11 +21,13 @@ import os
 
 from datetime import datetime, timedelta
 
+from DDDB.CheckDD4Hep import UseDD4Hep
 from Gaudi.Configuration import *
 
-from DetCond.Configuration import CondDB
-from Configurables import (XmlCnvSvc, XmlParserSvc, EntityResolverDispatcher,
-                           GitEntityResolver)
+if not UseDD4Hep:
+    from DetCond.Configuration import CondDB
+    from Configurables import (XmlCnvSvc, XmlParserSvc,
+                               EntityResolverDispatcher, GitEntityResolver)
 
 GIT_CONDDBS = {}
 
@@ -90,9 +92,11 @@ class DDDBConf(ConfigurableUser):
         "GeometryLocation":
         "",
         "GeometryVersion":
-        "trunk",
+        "run3/trunk",
         "GeometryMain":
         "LHCb.xml",
+        "GeometryBackend":
+        "DD4Hep" if UseDD4Hep else "DetDesc",
         "ConditionsLocation":
         "",
         "DD4HepDetectorList": [
@@ -106,7 +110,7 @@ class DDDBConf(ConfigurableUser):
         'DbRoot':
         """ Root file of the detector description """,
         'DataType':
-        """ Symbolic name for the data type. Allowed values: ["2023", "2022", "2018", "2017", "2016", "2015", "2013", "2012", "2011", "2010", "2009","2008","Upgrade"] """,
+        """ Symbolic name for the data type. Allowed values: ["2024", "2023", "2022", "2018", "2017", "2016", "2015", "2013", "2012", "2011", "2010", "2009", "2008", "Run3", "Upgrade"] """,
         'Simulation':
         """ Boolean flag to select the simulation or real-data configuration """,
         'InitialTime':
@@ -123,18 +127,88 @@ class DDDBConf(ConfigurableUser):
         """ Version of the DD4hep geometry that should be used """,
         'GeometryMain':
         """ Main compact file to be loaded """,
+        'GeometryBackend':
+        """ Backend to be used for the geometry, must be DD4Hep or DetDesc """,
         'ConditionsLocation':
         "Location of the conditions repository (lookup from CMAKE_PREFIX_PATH if not specified)",
         'ConditionsVersion':
         """ Tag for the conditions database """,
     }
-
-    __used_configurables__ = [CondDB]
-
+    __used_configurables__ = [] if UseDD4Hep else [CondDB] 
     def __apply_configuration__(self):
         """
         Converts the high-level information passed as properties into low-level configuration.
         """
+        assert self.getProp("GeometryBackend") in (
+            "DetDesc",
+            "DD4Hep"), "GeometryBackend has to be one of 'DetDesc' or 'DD4Hep'"
+        backend = self.getProp("GeometryBackend")
+        ##########################################################################
+        # DD4hep Detector Configuration
+        ##########################################################################
+        ##########################################################################
+        if backend == "DD4Hep":
+            from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
+            dd4hepSvc = DD4hepSvc()
+
+            if self.getProp(
+                    "GeometryLocation"
+            ) and not dd4hepSvc.isPropertySet("GeometryLocation"):
+                dd4hepSvc.GeometryLocation = self.getProp("GeometryLocation")
+
+            if self.getProp("GeometryVersion") and not dd4hepSvc.isPropertySet(
+                    "GeometryVersion"):
+                dd4hepSvc.GeometryVersion = self.getProp("GeometryVersion")
+
+            if self.getProp("GeometryMain"
+                            ) and not dd4hepSvc.isPropertySet("GeometryMain"):
+                dd4hepSvc.GeometryMain = self.getProp("GeometryMain")
+
+            if self.getProp(
+                    "ConditionsVersion"
+            ) and not dd4hepSvc.isPropertySet("ConditionsVersion"):
+                dd4hepSvc.ConditionsVersion = self.getProp("ConditionsVersion")
+
+            if self.getProp(
+                    "ConditionsLocation"
+            ) and not dd4hepSvc.isPropertySet("ConditionsLocation"):
+                dd4hepSvc.ConditionsLocation = self.getProp(
+                    "ConditionsLocation")
+            else:
+                if not hasattr(dd4hepSvc, "ConditionsLocation"):
+                    lhcb_cond_db = GIT_CONDDBS.get("lhcb-conditions-database",
+                                                   None)
+                    if not lhcb_cond_db:
+                        log.warning(
+                            "Could not find git repository: lhcb-conditions-database"
+                        )
+                    else:
+                        url = "git:" + lhcb_cond_db
+                        if (not lhcb_cond_db.endswith(".git")):
+                            url = "file:" + lhcb_cond_db + "/"
+                        log.info("Using git repository: " + url)
+                        dd4hepSvc.ConditionsLocation = url
+
+            if self.getProp("DD4HepDetectorList"):
+                if not hasattr(dd4hepSvc, "DetectorList"):
+                    dd4hepSvc.DetectorList = self.getProp("DD4HepDetectorList")
+
+            log.info(dd4hepSvc)
+
+            # make sure we do not use HeartBeat and RunStampCheck in DD4hep mode
+            self._properties["IgnoreHeartBeat"].setDefault(True)
+            self._properties["EnableRunStampCheck"].setDefault(False)
+
+            # FIXME: We need to find a way to configure LHCb__ParticlePropertySvc for Run3
+            from Configurables import LHCb__ParticlePropertySvc
+            pps = LHCb__ParticlePropertySvc()
+            if not pps.isPropertySet("ParticlePropertiesFile"):
+                from PartProp import DEFAULT_PARTICLE_PROPERTY_FILE
+                pps.ParticlePropertiesFile = str(
+                    DEFAULT_PARTICLE_PROPERTY_FILE)
+
+            return  # everything else in this function is about using the old CondDB
+
         ##########################################################################
         # Detector Transient Store Configuration
         ##########################################################################
@@ -243,7 +317,8 @@ class DDDBConf(ConfigurableUser):
         # by default, use the latest DQFLAGS tag for the requested data type
         # (unless already set by a data type handler)
         if not self.getProp("Simulation") and dataType not in ("Upgrade",
-                                                               "2022", "2023"):
+                                                               "2022", "2023",
+                                                               "2024", "Run3"):
             self.__set_tag__(["DQFLAGS"], "<latest:{0}>".format(dataType))
 
         # Get particle properties table from condDB
@@ -311,6 +386,13 @@ class DDDBConf(ConfigurableUser):
                 "EventClockSvc().InitialTime already set to %s UTC (requested %s UTC)",
                 t.isoformat(), utcDatetime.isoformat())
 
+    def __2024_conf__(self):
+        """
+        Default configuration for 2024 data
+        to be updated after final configuration is taken
+        """
+        pass
+
     def __2023_conf__(self):
         """
         Default configuration for 2023 data
@@ -445,6 +527,12 @@ class DDDBConf(ConfigurableUser):
         else:
             self.__set_tag__(["SIMCOND"], "sim-20090212")
 
+    def __Run3_conf__(self):
+        """
+        Default database for Run3 MonteCarlo production and analysis
+        """
+        pass  # nothing special here
+
     def __Upgrade_conf__(self):
         """
         Default database for Upgrade MonteCarlo production and analysis
@@ -452,6 +540,7 @@ class DDDBConf(ConfigurableUser):
         pass  # nothing special here
 
     __data_types_handlers__ = {
+        "2024": __2024_conf__,
         "2023": __2023_conf__,
         "2022": __2022_conf__,
         "2018": __2018_conf__,
@@ -464,5 +553,6 @@ class DDDBConf(ConfigurableUser):
         "2010": __2010_conf__,
         "2009": __2009_conf__,
         "2008": __2008_conf__,
+        "Run3": __Run3_conf__,
         "Upgrade": __Upgrade_conf__
     }
-- 
GitLab


From 08e6f284d5afad29eba799c04a87508ae3e36415 Mon Sep 17 00:00:00 2001
From: Menglin Xu <mexu@lblhcbpr10.cern.ch>
Date: Fri, 19 Apr 2024 18:29:50 +0200
Subject: [PATCH 10/10] synchronize from LHCb project

---
 Det/DDDB/CMakeLists.txt                     | 10 ++++------
 Det/DDDB/python/DDDB/Configuration.py       | 14 ++++++++++----
 Det/DetCond/python/DetCond/Configuration.py | 11 ++++++++++-
 3 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/Det/DDDB/CMakeLists.txt b/Det/DDDB/CMakeLists.txt
index cb4ee3f9..2aa89a5d 100644
--- a/Det/DDDB/CMakeLists.txt
+++ b/Det/DDDB/CMakeLists.txt
@@ -26,9 +26,7 @@ install(FILES ${DD4HEP_PYTHON_FILENAME} DESTINATION python/DDDB)
 gaudi_install(PYTHON)
 gaudi_generate_confuserdb()
 
-if (NOT USE_DD4HEP)
-    lhcb_add_confuser_dependencies(
-        Tools/GitEntityResolver:GitEntityResolver
-        Tools/XmlTools:XmlTools
-    )
-endif()
+lhcb_add_confuser_dependencies(
+    Tools/GitEntityResolver:GitEntityResolver
+    Tools/XmlTools:XmlTools
+)
diff --git a/Det/DDDB/python/DDDB/Configuration.py b/Det/DDDB/python/DDDB/Configuration.py
index 5ed21849..93dac91b 100755
--- a/Det/DDDB/python/DDDB/Configuration.py
+++ b/Det/DDDB/python/DDDB/Configuration.py
@@ -24,10 +24,16 @@ from datetime import datetime, timedelta
 from DDDB.CheckDD4Hep import UseDD4Hep
 from Gaudi.Configuration import *
 
-if not UseDD4Hep:
+try:
     from DetCond.Configuration import CondDB
     from Configurables import (XmlCnvSvc, XmlParserSvc,
                                EntityResolverDispatcher, GitEntityResolver)
+except ImportError:
+    from GaudiKernel.Configurable import ConfigurableUser
+
+    class CondDB(ConfigurableUser):
+        pass
+
 
 GIT_CONDDBS = {}
 
@@ -134,7 +140,8 @@ class DDDBConf(ConfigurableUser):
         'ConditionsVersion':
         """ Tag for the conditions database """,
     }
-    __used_configurables__ = [] if UseDD4Hep else [CondDB] 
+    __used_configurables__ = [CondDB]
+
     def __apply_configuration__(self):
         """
         Converts the high-level information passed as properties into low-level configuration.
@@ -142,12 +149,11 @@ class DDDBConf(ConfigurableUser):
         assert self.getProp("GeometryBackend") in (
             "DetDesc",
             "DD4Hep"), "GeometryBackend has to be one of 'DetDesc' or 'DD4Hep'"
-        backend = self.getProp("GeometryBackend")
         ##########################################################################
         # DD4hep Detector Configuration
         ##########################################################################
         ##########################################################################
-        if backend == "DD4Hep":
+        if self.getProp("GeometryBackend") == "DD4Hep":
             from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
             dd4hepSvc = DD4hepSvc()
 
diff --git a/Det/DetCond/python/DetCond/Configuration.py b/Det/DetCond/python/DetCond/Configuration.py
index cddd2301..d9df3349 100644
--- a/Det/DetCond/python/DetCond/Configuration.py
+++ b/Det/DetCond/python/DetCond/Configuration.py
@@ -17,6 +17,8 @@ from Gaudi.Configuration import (allConfigurables, ConfigurableUser,
                                  getConfigurable, log)
 from Configurables import ApplicationMgr
 
+from DDDB.CheckDD4Hep import UseDD4Hep
+
 import os
 import re
 
@@ -50,6 +52,7 @@ class CondDB(ConfigurableUser):
         "QueryGranularity": 0,
         'AllLocalTagsByDataType': [],
         'LocalTags': {},
+        "GeometryBackend": "DD4Hep" if UseDD4Hep else "DetDesc",
     }
     _propertyDocDct = {
         'Tags':
@@ -77,6 +80,8 @@ class CondDB(ConfigurableUser):
         '[[deprecated]] Local tags not supported by Git CondDB',
         'LocalTags':
         '[[deprecated]] Local tags not supported by Git CondDB',
+        'GeometryBackend':
+        """ Backend to be used for the geometry, must be DD4Hep or DetDesc """
     }
 
     def addOverlay(self, path):
@@ -207,7 +212,11 @@ class CondDB(ConfigurableUser):
                 'ToolSvc.GitONLINE'].LimitToLastCommitTime = not self.getProp(
                     "IgnoreHeartBeat")
 
-        if not (self.getProp("Online") or self.getProp("Simulation")):
+        assert self.getProp("GeometryBackend") in (
+            "DetDesc",
+            "DD4Hep"), "GeometryBackend has to be one of 'DetDesc' or 'DD4Hep'"
+        if not (self.getProp("Online") or self.getProp("Simulation")
+                or self.getProp("GeometryBackend") == "DD4Hep"):
             self._properties["EnableRunStampCheck"].setDefault(True)
         if self.getProp("EnableRunStampCheck"):
             from Configurables import RunStampCheck
-- 
GitLab