Application to the VELO
2. VELO algorithm (Part V)
F. Using the Geometry Framework to misalign the VELO
This part explains how the Juan Palacios's
LHCb Geometry Framework (GF) could be used easily to produce events in a misaligned VELO. In the following example, we show how to produce 10 sets of misalignments and run them simultaneously. Technical details concerning the framework are available
here. This page was updated for the use with software under the hat of
LHCb v21r12 and using slc3.
For each of the steps described below the safest way of avoiding clashes of different environments is to work in a clean shell, i.e. login to a new shell as you move from F1 to F2 and so on.
F1. Create the misalignments sets
For the moment alignment conditions are contained in xml files inside the
XmlConditions package. So first of all, get this package in your
~/cmtuser/ area (to do that follow the instructions given on the GF page). Here,
v2r4 has been used.
For the VELO, the alignment information is stored in the directory
$XMLCONDITIONSROOT/DDDB/Conditions/Velo. This directory contains a file called
AlignmentCatalog.xml which redirects to three different files in the subdirectory called
Alignment. Those files condtain the actual alignment information for the VELO as a whole and the VELO halves (
Global.xml), for the individual modules (
Module.xml), and for the individual sensors (
Detector.xml). In the default case all the values should be set to 0., i.e. a perfect alignment.
Now we will produce 10 different sets of the four different files. Their ending will be
_{conf}_{i}.xml instead of
.xml, where {conf} represents the name of the alignment configuration and {i} represents a running number for the different sets. To do so, a python script based on the one given on the GF page is used. It is called
my_alignCond_template.py. To use this python script, get
v1r4 of the package
Ex/DeVeloPython and copy
my_alignCond_template.py into the subdirectory python.
Edit the python script to adjust the misalignment scales for the different components and to set a name for this configuration (this allows to have different alignment configurations in use at the same time). To run the script you have to do the following (starting from your cmtuser directory):
___________________
1. LHCbEnv v18r9
2. cd Ex/DeVeloPython/v1r4/cmt
3. cmt br cmt config
4. source setup.(c)sh
5. cmt br gmake
6. cd ../python
7. python -i my_alignCond_template.py (Exit python with <CTRL>+d)
___________________
You should now find 10
AlignmentCatalog_*.xml files in the python directory and 10
Global_*.xml,
Module_*.xml, and
Detector_*.xml, respectively, in a subdirectory called
Alignment. All you need to do now is to copy thos files in the appropriate directories, i.e.
AlignmentCatalog_*.xml to
$XMLCONDITIONSROOT/DDDB/Conditions/Velo and the files in the
Alignment subdirectory to
$XMLCONDITIONSROOT/DDDB/Conditions/Velo/Alignment.
F2. Produce and simulate (GAUSS v25r7)
Into your working directory, create a directory called
/Generation/. In this directory, create 3 subdirectories:
/opts/,
/scripts/, and
/Xml/. Then, download the perl script
create_jobs_gauss_v25r7.pl. It will produce an executable script to be sent to the batch system (in
/scripts/), a job options file (in
/opts/), and another xml file for the conditions database (in
/Xml/). All you have to do is to adapt the parameters at the beginning of the file to your needs. Remember that the last paramerter,
$conf_name must have the same name you used when creating the xml files for the alignment configuration you want to use. In addition, you have to provide an existing directory on CASTOR as
$pathout that has two subdirectories called
sim and
log.
Once all is set, run the script (
./create_jobs_gauss_v25r7.pl, and do
chmod 755 create_jobs_gauss_v25r7.pl before if it doesn't want to execute) and copy the files from the
/Xml/ directory to
$XMLCONDITIONSROOT/DDDB/Conditions.
Now, you need to compile the Gauss executable before sending all that onto the batch queue (it could be also a smart idea to make a small test before that...). Here is what you need to do (starting from your
cmtuser directory):
___________________
1. getpack Sim/Gauss v25r7
2. cd Sim/Gauss/v25r7/cmt/
3. GaussEnv v25r7
4. cmt br cmt config
5. source setup.(c)sh
6. cmt br gmake
___________________
Now you have Gauss compiled, you're nearly there but you need to allow the VELO to be misaligned. To do so, modify the options file named
SimGeometry.opts as follows:
___________________
// Geometry to be simulated Detector by detector
//----------------------------------------------------------------------------
//Geo.StreamItems += {"/dd/Structure/LHCb/BeforeMagnetRegion/Velo"};
// Uncomment following line to enable misaligneable VELO
#include "$GAUSSOPTS/SimVeloGeometry.opts"
___________________
Once you've done that all is OK, you could make a test using one of the options files you've just generated. If test is satisfying you could send the jobs to the batch, by doing:
___________________
chmod 755 launch_GAUSS.x
./launch_GAUSS.x
___________________
Now you have your 10 .sim files, next step is the digitization, in BOOLE.
F3. Digitize (BOOLE v12r10)
It's quite similar than in the previous case, and in fact even simpler, as you don't have to deal with all the .xml stuff anymore.
Create a directory called
/Digitisation/ into your working directory. In this directory, create two subdirectories:
/opts/ and
/scripts/. Then, download the perl script
create_jobs_boole_v12r10.pl, open it, and read the comments.
This scripts will produce for you all the necessary info for running BOOLE jobs on LSF batch. You just have to provide the number of runs you want and the number of events per run (should be equal or smaller than the Gauss number/run). Then you have to choose the batch queue in accordance, and to setup the area for data storage correctly (here it's on CASTOR).
Next step, install BOOLE:
___________________
1. getpack Digi/Boole v12r10
2. cd Digi/Boole/v12r10/cmt/
3. BooleEnv v12r10
4. cmt br cmt config
5. source setup.(c)sh
6. cmt br gmake
___________________
Then you run the perl script exaclty as in the GAUSS case, but it's even easier as now you don't have to care about xml files, as you already do the job in the previous step. Now you just have to launch the jobs (after making a small test, of course...):
___________________
chmod 755 launch_BOOLE.x
./launch_BOOLE.x
___________________
That's it, now there is just one last step remaining, which is the reconstruction. For a detailed recipe of how to run the alignment software within Brunel ahve a look at the
following section.
Don't hesitate to send an email to
Marco or
Sebastien if you have questions about the scripts, or if you find bugs and so on... But ask Juan if your problem or question concerns the geometry framework...