Overview
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
Presentations
LHCb TWiki pages
Terms
- 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 https://twiki.cern.ch/twiki/bin/view/LHCb/CondDBBrowser#The_data_tree
- 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
copy_files_to_db.py (requires SetupProject LHCb )
- E.g.
copy_files_to_db.py -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/cern.ch/project/lhcbgv/sw/releases/SQLiteDB/scripts/example1/pedestal_create_condition.py
- 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: https://svnweb.cern.ch/trac/lhcb/browser/Vetra/trunk/Tell1/Vetra/python
- More examples can be found here: https://svnweb.cern.ch/trac/lhcb/browser/LHCb/trunk/Ex/DetCondExample
- E.g. src/PopulateDB.cpp and python/create_DBs.py
- 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/cern.ch/project/lhcbgv/sw/releases/SQLiteDB
- 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:
</span>
from Gaudi.Configuration import *
from Configurables import CondDB
importOptions("/afs/cern.ch/project/lhcbgv/sw/releases/SQLiteDB/options/SetBGVDB.py")
# 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/cern.ch/project/lhcbgv/sw/releases/SQLiteDB/DDDB.db/DDDB"
DDDB INFO Using TAG ""
LHCBCOND INFO Connected to database "sqlite_file:/afs/cern.ch/project/lhcbgv/sw/releases/SQLiteDB/BGVCOND.db/BGVCOND"
LHCBCOND INFO Using TAG "bgv-20160113"
Development and releases
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.
BGVCOND
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 |
DDDB
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 https://svnweb.cern.ch/cern/wsvn/bgv/sw/trunk/XmlDDDB).
|