PMD info on da/amore updated
[u/mrichter/AliRoot.git] / MUON / READMEmapping.txt
CommitLineData
518eb852 1// $Id$
2
3/*!
4
91509ec6 5\page README_mapping Mapping
518eb852 6
7
91509ec6 8See the detailed description of the mapping package in ALICE-INT-2003-025.
9Since that time the mapping has been extended for slat and trigger
10chamber segmentations an later on also to hold the description of the
11top level connections of detection elements, including information
12about DDLs, bus patches and also trigger configuration.
518eb852 13
062f2b75 14\section mapping_s0 Mapping in OCDB
15
16The mapping is everywhere in the MUON code loaded from
17OCDB. In case the mapping data files are changed, the mapping
18in OCDB has to be regenerated in this way:
19
ab167304 20For changes in mapping/data:
062f2b75 21<pre>
ea0bca38 22$> rm $ALICE_ROOT/OCDB/MUON/Calib/MappingData/Run0_999999999_v0_s0.root
062f2b75 23$> cd $ALICE_ROOT/MUON
062f2b75 24$> aliroot
228fd720 25root [0] AliMpCDB::WriteMpData();
062f2b75 26</pre>
27
ab167304 28For changes in mapping/data_run:
29<pre>
ea0bca38 30$> rm $ALICE_ROOT/OCDB/MUON/Calib/MappingRunData/Run0_999999999_v0_s0.root
ab167304 31$> cd $ALICE_ROOT/MUON
ab167304 32$> aliroot
33root [0] AliMpCDB::WriteMpRunData();
34</pre>
35
062f2b75 36Note that mapping has to be loaded from OCDB almost each time
37when using MUON classes; the loading of mapping depends on
38the CBD manager state (the current run number, storage ...).
39The standard way of loading mapping expects the CDB manager
40in a state well defined beforehand; this way is used in
41the MUON code:
062f2b75 42<pre>
43if ( ! AliMpCDB::LoadDDLStore() ) {
44 AliFatal("Could not access mapping from OCDB !");
45}
46</pre>
ab167304 47In the same way, you can load AliMpManuStore, when manu serial
48numbers are needed:
49<pre>
50if ( ! AliMpCDB::LoadManuStore() ) {
51 AliFatal("Could not access run-dependent mapping from OCDB !");
52}
53</pre>
062f2b75 54In the interactive Root session, in case the CDB manager state is
55not defined, you can load mapping from the local OCDB files in this
56way:
57<pre>
58root [0] AliMpCDB::LoadDDLStore2();
ab167304 59root [2] AliMpCDB::LoadManuStore2();
062f2b75 60</pre>
61
518eb852 62\section mapping_s1 Graphical User Interface
63
64To use the GUI to plot DE segmentation run:
65
062f2b75 66<pre>
67AliMpCDB::LoadDDLStore2();
ab167304 68AliMpCDB::LoadManuStore2();
518eb852 69new AliMpDEVisu();
70</pre>
71
72or
73
74<pre>
062f2b75 75AliMpCDB::LoadDDLStore2();
ab167304 76AliMpCDB::LoadManuStore2();
518eb852 77new AliMpDEVisu(w, h);
78</pre>
79
80if you want to change the size of the GUI window.
81Typical value are:
82<pre>
83 w = 1200, h = 600 for PC
84 w = 1000, h = 550 for laptop
85</pre>
86
87The GUI allows:
88- drawing motif of a slat/quadrant
89- search of a given manu (motif) number
90- draw the channel number for a given manu number by clicking of the motif in canvas
91- write down in log message informations about the given detection element
92 * DE Id, DE name,
93 * number of buspatches, manus, manu serials
94- option to save log message onto disc
95
96\section mapping_s2 Test macros
97
91509ec6 98A set of tests macros have been written during the development
99of the mapping classes. To run these macros:
100
518eb852 101<pre>
102 cd ../mapping/macro
103 root
104 root [0] .x testMacroName.C
518eb852 105</pre>
106
518eb852 107
ab167304 108\section mapping_s3 Data files in mapping/data
109
110The directory data in $ALICE_ROOT/MUON/mapping contains files
111with data which are not supposed to be changed in a long period.
518eb852 112
91509ec6 113\subsection mapping_s3_sub1 zones.dat
518eb852 114
115Describes layout of zones, rows, row segments, subzones, motifs
116
117<pre>
118 SECTOR_DATA
119 number of zones
120 number of rows
121 direction of constant pad size (X or Y)
122 offset in X direction
123 offset in Y direction
124
125 ZONE
126 number of zone
127 half legth of pad size in x
128 half legth of pad size in y
129
130 SUBZONE
131 motif id
132 motif type_id
133
134 ROW_SEGMENT
135 x offset (in number of pads)
136 y offset (in number of pads)
137 row number
138 nof motifs
139 first motif position Id
140 step to the next motif position Id (+1 or -1)
141</pre>
142
143
91509ec6 144\subsection mapping_s3_sub2 zones_special.dat
518eb852 145
146Describes layout of special row segments (with irregular motifs)
147
148<pre>
149 SECTOR_SPECIAL_DATA
150
151 MOTIF
152 zone id
153 motif id
154 motif type_id
155
156 ROW
157 row number
158
159 PAD_ROWS
160 number of these pad rows in row
161
162 PAD_ROW_SEGMENT
163 mumber of pads in the rows segment
164 motif id
165 motif position id
166
167 motifX.dat
168 ----------
169 Describes characteristics of the motif type X
170
171 In lines:
172 Berg number
173 Kapton number
174 Pad number
175 Gassi number
176</pre>
177
178
179\subsection mapping_s3_sub3 motifSpecialX.dat
180
181Describes characteristics of the special motif with motif Id X;
182the special motif caontains pads of different size
183
184<pre>
185 In lines:
186 pad index i (in x)
187 pad index j (in y)
188 half legth of pad size in x
189 half legth of pad size in y
190</pre>
191
192\subsection mapping_s3_sub4 padPosX.dat
193
194Maps pad numbers used in the motifX.dat files to
195the local pad indices (i,j)
196
197<pre>
198 In lines:
199 Pad number
200 pad index i (in x)
201 pad index j (in y)
202</pre>
203
204
91509ec6 205\subsection mapping_s3_sub5 *.pcb files
518eb852 206
207Lines starting with # are comments.
208
209<pre>
210 SIZES PadSizeX PadSizeY SizeX SizeY (cm)
211
212 MOTIF motifType ix iy
213 MOTIF motifType ix iy
214 ...
215</pre>
216
217where ix, iy are the local coordinates (in pad unit) of the
218lower-left corner of the motif (0,0 is the lower-left corner
219of the PCB).
220
221PCB *MUST* be described in a rotating way, starting lower-left and
222then counter-clockwise, otherwise the manu-to-motif association
223(fixed in the slat definition files) will be wrong.
224
225Note that for "full" PCBs, the SizeX and SizeY are redundant as they could be
226computed from the motif alone (but that serves as a cross-check that the motif
227pattern given is ok). That's not the case for short or rounded PCB though.
228
229
91509ec6 230\subsection mapping_s3_sub6 *.slat files
518eb852 231
232A slat is defined by the list of its PCB, described starting
233from the beam and going outward.
234
235One PCB per line, preceded by the keyword PCB
236Other lines not matching this syntax are ignored.
237After the PCB is the list of manu ids for this PCB.
238
239Example :
240
241<pre>
242 PCB X 1-3;24-20;42;44;53
243 PCB X 1-14
244 PCB Y 100-90
245 PCB Z 1;2;3;4;5;6;7;12;120
246</pre>
247
248defines a slat with 4 PCBs : XXYZ
249
250The manu to motif relationship is attached to the fact that we're counting
251counter-clockwise, starting on the lower-left of the PCB. (and the pcb files
252have to follow this convention to defined their motifs, otherwise all
253this won't work).
254
255Note that the definition of the PCBs have to be in files with extension
256.pcb (X.pcb, Y.pcb, Z.pcb)
257
258
91509ec6 259\subsection mapping_s3_sub7 DetElemIdToBusPatch.dat
518eb852 260
261Lines starting with # are comments.
262
263Contains the detection element identifier with the associated buspatch numbers
264and the corresponding DDL identifier.
265The link between buspatches and DE's is needed on the rawdata level to identify
266the type of quadrant/slat to get the corresponding mapping.
267The DDL id is needed for the rawdata generation only.
268
269To generate this file, the macro MUONGenerateBusPatch.C could be used.
270
271
062f2b75 272\subsection mapping_s3_sub8 BusPatchSpecial.dat
ae649dcb 273
274Lines starting with # are comments.
275
276Contains the list of bus patches which manu readout is
277not in the standard order. The format:
278
279<pre>
280KEYWORD DDLs BusPatches [ManuIDs}
281 where KEYWORD = REVERT or EXPLICIT
282</pre>
283
284- For the bus patches following the REVERT keyword,
285 the manus are just reordered in a reverted order.
286- For the bus patches following the EXPLICIT keyword,
287the manus filled with a standard procedure (using the DetElemIdToBusPatch.dat
288file) are replaced with the list of manus in this file.
289
290
062f2b75 291\subsection mapping_s3_sub9 BusPatchLength.dat
292
293Lines starting with # are comments.
294
295Contains the list of bus patches and their cable length in meters
296
297<pre>
298# DDL 0
299 1 3
300 2 3
301...
302</pre>
303
304
305\subsection mapping_s3_sub10 crate.dat
518eb852 306
307Muon trigger electronics configuration file (decoded in class
308AliMUONTriggerCrateStore) directly copy/paste from the ALICE PRR
309ALICE-EN-2003-010. Gives local board number, name,
310crate name it belongs to, slot number, and internal switches
311(used in the algorithm).
312
313
8b68068b 314\subsection mapping_s3_sub11 ManuSerialToBin.dat
315
316Lines starting with # are comments.
317
318Contains the manu serial number with their associated bin number, injection and calibration gain.
319
320To compare the bin number with the serial in the CDB database you can run the macro:
321
322<pre>
323AliMpCDB::LoadDDLStore2();
324.L $ALICE_ROOT/MUON/mapping/macros/MUONCheckManu.C+
325MUONCheckManu(10, kFALSE);
326</pre>
327
328The function has two parameters, the first is the number of the chamber (zero mean all chambers).
329The macro can create a set of histogramms with the different gain distributions stored into a root file
330(second parameter).
331
332Two files a generated: one with the list of manu per detection element with their associated bin and gain
333value, the other with the bad, strange or unidentified serial number.
334
335
ab167304 336\section mapping_s4 Data files in mapping/data_run
337
338The directory data_run in $ALICE_ROOT/MUON/mapping contains files
339with data which are expected to change during experiment.
340At present time, there are only files with manu serial numbers:
341
342\subsection mapping_s4_sub1 deName_manu_dat.dat
343
344Contains the list of manuIds and their serial numbers.
345
346<pre>
347# Id bp/nbp serial
3481 bp 4615
3492 bp 4616
350...
351</pre>
352
353\section mapping_s5 Units used
518eb852 354
355Lengths are in centimeters.
356
91509ec6 357This chapter is defined in the READMEmapping.txt file.
358
518eb852 359*/
360