]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/READMEgeometry.txt
adding script to retrieve all datapoints for testing purposes
[u/mrichter/AliRoot.git] / MUON / READMEgeometry.txt
CommitLineData
518eb852 1// $Id$
b453c965 2
518eb852 3/*!
b453c965 4
91509ec6 5\page README_geometry Geometry
518eb852 6
7
8\section geometry_s1 General Information about MUON Geometry
1ecf5e57 9
10Our geometry is described in the geometry builder classes.
91509ec6 11The main geometrical constants are set in the class AliMUONConstants.
12The geometry is built from the code during running simulation
13and it is automatically exported in a geometry.root file
14via the framework. Then aliroot takes this geometry.root file as
15a unique geometrical info of our apparatus during the generation
16and the reconstruction and analysis (if needed)
17
9f9989b1 18The macros MakeMUONZeroMisAlignment.C, MakeMUONResMisAlignment.C
19and MakeMUONFullMisAlignment.C generate the mis-alignment
20data (see more in the chapter \ref geometry_s4 below).
21
91509ec6 22The code can also generate the special geometry
23data files, transform.dat and svmap.dat, via the macro
9f9989b1 24MUONGenerateGeometryData.C (see more in the chapter \ref geometry_s5 below).
91509ec6 25The svmap.dat data file have to be recreated each time the code
26of the geometry is modified. The info (well updated) in this file
27is needed during the simulation.
1ecf5e57 28We can also decide to use the transform.dat file as input of our
29geometry. This allows for changing the position of our detection elements
30and/or half-planes (half-chambers in code jargon) without modifying
31and recompiling the code.
32
1ecf5e57 33Misalignments are in the official AliRoot code applied to the geometry.root
34file.
35
b453c965 36
91509ec6 37\section geometry_s2 How to check the geometry with the Root geometrical modeler
1ecf5e57 38
518eb852 39\see ftp://root.cern.ch/root/doc/chapter16.pdf
40\see http://agenda.cern.ch/fullAgenda.php?ida=a05212
1ecf5e57 41
518eb852 42<pre>
9f9989b1 43AliMpCDB::LoadMpSegmentation2();
1ecf5e57 44gAlice->Init("$ALICE_ROOT/MUON/Config.C");
45gGeoManager->GetMasterVolume()->Draw();
518eb852 46</pre>
47
91509ec6 48\section geometry_s3 How to check the overlaps with the Root geometrical modeler
1ecf5e57 49
518eb852 50\see ftp://root.cern.ch/root/doc/chapter16.pdf
51\see http://agenda.cern.ch/fullAgenda.php?ida=a05212
1ecf5e57 52
518eb852 53<pre>
9f9989b1 54AliMpCDB::LoadMpSegmentation2();
1ecf5e57 55gAlice->Init("$ALICE_ROOT/MUON/Config.C");
56gGeoManager->CheckOverlaps();
57gGeoManager->PrintOverlaps();
518eb852 58</pre>
1ecf5e57 59
9f9989b1 60More extensive, but also more time consuming checking,
61can be performed in this way:
62<pre>
63gGeoManager->CheckGeometryFull();
64</pre>
65
1ecf5e57 66
518eb852 67\section geometry_s4 Macro MUONGenerateGeometryData.C
1ecf5e57 68
91509ec6 69Macro for generating the geometry data files:
1ecf5e57 70- MUON/data/svmap.dat file contains all the information to link
71each geant volume (it can be extended to other virtual MC) with
72a detection element. The point here is that a given detection
73element, i.e. a slat chamber can consist of more geant volumes.
74the correspondence is then defined in an input file.
75Each time there is a change in the definition of MC geometry, these
76input files must be re-generated via the macro
77MUONGenerateGeometryData.C
91509ec6 78- MUON/data/transform.dat file contains the transformations
79data (translation and rotation) for all alignable objects
80(modules & detection elements)
1ecf5e57 81
82To be run from aliroot:
518eb852 83<pre>
1ecf5e57 84.x MUONGenerateGeometryData.C
518eb852 85</pre>
1ecf5e57 86
87The generated files do not replace the existing ones
88but have different names (with extension ".out").
89Replacement with new files has to be done manually.
90
91
518eb852 92\section geometry_s5 Macros to generate Mis-alignment data
1ecf5e57 93
518eb852 94Macros for generating the geometry mis-alignment data:
95- MakeMUONFullMisAlignment.C
96- MakeMUONResMisAlignment.C
97- MakeMUONZeroMisAlignment.C
1ecf5e57 98
99To be run from aliroot:
518eb852 100<pre>
91509ec6 101.x MakeMUONFullMisAlignment.C
518eb852 102</pre>
1ecf5e57 103
91509ec6 104etc.
105
1ecf5e57 106If the environment variable TOCDB is not set to "kTRUE",
107the misalignment data are generated in a local file:
9f9989b1 108MUONfullMisalignment.root, etc.
1ecf5e57 109
110If the data are stored in CDB, the storage can be specified in
111the environment variable STORAGE. The misalignment data are then
112generated in the CDB folder (defaults are ResMisAlignCDB and FullMisAlignCDB
113in the working directory). Inside the local CDB the path for the
114alignment data is (and must be) "MUON/Align/Data/".
115Residual misalignment: Default is our current estimate of
116misalignment after all our alignment procedure has been applied.
117Full misalignment: Default is our current estimate of initial
118misalignment.
119
9f9989b1 120The mis-alignment data can be then retrieved from a file
121and applied to ideal geometry in this way.
122
123<pre>
124TGeoManager::Import("geometry.root");
125TFile f("MUONfullMisalignment.root");
126TClonesArray* misAlignObjsArray = (TClonesArray*)f.Get("MUONAlignObjs");
127AliGeomManager::ApplyAlignObjsToGeom(*misAlignObjsArray);
128</pre>
129
130Mis-aligned geometry can be then inspected in the same
131way as described in the chapters \ref geometry_s2 and \ref geometry_s3.
518eb852 132
133\section geometry_s6 How to check the alignment software
1ecf5e57 134
135The script AlirootRun_MUONtestAlign.sh allows you to check the software for
136the alignment with physics tracks. The script will:
137- Generate a misaligned geometry in a local CDB (default FullMisAlignCDB)
138- Simulate 1000 events using previously misaligned geometry
139- Reconstruct the events using perfect geometry
140- Run the alignment code over the above events using MUONAlignment.C
141
142To run you need to type:
518eb852 143<pre>
1ecf5e57 144$ALICE_ROOT/MUON/AlirootRun_MUONtestAlign.sh
518eb852 145</pre>
1ecf5e57 146
147The results of the test are saved in test_align/ directory. The file measShifts.root
148contains useful graphs for studying the alignment performances. A local CDB
149containing the realigned geometry is also created (default is ReAlignCDB). The
150file $ALICE_ROOT/MUON/data/transform2ReAlign.dat contains the
151transformations describing the realigned geometry to be compared with the
152used misaligned geometry $ALICE_ROOT/MUON/data/transform2.dat.
153
154IMPORTANT NOTE: For a useful test of the alignment performances, the
155order of 100 000 tracks is needed, it is then advisable to generate and
156reconstruct enough events separately and run MUONAlignment.C providing a file list
157afterwards.
518eb852 158
701d0777 159\section geometry_s7 Macro MUONCheckMisAligner.C
160
161The macro MUONCheckMisAligner.C performs the misalignment on an existing muon
162arm geometry based on the standard definition of the detector elements.
163
164It uses AliMUONGeometryAligner :
91509ec6 165- Creates a new AliMUONGeometryTransformer and AliMUONGeometryAligner
166- Reads the transformations in from the transform.dat file (make sure that
701d0777 167this file is the _standard_ one by comparing it to the one in CVS)
91509ec6 168- Creates a second AliMUONGeometryTransformer by misaligning the existing
701d0777 169one using AliMUONAligner::MisAlign
170
171User has to specify the magnitude of the alignments, in the Cartesian
172co-ordiantes (which are used to apply translation misalignments) and in the
173spherical co-ordinates (which are used to apply angular displacements)
174
175User can also set misalignment ranges by hand using the methods :
176SetMaxCartMisAlig, SetMaxAngMisAlig, SetXYAngMisAligFactor
177(last method takes account of the fact that the misalingment is greatest in
178the XY plane, since the detection elements are fixed to a support structure
179in this plane. Misalignments in the XZ and YZ plane will be very small
180compared to those in the XY plane, which are small already - of the order
181of microns)
182
183Default behavior generates a "residual" misalignment using gaussian
184distributions. Uniform distributions can still be used, see
185AliMUONGeometryAligner.
186
187User can also generate module misalignments using SetModuleCartMisAlig
188and SetModuleAngMisAlig
189Note : If the detection elements are allowed to be misaligned in all
190directions, this has consequences for the alignment algorithm, which
191needs to know the number of free parameters. Eric only allowed 3 :
192x,y,theta_xy, but in principle z and the other two angles are alignable
193as well.
194
195
91509ec6 196\section geometry_s8 Geometry data files format
518eb852 197
701d0777 198\subsection geometry_s8_sub1 transform.dat
518eb852 199
200 List of transformations for chambers geometry modules and detection
201 elements; in format:
202<pre>
203 KEY ID [nofDE] pos: posX posY posZ rot: theX phiX theY phiY theZ phiZ
204
205 where KEY = CH or DE
206 ID = chamberId or detElemId
207 pos: posX posY posZ = position in cm
208 rot: theX phiX theY phiY theZ phiZ = rotation angles as in Geant3 in deg
209</pre>
210
701d0777 211\subsection geometry_s8_sub2 svmap.dat
518eb852 212
213 Map of sensitive volumes to detction element Ids;
214 in format:
215
216<pre>
217 KEY volpath detElemId
218
219 where KEY = SV
220 volpath = volume path in format /volname1_copyNo1/volname2_copyNo2/...
221 detElemId = detection element Id
222 </pre>
223
224
91509ec6 225This chapter is defined in the READMEgeometry.txt file.
226
518eb852 227*/