Skip to content
Snippets Groups Projects

Draft: Remove use of DDDB when using DD4hep

Closed Gloria Corti requested to merge gcorti_handle_dd4hep into master
@@ -87,10 +87,12 @@ class DDDBConf(ConfigurableUser):
False,
"EnableRunStampCheck":
False,
"GeometryBackend":
"",
"GeometryLocation":
"",
"GeometryVersion":
"trunk",
"run3/trunk",
"GeometryMain":
"LHCb.xml",
"ConditionsLocation":
@@ -117,6 +119,8 @@ class DDDBConf(ConfigurableUser):
""" Disable check on latest update of ONLINE CondDB """,
'EnableRunStampCheck':
""" Enable the check for run stamp (valid data for the run) """,
'GeometryBackend':
""" Format of the geometry, i.e. DD4Hep or DetDesc, when empty it means not DD4Hep """,
'GeometryLocation':
""" Top directory for the DD4hep geometry files """,
'GeometryVersion':
@@ -129,6+133,6 @@
""" Tag for the conditions database """,
}
__used_configurables__ = [CondDB]
def __apply_configuration__(self):
"""
Converts the high-level information passed as properties into low-level configuration.
"""
##########################################################################
# 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
##########################################################################
Loading