This Wiki describes how to create a version of the LHCb Conditions Database (LHCBCOND.db) with misalignments applie to all tracking detector components. This version supports misalignments of the following detector elements (DE):

  • VELO
    • System, Half-System, Modules, and Phi Sensors

  • OT
    • System, Half-System, Stations, Half-Station, Layer, Half-layer, Module

  • IT
    • System, Station, Box, Layer, Ladder

  • TT
    • System, Station(TTa, TTb), Half-Station, Layer, Half-layer, Module, Half-Module

Note: Here, Half-System, Half-Station, Half-Layer refer to misalignments of the two halves, left and right of the beampipe, independently. A TT half-module refers to possible misalignment between the top and bottom halves of a TT module.

First, set up the Alignment Package:

  • setenvAlignment v2r1 (should also work with Alignment v2r2)
  • getpack -r AlignmentSys v2r1
  • getpack ALIGNMENT ALIGNMENT_v2r1
  • Unzip this file into the Alignment/ subdirectory:
  • cd MisAlignTools/v1r0/cmt
  • cmt config
  • source setup.csh
Now, go into the python directory, cd ../python, and note the following files of interest.

  • C-shell scripts
    • makeDB.csh - C shell script to misalign any number of detector elements; the output is a single LHCBCOND.db with the requested DE's misaligned
    • makeManyDBs.csh - C shell script to create many LHCBCONDB's; each DB has one element misaligned. (for special studies)

  • Python scripts
    • - main piece of code that is run.
    • - contains all the tools to perform the transformations for a given detector element tree.
    • - contains software level misalignments and parameters to control the program.
    • - contains hardware level misalignments and parameters to control the program.
    • - ROOT monitoring histograms of misalignments of the various detector elements listed above.

  • Options file
    • createMisAlignment.opts - options file, should share the same top level directory as the python scripts (e.g. topdir/opts/, topdir/python/).

One needs to set a soft link to either or That is:

  • ln -s, OR
  • ln -s

The first contains misalignment values indicative of misalignments after a full software alignment of the detector. The latter corresponds to misalignments at the hardware level (both of these are educated guesses only, not to be taken as precise)

In, you will find a number of parameters, such as:

  • misAlignOT, misAlignVelo, etc, which can be set to True or False. There are also switches which provide more control over which portions of these detectors are misaligned (e.g., misAlignOTModule = False).
  • xxxx_trans_scale and xxx_rot_scale are misalignment parameters (e.g., 1 sigma) for translations and rotations for each DE.
  • =randGen* tells the code what type of disrtibution to draw the random numbers from (e.g., 'gauss', 'flat', etc)
  • doTranslations and doRotations tell the code which degrees of freedom to misalign
  • constrainOTQuarters tells the code to give the same misalignment value to quarters 0&2 and to 1&3.

These run under the Alignment v2r1 project. The main piece of code is It is run using makeDB2.csh. Edit this file and leave the DE's uncommented if you want to misalign them.

To execute in csh:

  • ./makeDB.csh

  • The ouptut will be a new LHCBCOND.db in the current working directory. Also created are Xml versions in the MisAlCh1/Conditions/, MisAlCh2/Conditions, etc subdirectories for inspection.
  • You may create multiple "TAGS" in LHCBCOND.db, by modifying the "wid" array in The default is wid = [1.0], which will create a single DB with tag = "MisAlCh1". If one sets: wid=[1.0, 2.0, 3.0], the resulting LHCBCOND.db will have 3 tags, "MisAlCh1", MisAlCh2"  and "MisAlCh3", corresponding to 1, 2, and 3 sigma misalignments, respectively.
  • Output ROOT histograms, ROOTHists_1.root, ROOTHists_2.root, etc will be created so you can look at the distributions of misalignments. These histograms scale the X-axis to 5*sigma, and are updated automatically.

You now have a new version of LHCBCOND.db. I suggest copying it to a new name


Now, to have the conditions in myLHCBCOND.db overrride the ones in LHCBCOND.db, you need to include the following lines in your options file:

   * CondDBDispatcherSvc.Alternatives = { '/Conditions=CondDBLayeringSvc/CONDLayers' };
   * CONDLayers.Layers = {'CondDBAccessSvc/CONDLocal', 'CondDBAccessSvc/LHCBCOND'};
   * CONDLocal.ConnectionString = "sqlite_file:$HOME/myLHCBCOND.db/LHCBCOND";  (specify the relevant directory)
   * CONDLocal.DefaultTAG = "MisAlCh1";  (or whatever "tag" name you wish from the ones you created in the above steps) 

For more details on creating your own Conditions DB, see CondDBHowTo .

-- StevenBlusk - 13 Sep 2007

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r10 - 2007-12-11 - StevenBlusk
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 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