Application
to VELO
1. VELO Residuals
2. Problem & Strategy
3. Internal Alignment
4. Box Alignment
5. Software Description
6. How To Create Misaligned Events ?
7. How To Use The Software ?
Home
Short
Presentation
Mechanical
Constraints
Misalignment
Studies
Alignment
Techniques
Application
to VELO
C++ code
Latest News
Links

Application to the VELO

2. VELO algorithm development

G. Using the VELO alignment software

G1. Introduction and warning

This page tries to provide an 'up-to-date' tutorial on VELO alignment software utilisation. However, this package is constantly moving due to latest LHCb software evolution, so it's possible that this tutorial will be sometime out-of-date.

The version presented here is working with Brunel v31r8 and has been tested with Alignment v2r0, using digi files produced with Boole v14r4. On how to produce digi files with misaligned VELO events, look at the previous page.

If you have problems, if you see bugs,... just send an email to Marco or Sebastien.

Good luck...

G2. Get the software environment and compile the executable

G2.1. Using Brunel v31r8

At CERN, you first have to get the appropriate version of Brunel. To do so, type in you ~/cmtuser area:

___________________

1. setenvBrunel v31r8
2. getpack Rec/Brunel v31r8
___________________

Then, get the alignment packages:

___________________

1. getpack Alignment/AlignmentTools v2r7p1
2. getpack Alignment/AlignmentInterfaces v2r2
3. getpack Alignment/VeloAlignment v3r0
___________________

Finally, edit the Brunel requirement file, in order to add the Alignment package:

___________________

1. cd ~/cmtuser/Brunel_v31r8/Rec/Brunel/v31r8/cmt
2. edit the requirements file.
3. add the line 'use VeloAlignment v* Alignment' at the end of the 'use ***' lines.
4. add the line 'use AlignmentTools v* Alignment' at the end of the 'use ***' lines.
___________________

and create the Brunel executable:

___________________

1. cmt br cmt config
2. source setup.csh
3. cmt br gmake
___________________

Logically it should work, i.e. creating the Brunel.exe file. Then, you could nearly start to play with it.

To run the Brunel job you just have to type:

___________________

./Brunel.exe $BRUNELOPTS/v200601.opts
___________________

But in our case we have to include the alignment. The solution is to use a specific option file, which could be downloaded here:

___________________

1. Brunel.opts
___________________

and put it into the $BRUNELOPTS directory. That's it, you could run your first alignment job:

___________________

./Brunel.exe $BRUNELOPTS/v200601.opts > output.log
___________________

G2.2. Using Alignment v2r0

!!! WARNING !!! --> Alignment project is under construction, this part is very preliminary and will improve with next releases.

At CERN, you first have to get the appropriate version of Escher. To do so, type in you ~/cmtuser area:

___________________

1. setenvAlignment v2r0
2. getpack Alignment/Escher v2r1
___________________

Then, get the alignment packages:

___________________

1. getpack Alignment/AlignmentTools v2r7p1
2. getpack Alignment/AlignmentInterfaces v2r2
3. getpack Alignment/VeloAlignment v3r0
___________________

Finally, edit the Escher requirement file, in order to add the Alignment package:

___________________

1. cd ~/cmtuser/Alignment_v2r0/Alignment/Escher/v2r1/cmt
2. edit the requirements file.
3. add the line 'use VeloAlignment v* Alignment' at the end of the 'use ***' lines.
___________________

and create the Escher executable:

___________________

1. cmt br cmt config
2. source setup.csh
3. cmt br gmake
___________________

Logically it should work, i.e. creating the Escher.exe file. To run the Escher job you just have to type:

___________________

./Escher.exe $ESCHEROPTS/v200601.opts
___________________

But in our case we have to include the alignment. The solution is to use specific option files, which could be downloaded here:

___________________

1. Escher.opts
2. v200601.opts
___________________

and put them into the $ESCHEROPTS directory.

That's it, you could run your first alignment job:

___________________

./Escher.exe $ESCHEROPTS/v200601.opts > output.log
___________________

G2.3. And then...

In both cases you should process internal alignment of the two VELO half-boxes, using the default digi file (so logically you should find no misalignments...). You could follow the job progress and results in the logfile. But to analyze more closely the results you might want to have a look at the ROOTfile produced by the alignment job. This file is named Align.root. It contains a certain number of monitoring nTuples (we will see how to get these nTuples later).

G3. Analyze the results.

Basically, the nTuple you have just created contains four trees : Constants, which contains the alignment parameters, before and after alignment, Trackinfo, which contains residuals information taken from an independent sample before and after alignment, and two other trees, namely Overlaps and PV, that we won't describe here.

G3.1. Misalignments.

In a sense Constants tree is only interesting for misalignments studies, in order to compare the misalignment generated to the reconstructed ones, but it could also be used as a storage method for alignment constants. The comparison between generated and reconstructed misalignments is made via Alignment_analysis ROOT macro.

To run this macro properly you will need a ROOT file containing the misalignment you have generated. In the previous case it's straightforward, as we are using the nominal geometry, ie no misalignments, Align.root could be used. We will see the other case later on.

Then, run the macro:

___________________

1. root Alignment_analysis.C
___________________

This should produce a serie of commented plots, basically showing, for different degrees of freedom, reconstructed vs generated misalignments, and resolutions for most relevant degrees of freedom.

G3.2. Residuals.

First of all, get the Residual_analysis ROOT macro. This macro will perform a detailed analysis of the Trackinfo tree contained in Align.root. This tree is filled with residual informations of a track sample (number of track in the sample could be set via jobOptions). These tracks are stored during the alignment process, but are not used for the alignment. They are fitted before and after the alignment (so taking into account the misalignment), and residuals are computed.

A set of options could be modified at the start of the macro. In particular, you could define which modules you want to check, the minimum number of hits per module parts (in order to have relevant values you need a certain amount of hits). Command is, as previously:

___________________

1. root Residual_analysis.C
___________________

G4. And now we look at our misaligned events !

We will now exploit the 10 misaligned digi files created in the previous part.

First, create a directory called /Reconstruction/ into your working directory. In this directory, create two subdirectories: /opts/ and /scripts/. Then, download the corresponding perl script create_jobs_brunel_v31r8_newCondDB.pl.

Again, adapt the parameters at the beginning of the Perl scripts according to your conditions.

The options files produced are adapted to alignment studies, so it won't produce DST files as output. However it shouldn't be too complicated to modify the options file if you want it.

Each script created will execute 2 runs:

___________________

1. ./Brunel.exe Brunel_***.opts
2. ./Brunel.exe NOMINAL_Brunel_***.opts
___________________

First run is taking the alignment into account. So the alignment should find zeroes, as he is aware of the deformations. Also, the rootfile produced here will contain the initial alignment constants (this will be useful for comparing to found misalignments in the macro presented before).

Second run is considering nominal (ie perfect) geometry. The alignment should then find back the correct constants.

You could easily check that first run initial constants are coherent with second run final constants, simply modifying Residual_analysis macro.