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