Geometry description and Conditions (DDDB and CondDB)


This page collects all information about the geometry description and conditions of the BGV detector.

The Detector Description in Gaudi (see Chapter 8 of the Gaudi User Guide) encompasses the structure, geometry, material and other properties of the detector or any other element of the given setup. In practice, clear distinction is made between the following parts of the Detector Description:

  • Geometry description, i.e. structure, geometry and material of all objects (sensitive or not) making up a given detector setup. Sometimes we will refer to this part as DDDB, Detector Description Database (this is just an alias; strictly speaking it is not a "correct" alias, because the "detector description" includes all properties not only the geometry-related ones, and because the implementation can be with xml files and not necessarily with a database)
  • Conditions, i.e. constant or time-varying properties related to the detector or its surrounding (e.g. ModuleID - TELL1 mapping, module spatial alignment constants, detector channel pedestals, temperature in the tunnel, etc.). Sometimes we will refer to this part as CondDB. It is possible the experiment control system to generate conditions Online, and store them in dedicated files

It is possible to use two different forms/implementations for the DDDB and CondDB:

  • A tree of xml files : nested folders with arbitrary structure and with xml files containing the actual information
  • An SQLite database file
The xml-tree implementation has the advantage that one can easily see and browse the structure. On the other hand, the database implementation is more space efficient and facilitates the management of multiple versions (tags and intervals of validity). Unlike the xml-tree, the SQLite file can contain many versions of the conditions tree (the values, parameters and structure can change between the different versions).

Usually different partitions (branches in the main Detector Description tree) are stored in separate database files. The following is used/planned for the BGV:

  • DDDB.db : geometry description
  • BGVCOND.db : offline detector conditions
  • ONLINE.db : conditions generated online / ECS

Documentation, Tutorials and Tips


Slides at BGV #52 Basic introduction (BGV point of view)

LHCb TWiki pages

LHCb.CondDBPages Main page of the LHCb Conditions Database
LHCb.CondDBHowTo Conditions Database How-To
LHCb.CondDBManagement CondDB manager pages


  • DB Partition : the various Conditions are grouped in separate "partitions" according to the their type. E.g. the DDDB partition contains all geometry description data, the BGVCOND partition -- all offline detector Conditions. By LHCb convention, each .db file contains a single partition.
  • DB Node : Folder or FolderSet in the .db tree. See
  • Tag : A label used to reference a specific version of a Condition or a Node in the database
  • Interval of validity : The time period over which a given Condition is valid
  • The image below is helpful to understand the concepts tag and interval-of-validity (for details see Chapter 8 of the Gaudi User Guide)
    • The axis "Data Item" signifies the various Conditions
    • The axis "Version" shows the tag
    • The axis "Time" shows the time intervals where the Conditions have defined values
    • For a given tag, one Condition can have different values (different intervals of validity)
    • For a specific time, there can be several concurrent tags. Therefore the tag must be specified (in practice one can specify one global tag which is linked to specific tags of the Conditions)

Various tasks

  • Explore and edit SQLite .db files . There are two possible ways:

  • Convert between xml file tree and SQLite db
    • Use the existing LHCb software tools
    • The conversion "db --> xml tree" is called "making a snapshot"
      • One can extract any part of the Conditions tree: a single Condition or any Node (branch) of the tree
      • The xml files contain a single version of the conditions, so one needs to specify the version ("tag") and the reference time (or interval of validity)
      • More details and examples can found on this LHCb page
    • The conversion "xml tree --> db" is done with the command (requires SetupProject LHCb)
      • E.g. -c sqlite_file:BGVCOND.db/BGVCOND -s BGVCOND

Code examples

  • Create a Condition (one xml file), store it in a SQLite db and create a new global tag
    • An example script can be found here: /afs/
      • Pickle files are used to load the pedestal values (this part needs to be modified in order to run the script)
      • A xml file is created for the Pedestal conditions
      • The last two lines (which are commented) can be used to store the new conditions in the SQLite db and to create a global tag of the current state of the DB
    • The file README in the same folder contains example commands (shell and python) for working with Conditions
    • For similar or different examples, check the LHCb Vetra project:
    • More examples can be found here:
      • E.g. src/PopulateDB.cpp and python/

  • Job options to override a Condition in a Gaudi job
    • In a Gaudi job it is possible to override a Condition (e.g. one wants to run a test job with a different value for this condition)
    • More details and an example can be seen here
    • A specific BGV example (very similar to the example above) can be seen here

Usage in BGV

The official BGV SQLite .db files will be stored here: /afs/

  • DDDB.db and BGVCOND.db are the files to be used by all standard BGV jobs
  • To minimize the risk for errors when making modifications to the .db files, it is required to work with backup versions ( Define a procedure )

The release notes for the .db files will be stored on this TWiki page (see the section "Development and releases" below).

To use the official BGV .db files in a Gaudi job, add the following lines in your job options:

from Gaudi.Configuration  import *
from Configurables import CondDB
# Set the tags for geometry and conditions (change tags as needed)
CondDB ().Tags["DDDB"] = "" # default tag
CondDB ().Tags["LHCBCOND"] = "bgv-20160113" #pedestals from runs 1246 - 1252<span data-mce-mark="1">

When the geometry or conditions data are accessed by a Gaudi job, one gets the following info printout:

DDDB                 INFO Connected to database "sqlite_file:/afs/"
DDDB                 INFO Using TAG ""
LHCBCOND             INFO Connected to database "sqlite_file:/afs/"
LHCBCOND             INFO Using TAG "bgv-20160113"

Development and releases

Period Implementation of Detector geometry Implementation of Conditions
2016 -- DDDB.db BGVCOND.db
2012 -- 2015 A tree of xml files None

To-do: define a procedure for update of the DBs, backup, ...

== Latest ==

In the beginning of 2016 a transition was made to SQLite .db file implementation: the DDDB tree of xml files (svn rev. 95 of trunk/XmlDDDB) was converted to DDDB.db and a new BGVCOND.db was created.


Tag Date Comment
bgv-20160113 2016-01-13 Initial creation of BGVCOND.db. Created conditions:
Alignment: null parameters
Pedestal: 8*2048 values measured in runs 1246 - 1252 (each run with a single TELL1 active, bias=ON, to be confirmed)
bgv-20160503 2016-05-03 Pedestal: 8*2048 values measured in runs 1246 - 1252 are reordered.
PedestalRMS: 8*2048 added measured from run 1246 - 1252
bgv-20160510 2016-05-10 Headers: 8*512 values measured in runs 1246 - 1252. 128 first values are for headers combination [0,0], then [0,1] , [1,0] and [1,1].
bgv-20160616 2016-06-16 Values measured with run 1771 (HV off). Pedestals and Headers are reordered and inverted


Tag Date Comment
bgv-20160113 2016-01-13 Initial creation of DDDB.db using XmlDDDB (svn rev. 95)

== Old ==

From the beginning of the BGV project, up to the end of 2015, the detector geometry was implemented in a tree of xml files (see

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng Conditions_GUG.png r1 manage 13.4 K 2016-02-01 - 17:29 PlamenHopchev  
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r11 - 2016-06-22 - QuentinVeyrat
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    BGV All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback