Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

Detector structure

The Detector project contains the description of the LHCb geometry in DD4hep Compact XML format. It therefore depends on:

  • the DD4hep toolkit itself
  • ROOT, as the TGeo model is used to describe the geometry in memory
  • the GitCondDB library which allows loading conditions from a GitRepository

In order to ease geometry development and debugging, this project does not depend on Gaudi

Project structure

The LHCb geometry in Detector allows loading some detectors from GDML, some from CompactXML format. The description is in this project, with the following structure:

  • compact: The compatc XML description of detectors
  • src: The DD4hep C++ constructors needed to load the compact XML files
  • src_det: The C++ code for the detector elements

Compact XML and GDML

As it takes a long time to migrate the whole LHCb detector to DD4hep, an intermediary step was taken to load some sub-detectors from Compact XML, and some others from GDML, as exported from the LHCb DetDesc by the Gauss application. To load the descriptions, there are therefore two files that can be used with DD4hep:

  • LHCb.xml: loads everything from Compact plus the GDML subdetectors as specified in GdmlImports.xml.
  • LHCb-no-GDML.xml

Code structure

As mentioned above, the compact directory contains all the XML files needed for the detector description. The description can of course be structured according to the designers needs but it is normally composed of:

  • detector.xml: A file with the list of detectors and their readouts, in COmpactXML format (c.f. DD4hep documentation concerning syntax). It is good practice not to hardcode values in this description but to keep then ina parameters.xml file).
  • parameters.xml: All constants related to the description, for easier reuse between components.
  • visualization.xml: display parameters for the volumes in the detector
  • conditions.xml: Non mandatory. Defines which conditions should be applied (and with which reader). The conditions themselves are taken from another directory or the GitCondDB.

Developing and debugging the whole description is not practical, the debug subdirectory therefore contains scripts to build, test and display sub-detectors in isolation (e.g. VP.xml for the VP). The scripts directory contains scripts showing how to load, display and check for overlaps. See <HOWTO.md> for more recipes.

Geometry versioning

Versioning the geometry is critical, in order keep track of the evolution and improvements in the description of the detector. As the detector description is composed of both XML files and C++ contructors, each version of the Detector project shall be able to load any version of the LHCb geometry. For this prototype it was decided that:

  • the versioning of the XML files should be done by keeping the various versions in separate directories, in the compact directory. The default current branch is called trunk.
  • In each version of the compact files, a file called checksums should be added that contains the list of the top level volumes of the geometry tree, and the checksum of the associated sub-tree, as generated by the checksumGeo plugin (see <HOWTO.md>) for more information.
  • the C++ constructors should be versioned by including the version number in the name of the plugins as DD4hep provides no versioning functionality.

This of course means that we can never remove or alter old descriptions once they have been used in production.

Alignment and detector elements

Loading conditions is done using the GitCondDB library (which is therefore a dependency of Detector). See the ConditionsIOV directory for and example.

DD4hep design and development

see http://dd4hep.web.cern.ch/dd4hep/