]>
Commit | Line | Data |
---|---|---|
e118b27e | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // $Id$ | |
17 | // | |
18 | // Class AliMUONTest | |
19 | // ----------------- | |
20 | // Class with functions for testing | |
21 | // | |
22 | // Author: Ivana Hrivnacova, IPN Orsay | |
23 | ||
24 | #include <TStopwatch.h> | |
25 | #include <Riostream.h> | |
24def874 | 26 | #include <TH2F.h> |
27 | #include <TPave.h> | |
152d6f4e | 28 | #include <TCanvas.h> |
e118b27e | 29 | |
30 | #include "AliRun.h" | |
31 | #include "AliSegmentation.h" | |
32 | #include "AliLog.h" | |
33 | ||
34 | #include "AliMUONTest.h" | |
35 | #include "AliMUON.h" | |
36 | #include "AliMUONConstants.h" | |
37 | #include "AliMUONGeometryModule.h" | |
38 | #include "AliMUONGeometryStore.h" | |
39 | #include "AliMUONGeometrySegmentation.h" | |
40 | #include "AliMUONSt12QuadrantSegmentation.h" | |
24def874 | 41 | #include "AliMUONSt345SlatSegmentation.h" |
58d53b65 | 42 | #include "AliMUONTriggerSegmentation.h" |
43 | #include "AliMUONTriggerConstants.h" | |
e118b27e | 44 | |
45 | ClassImp(AliMUONTest) | |
46 | ||
47 | //__________________________________________________________________ | |
24def874 | 48 | AliMUONTest::AliMUONTest(const TString& configMacro) |
152d6f4e | 49 | : TObject(), |
50 | fCanvas(0) | |
e118b27e | 51 | { |
52 | // Standard Constructor | |
53 | // | |
54 | // Initialize AliRoot | |
55 | gAlice->Init(configMacro.Data()); | |
56 | } | |
57 | ||
58 | //__________________________________________________________________ | |
59 | AliMUONTest::AliMUONTest() | |
152d6f4e | 60 | : TObject(), |
61 | fCanvas(0) | |
e118b27e | 62 | { |
63 | // Default Constructor | |
64 | // | |
65 | } | |
66 | ||
67 | //____________________________________________________________________ | |
68 | AliMUONTest::AliMUONTest(const AliMUONTest& rhs) | |
69 | : TObject(rhs) | |
70 | { | |
71 | // Protected copy constructor | |
72 | ||
73 | AliFatal("Not implemented."); | |
74 | } | |
75 | ||
76 | //____________________________________________________________________ | |
77 | AliMUONTest::~AliMUONTest() | |
78 | { | |
79 | // Destructor | |
152d6f4e | 80 | |
81 | delete fCanvas; | |
e118b27e | 82 | } |
83 | ||
84 | //________________________________________________________________________ | |
85 | AliMUONTest& AliMUONTest::operator = (const AliMUONTest& rhs) | |
86 | { | |
87 | // Protected assignement operator | |
88 | ||
89 | if (this == &rhs) return *this; | |
90 | ||
91 | AliFatal("Not implemented."); | |
92 | ||
93 | return *this; | |
94 | } | |
95 | ||
96 | // | |
152d6f4e | 97 | // private methods |
e118b27e | 98 | // |
99 | ||
152d6f4e | 100 | //________________________________________________________________________ |
101 | AliMUONGeometrySegmentation* | |
102 | AliMUONTest::CreateSt1Segmentation(Int_t chamberId, Int_t cathod) | |
e118b27e | 103 | { |
152d6f4e | 104 | // Create St1 geometry segmentation for given chamber and cathod |
e118b27e | 105 | |
106 | AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON"); | |
107 | if (!muon) { | |
108 | AliFatal("MUON detector not defined."); | |
152d6f4e | 109 | return 0; |
e118b27e | 110 | } |
111 | ||
152d6f4e | 112 | AliMUONGeometrySegmentation* segmentation |
113 | = new AliMUONGeometrySegmentation(muon->Chamber(chamberId).GetGeometry()); | |
e118b27e | 114 | |
152d6f4e | 115 | // Quadrant segmentations: |
116 | AliMUONSt12QuadrantSegmentation* bendSt1 | |
117 | = new AliMUONSt12QuadrantSegmentation(kStation1, kBendingPlane); | |
118 | AliMUONSt12QuadrantSegmentation* nonbendSt1 | |
119 | = new AliMUONSt12QuadrantSegmentation(kStation1, kNonBendingPlane); | |
120 | ||
121 | // The same configuration for both chambers of Station 1 | |
122 | Int_t id0 = (chamberId+1)*100; | |
123 | ||
124 | // Configure St1 chamber segmentations | |
125 | if (cathod == 0) { | |
152d6f4e | 126 | segmentation->Add(id0, bendSt1); |
b413978f | 127 | segmentation->Add(id0 + 3, nonbendSt1); |
128 | segmentation->Add(id0 + 2, bendSt1); | |
152d6f4e | 129 | segmentation->Add(id0 + 1, nonbendSt1); |
152d6f4e | 130 | } |
131 | else if (cathod == 1) { | |
152d6f4e | 132 | segmentation->Add(id0, nonbendSt1); |
b413978f | 133 | segmentation->Add(id0 + 3, bendSt1); |
134 | segmentation->Add(id0 + 2, nonbendSt1); | |
152d6f4e | 135 | segmentation->Add(id0 + 1, bendSt1); |
152d6f4e | 136 | } |
137 | else { | |
138 | AliError("Wrong cathod number"); | |
139 | return 0; | |
24def874 | 140 | } |
e118b27e | 141 | |
152d6f4e | 142 | return segmentation; |
143 | } | |
e118b27e | 144 | |
580c28fd | 145 | //________________________________________________________________________ |
146 | AliMUONGeometrySegmentation* | |
147 | AliMUONTest::CreateSt2Segmentation(Int_t chamberId, Int_t cathod) | |
148 | { | |
149 | // Create St1 geometry segmentation for given chamber and cathod | |
150 | ||
151 | AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON"); | |
152 | if (!muon) { | |
153 | AliFatal("MUON detector not defined."); | |
154 | return 0; | |
155 | } | |
156 | ||
157 | AliMUONGeometrySegmentation* segmentation | |
158 | = new AliMUONGeometrySegmentation(muon->Chamber(chamberId).GetGeometry()); | |
159 | ||
160 | // Quadrant segmentations: | |
161 | AliMUONSt12QuadrantSegmentation* bendSt2 | |
162 | = new AliMUONSt12QuadrantSegmentation(kStation2, kBendingPlane); | |
163 | AliMUONSt12QuadrantSegmentation* nonbendSt2 | |
164 | = new AliMUONSt12QuadrantSegmentation(kStation2, kNonBendingPlane); | |
165 | ||
166 | // The same configuration for both chambers of Station 2 | |
167 | Int_t id0 = (chamberId+1)*100; | |
168 | ||
169 | // Configure St2 chamber segmentations | |
170 | if (cathod == 0) { | |
171 | segmentation->Add(id0, bendSt2); | |
b413978f | 172 | segmentation->Add(id0 + 3, nonbendSt2); |
173 | segmentation->Add(id0 + 2, bendSt2); | |
580c28fd | 174 | segmentation->Add(id0 + 1, nonbendSt2); |
580c28fd | 175 | } |
176 | else if (cathod == 1) { | |
177 | segmentation->Add(id0, nonbendSt2); | |
b413978f | 178 | segmentation->Add(id0 + 3, bendSt2); |
179 | segmentation->Add(id0 + 2, nonbendSt2); | |
580c28fd | 180 | segmentation->Add(id0 + 1, bendSt2); |
580c28fd | 181 | } |
182 | else { | |
183 | AliError("Wrong cathod number"); | |
184 | return 0; | |
185 | } | |
186 | ||
187 | return segmentation; | |
188 | } | |
189 | ||
24def874 | 190 | //_____________________________________________________________________________ |
152d6f4e | 191 | AliMUONGeometrySegmentation* |
192 | AliMUONTest::CreateSlatSegmentation(Int_t chamberId, Int_t cathod) | |
24def874 | 193 | { |
152d6f4e | 194 | // Create St1 geometry segmentation for given chamber and cathod |
24def874 | 195 | |
196 | AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON"); | |
197 | if (!muon) { | |
198 | AliFatal("MUON detector not defined."); | |
152d6f4e | 199 | return 0; |
24def874 | 200 | } |
201 | ||
f48459ab | 202 | AliMUONGeometrySegmentation *chamberSeg = new AliMUONGeometrySegmentation(muon->Chamber(chamberId).GetGeometry()); |
203 | ||
24def874 | 204 | //Slats Segmentations |
f48459ab | 205 | AliMUONSt345SlatSegmentation *slatsegB[14]; // Types of segmentation for St3 in this framework |
206 | AliMUONSt345SlatSegmentation *slatsegNB[14]; // Types of segmentation for St3 in this framework | |
207 | // Bending | |
24def874 | 208 | Int_t ndiv[4] ={ 4, 4, 2, 1}; // densities zones |
f48459ab | 209 | for(Int_t i=0; i<14; i++) { |
210 | slatsegB[i] = new AliMUONSt345SlatSegmentation(1); | |
211 | slatsegB[i]->SetPadSize(10.,0.5); | |
212 | slatsegB[i]->SetPadDivision(ndiv); | |
213 | slatsegB[i]->SetId(1); | |
214 | slatsegB[i]->SetDAnod(0.25); | |
215 | slatsegNB[i] = new AliMUONSt345SlatSegmentation(0); | |
216 | slatsegNB[i]->SetPadSize(1.,10.); // must be 0.713 !!! | |
217 | slatsegNB[i]->SetPadDivision(ndiv); | |
218 | slatsegNB[i]->SetId(1); | |
219 | slatsegNB[i]->SetDAnod(0.25); | |
24def874 | 220 | } |
221 | ||
f48459ab | 222 | |
24def874 | 223 | //****************************************************************************************** |
224 | // Station 3 | |
225 | //****************************************************************************************** | |
226 | ||
f48459ab | 227 | if (chamberId == 4 || chamberId == 5) { |
228 | // Type 112200 for 500, 501, 508, 509, 510, 517 in Ch5 (similar for Ch6) for the futur official numbering | |
229 | // Type 112200 for 503, 504, 505, 555, 554, 553 in Ch5 (similar for Ch6) actual numbering in the code to be changed in jan05 | |
230 | Int_t n0[4] = { 0, 2, 2, 0 }; | |
231 | slatsegB[0]->SetPcbBoards(n0); | |
232 | slatsegB[0]->Init(0); | |
233 | slatsegNB[0]->SetPcbBoards(n0); | |
234 | slatsegNB[0]->Init(0); | |
235 | ||
236 | // Type 122200 for 502, 507, 511, 516 (similar in Ch6) for future official numbering of ALICE | |
237 | // Type 122200 for 502, 506, 556, 552 (similiarin Ch6) for actual numbering in muon code to be changed in jan05 | |
238 | Int_t n1[4] = { 0, 1, 3, 0 }; | |
239 | slatsegB[1]->SetPcbBoards(n1); | |
240 | slatsegB[1]->Init(0); | |
241 | slatsegNB[1]->SetPcbBoards(n1); | |
242 | slatsegNB[1]->Init(0); | |
243 | ||
244 | // Type 222000 for 503, 506, 512, 515 (similar in Ch6) for future official numbering of ALICE | |
245 | // Type 222000 for 501, 507, 557, 551 (similiarin Ch6) for actual numbering in muon code to be changed in jan05 | |
246 | Int_t n2[4] = { 0, 0, 3, 0 }; | |
247 | slatsegB[2]->SetPcbBoards(n2); | |
248 | slatsegB[2]->Init(0); | |
249 | slatsegNB[2]->SetPcbBoards(n2); | |
250 | slatsegNB[2]->Init(0); | |
251 | ||
252 | // Type 220000 for 504, 505, 513, 514 (similar in Ch6) for future official numbering of ALICE | |
253 | // Type 220000 for 500, 508, 558, 550 (similiarin Ch6) for actual numbering in muon code to be changed in jan05 | |
254 | Int_t n3[4] = { 0, 0, 2, 0 }; | |
255 | slatsegB[3]->SetPcbBoards(n3); | |
256 | slatsegB[3]->Init(0); | |
257 | slatsegNB[3]->SetPcbBoards(n3); | |
258 | slatsegNB[3]->Init(0); | |
259 | } | |
24def874 | 260 | |
24def874 | 261 | |
f48459ab | 262 | //*************************************************************************************** |
24def874 | 263 | // Station 4 & 5 |
264 | //**************************************************************************************** | |
265 | ||
f48459ab | 266 | if (chamberId >= 6 && chamberId <= 9) { |
267 | // Type 122330 for 700, 713 in Ch7 (similar for Ch8) for the futur official numbering | |
268 | // Type 122330 for 706, 756 in Ch7 (similar for Ch8) actual numbering in the code to be changed in jan05 | |
269 | // Type 122330 for 900, 913 in Ch9 (similar for Ch10) for the futur official numbering | |
270 | // Type 122330 for 906, 956 in Ch9 (similar for Ch10) actual numbering in the code to be changed in jan05 | |
271 | ||
272 | Int_t n4[4] = { 0, 1, 2, 2 }; | |
273 | slatsegB[4]->SetPcbBoards(n4); | |
274 | slatsegB[4]->Init(0); // 0 detection element id | |
275 | slatsegNB[4]->SetPcbBoards(n4); | |
276 | slatsegNB[4]->Init(0); // 0 detection element id | |
277 | ||
278 | // Type 112233 for 701, 712, 714, 725 in Ch7 (similar for Ch8) for the futur official numbering | |
279 | // Type 112233 for 705, 707, 755, 757 in Ch7 (similar for Ch8) actual numbering in the code to be changed in jan05 | |
280 | // Type 112233 for 901, 902, 911, 912, 914, 915, 924, 925 in Ch9 (similar for Ch10) for the futur official numbering | |
281 | // Type 112233 for 904, 905, 907, 908, 954, 955, 957, 958 in Ch9 (similar for Ch10) actual numbering in the code to be changed in jan05 | |
282 | Int_t n5[4] = { 0, 2, 2, 2 }; | |
283 | slatsegB[5]->SetPcbBoards(n5); | |
284 | slatsegB[5]->Init(0); // 0 detection element id | |
285 | slatsegNB[5]->SetPcbBoards(n5); | |
286 | slatsegNB[5]->Init(0); // 0 detection element id | |
287 | ||
288 | // Type 112230 for 702, 711, 715, 724 in Ch7 (similar for Ch8) for the futur official numbering | |
289 | // Type 112230 for 704, 708, 754, 758 in Ch7 (similar for Ch8) actual numbering in the code to be changed in jan05 | |
290 | Int_t n6[4] = { 0, 2, 2, 1 }; | |
291 | slatsegB[6]->SetPcbBoards(n6); | |
292 | slatsegB[6]->Init(0); // 0 detection element id | |
293 | slatsegNB[6]->SetPcbBoards(n6); | |
294 | slatsegNB[6]->Init(0); // 0 detection element id | |
295 | ||
296 | // Type 222330 for 703, 710, 716, 723 in Ch7 (similar for Ch8) for the futur official numbering | |
297 | // Type 222330 for 703, 709, 753, 759 in Ch7 (similar for Ch8) actual numbering in the code to be changed in jan05 | |
298 | Int_t n7[4] = { 0, 0, 3, 2 }; | |
299 | slatsegB[7]->SetPcbBoards(n7); | |
300 | slatsegB[7]->Init(0); // 0 detection element id | |
301 | slatsegNB[7]->SetPcbBoards(n7); | |
302 | slatsegNB[7]->Init(0); // 0 detection element id | |
303 | ||
304 | // Type 223300 for 704, 709, 717, 722 in Ch7 (similar for Ch8) for the futur official numbering | |
305 | // Type 223300 for 702, 710, 752, 760 in Ch7 (similar for Ch8) actual numbering in the code to be changed in jan05 | |
306 | Int_t n8[4] = { 0, 0, 2, 2 }; | |
307 | slatsegB[8]->SetPcbBoards(n8); | |
308 | slatsegB[8]->Init(0); // 0 detection element id | |
309 | slatsegNB[8]->SetPcbBoards(n8); | |
310 | slatsegNB[8]->Init(0); // 0 detection element id | |
311 | ||
312 | // Type 333000 for 705, 708, 718, 721 in Ch7 (similar for Ch8) for the futur official numbering | |
313 | // Type 333000 for 701, 711, 751, 761 in Ch7 (similar for Ch8) actual numbering in the code to be changed in jan05 | |
314 | // Type 333000 for 906, 907, 919, 920 in Ch9 (similar for Ch10) for the futur official numbering | |
315 | // Type 333000 for 900, 912, 950, 962 in Ch9 (similar for Ch10) actual numbering in the code to be changed in jan05 | |
316 | Int_t n9[4] = { 0, 0, 0, 3 }; | |
317 | slatsegB[9]->SetPcbBoards(n9); | |
318 | slatsegB[9]->Init(0); // 0 detection element id | |
319 | slatsegNB[9]->SetPcbBoards(n9); | |
320 | slatsegNB[9]->Init(0); // 0 detection element id | |
321 | ||
322 | // Type 330000 for 706, 707, 719, 720 in Ch7 (similar for Ch8) for the futur official numbering | |
323 | // Type 330000 for 700, 712, 750, 762 in Ch7 (similar for Ch8) actual numbering in the code to be changed in jan05 | |
324 | Int_t n10[4] = { 0, 0, 0, 2 }; | |
325 | slatsegB[10]->SetPcbBoards(n10); | |
326 | slatsegB[10]->Init(0); // 0 detection element id | |
327 | slatsegNB[10]->SetPcbBoards(n10); | |
328 | slatsegNB[10]->Init(0); // 0 detection element id | |
329 | ||
330 | // Type 222333 for 903, 910, 916, 923 in Ch9 (similar for Ch10) for the futur official numbering | |
331 | // Type 222333 for 903, 909, 953, 959 in Ch9 (similar for Ch10) actual numbering in the code to be changed in jan05 | |
332 | Int_t n11[4] = { 0, 0, 3, 3 }; | |
333 | slatsegB[11]->SetPcbBoards(n11); | |
334 | slatsegB[11]->Init(0); // 0 detection element id | |
335 | slatsegNB[11]->SetPcbBoards(n11); | |
336 | slatsegNB[11]->Init(0); // 0 detection element id | |
24def874 | 337 | |
f48459ab | 338 | // Type 223330 for 904, 909, 917, 922 in Ch9 (similar for Ch10) for the futur official numbering |
339 | // Type 223330 for 902, 910, 952, 960 in Ch9 (similar for Ch10) actual numbering in the code to be changed in jan05 | |
340 | Int_t n12[4] = { 0, 0, 2, 3 }; | |
341 | slatsegB[12]->SetPcbBoards(n12); | |
342 | slatsegB[12]->Init(0); // 0 detection element id | |
343 | slatsegNB[12]->SetPcbBoards(n12); | |
344 | slatsegNB[12]->Init(0); // 0 detection element id | |
345 | ||
346 | // Type 333300 for 905, 908, 918, 921 in Ch9 (similar for Ch10) for the futur official numbering | |
347 | // Type 333300 for 901, 911, 951, 961 in Ch9 (similar for Ch10) actual numbering in the code to be changed in jan05 | |
348 | Int_t n13[4] = { 0, 0, 0, 4 }; | |
349 | slatsegB[13]->SetPcbBoards(n13); | |
350 | slatsegB[13]->Init(0); // 0 detection element id | |
351 | slatsegNB[13]->SetPcbBoards(n13); | |
352 | slatsegNB[13]->Init(0); // 0 detection element id | |
24def874 | 353 | |
f48459ab | 354 | } |
355 | ||
356 | Int_t id0 = 0; | |
357 | ||
358 | // For St3 | |
359 | if (chamberId == 4 || chamberId == 5) { | |
360 | // Create chamber segmentations | |
361 | ||
362 | id0=(chamberId+1)*100; | |
24def874 | 363 | // type 220000 |
f48459ab | 364 | if (cathod == 0) { |
b413978f | 365 | chamberSeg->Add(id0+14, slatsegB[3]); |
366 | chamberSeg->Add(id0+ 4, slatsegB[3]); | |
367 | chamberSeg->Add(id0+13, slatsegB[3]); | |
368 | chamberSeg->Add(id0+ 5, slatsegB[3]); | |
f48459ab | 369 | } else { |
b413978f | 370 | chamberSeg->Add(id0+14, slatsegNB[3]); |
371 | chamberSeg->Add(id0+ 4, slatsegNB[3]); | |
372 | chamberSeg->Add(id0+13, slatsegNB[3]); | |
373 | chamberSeg->Add(id0+ 5, slatsegNB[3]); | |
f48459ab | 374 | } |
24def874 | 375 | // type 222000 |
f48459ab | 376 | if (cathod == 0) { |
b413978f | 377 | chamberSeg->Add(id0+15, slatsegB[2]); |
378 | chamberSeg->Add(id0+ 3, slatsegB[2]); | |
379 | chamberSeg->Add(id0+12, slatsegB[2]); | |
380 | chamberSeg->Add(id0+ 6, slatsegB[2]); | |
f48459ab | 381 | } else { |
b413978f | 382 | chamberSeg->Add(id0+15, slatsegNB[2]); |
383 | chamberSeg->Add(id0+ 3, slatsegNB[2]); | |
384 | chamberSeg->Add(id0+12, slatsegNB[2]); | |
385 | chamberSeg->Add(id0+ 6, slatsegNB[2]); | |
f48459ab | 386 | } |
24def874 | 387 | // type 122200 |
f48459ab | 388 | if (cathod == 0) { |
b413978f | 389 | chamberSeg->Add(id0+16, slatsegB[1]); |
390 | chamberSeg->Add(id0+ 2, slatsegB[1]); | |
391 | chamberSeg->Add(id0+11, slatsegB[1]); | |
392 | chamberSeg->Add(id0+ 7, slatsegB[1]); | |
f48459ab | 393 | } else { |
b413978f | 394 | chamberSeg->Add(id0+16, slatsegNB[1]); |
395 | chamberSeg->Add(id0+ 2, slatsegNB[1]); | |
396 | chamberSeg->Add(id0+11, slatsegNB[1]); | |
397 | chamberSeg->Add(id0+ 7, slatsegNB[1]); | |
f48459ab | 398 | } |
24def874 | 399 | // type 112200 |
f48459ab | 400 | if (cathod == 0) { |
b413978f | 401 | chamberSeg->Add(id0+17, slatsegB[0]); |
402 | chamberSeg->Add(id0, slatsegB[0]); | |
403 | chamberSeg->Add(id0+ 1, slatsegB[0]); | |
404 | chamberSeg->Add(id0+10, slatsegB[0]); | |
405 | chamberSeg->Add(id0+ 9, slatsegB[0]); | |
406 | chamberSeg->Add(id0+ 8, slatsegB[0]); | |
f48459ab | 407 | } else { |
b413978f | 408 | chamberSeg->Add(id0+17, slatsegNB[0]); |
409 | chamberSeg->Add(id0, slatsegNB[0]); | |
410 | chamberSeg->Add(id0+ 1, slatsegNB[0]); | |
411 | chamberSeg->Add(id0+10, slatsegNB[0]); | |
412 | chamberSeg->Add(id0+ 9, slatsegNB[0]); | |
413 | chamberSeg->Add(id0+ 8, slatsegNB[0]); | |
f48459ab | 414 | } |
152d6f4e | 415 | |
24def874 | 416 | } |
417 | ||
f48459ab | 418 | // For St4 |
419 | if (chamberId == 6 || chamberId == 7) { | |
24def874 | 420 | // Create chamber segmentations |
f48459ab | 421 | id0=(chamberId+1)*100; |
24def874 | 422 | // type 122330 |
f48459ab | 423 | if (cathod == 0) { |
b413978f | 424 | chamberSeg->Add(id0+13, slatsegB[4]); |
425 | chamberSeg->Add(id0 , slatsegB[4]); | |
f48459ab | 426 | } else { |
b413978f | 427 | chamberSeg->Add(id0+13, slatsegNB[4]); |
428 | chamberSeg->Add(id0 , slatsegNB[4]); | |
f48459ab | 429 | } |
24def874 | 430 | // type 112233 |
f48459ab | 431 | if (cathod == 0) { |
b413978f | 432 | chamberSeg->Add(id0+14, slatsegB[5]); |
433 | chamberSeg->Add(id0+12, slatsegB[5]); | |
434 | chamberSeg->Add(id0+25, slatsegB[5]); | |
435 | chamberSeg->Add(id0+ 1, slatsegB[5]); | |
f48459ab | 436 | } else { |
b413978f | 437 | chamberSeg->Add(id0+14, slatsegNB[5]); |
438 | chamberSeg->Add(id0+12, slatsegNB[5]); | |
439 | chamberSeg->Add(id0+25, slatsegNB[5]); | |
440 | chamberSeg->Add(id0+ 1, slatsegNB[5]); | |
f48459ab | 441 | } |
24def874 | 442 | // type 112230 |
f48459ab | 443 | if (cathod == 0) { |
b413978f | 444 | chamberSeg->Add(id0+15, slatsegB[6]); |
445 | chamberSeg->Add(id0+11, slatsegB[6]); | |
446 | chamberSeg->Add(id0+24, slatsegB[6]); | |
447 | chamberSeg->Add(id0+ 2, slatsegB[6]); | |
f48459ab | 448 | } else { |
b413978f | 449 | chamberSeg->Add(id0+15, slatsegNB[6]); |
450 | chamberSeg->Add(id0+11, slatsegNB[6]); | |
451 | chamberSeg->Add(id0+24, slatsegNB[6]); | |
452 | chamberSeg->Add(id0+ 2, slatsegNB[6]); | |
f48459ab | 453 | } |
24def874 | 454 | // type 222330 |
f48459ab | 455 | if (cathod == 0) { |
b413978f | 456 | chamberSeg->Add(id0+16, slatsegB[7]); |
457 | chamberSeg->Add(id0+10, slatsegB[7]); | |
458 | chamberSeg->Add(id0+23, slatsegB[7]); | |
f48459ab | 459 | chamberSeg->Add(id0+ 3, slatsegB[7]); |
f48459ab | 460 | } else { |
b413978f | 461 | chamberSeg->Add(id0+16, slatsegNB[7]); |
462 | chamberSeg->Add(id0+10, slatsegNB[7]); | |
463 | chamberSeg->Add(id0+23, slatsegNB[7]); | |
f48459ab | 464 | chamberSeg->Add(id0+ 3, slatsegNB[7]); |
f48459ab | 465 | } |
24def874 | 466 | // type 223300 |
f48459ab | 467 | if (cathod == 0) { |
b413978f | 468 | chamberSeg->Add(id0+17, slatsegB[8]); |
469 | chamberSeg->Add(id0+ 9, slatsegB[8]); | |
470 | chamberSeg->Add(id0+22, slatsegB[8]); | |
471 | chamberSeg->Add(id0+ 4, slatsegB[8]); | |
f48459ab | 472 | } else { |
b413978f | 473 | chamberSeg->Add(id0+17, slatsegNB[8]); |
474 | chamberSeg->Add(id0+ 9, slatsegNB[8]); | |
475 | chamberSeg->Add(id0+22, slatsegNB[8]); | |
476 | chamberSeg->Add(id0+ 4, slatsegNB[8]); | |
f48459ab | 477 | } |
24def874 | 478 | // type 333000 |
f48459ab | 479 | if (cathod == 0) { |
b413978f | 480 | chamberSeg->Add(id0+18, slatsegB[9]); |
481 | chamberSeg->Add(id0+ 8, slatsegB[9]); | |
482 | chamberSeg->Add(id0+21, slatsegB[9]); | |
483 | chamberSeg->Add(id0+ 5, slatsegB[9]); | |
f48459ab | 484 | } else { |
b413978f | 485 | chamberSeg->Add(id0+18, slatsegNB[9]); |
486 | chamberSeg->Add(id0+ 8, slatsegNB[9]); | |
487 | chamberSeg->Add(id0+21, slatsegNB[9]); | |
488 | chamberSeg->Add(id0+ 5, slatsegNB[9]); | |
f48459ab | 489 | } |
24def874 | 490 | // type 330000 |
f48459ab | 491 | if (cathod == 0) { |
b413978f | 492 | chamberSeg->Add(id0+19, slatsegB[10]); |
493 | chamberSeg->Add(id0+ 7, slatsegB[10]); | |
494 | chamberSeg->Add(id0+20, slatsegB[10]); | |
495 | chamberSeg->Add(id0+ 6, slatsegB[10]); | |
f48459ab | 496 | } else { |
b413978f | 497 | chamberSeg->Add(id0+19, slatsegNB[10]); |
498 | chamberSeg->Add(id0+ 7, slatsegNB[10]); | |
499 | chamberSeg->Add(id0+20, slatsegNB[10]); | |
500 | chamberSeg->Add(id0+ 6, slatsegNB[10]); | |
f48459ab | 501 | } |
24def874 | 502 | } |
503 | ||
f48459ab | 504 | // For St5 |
505 | if (chamberId == 8 || chamberId == 9) { | |
506 | // Create chamber segmentations | |
507 | id0=(chamberId+1)*100; | |
24def874 | 508 | // type 122330 |
f48459ab | 509 | if (cathod == 0) { |
b413978f | 510 | chamberSeg->Add(id0+13, slatsegB[4]); |
511 | chamberSeg->Add(id0 , slatsegB[4]); | |
f48459ab | 512 | } else { |
b413978f | 513 | chamberSeg->Add(id0+13, slatsegNB[4]); |
514 | chamberSeg->Add(id0 , slatsegNB[4]); | |
f48459ab | 515 | } |
24def874 | 516 | // type 112233 |
f48459ab | 517 | if (cathod == 0) { |
b413978f | 518 | chamberSeg->Add(id0+15, slatsegB[5]); |
519 | chamberSeg->Add(id0+14, slatsegB[5]); | |
520 | chamberSeg->Add(id0+12, slatsegB[5]); | |
521 | chamberSeg->Add(id0+11, slatsegB[5]); | |
522 | chamberSeg->Add(id0+24, slatsegB[5]); | |
523 | chamberSeg->Add(id0+25, slatsegB[5]); | |
524 | chamberSeg->Add(id0+ 1, slatsegB[5]); | |
525 | chamberSeg->Add(id0+ 2, slatsegB[5]); | |
f48459ab | 526 | } else { |
b413978f | 527 | chamberSeg->Add(id0+15, slatsegNB[5]); |
528 | chamberSeg->Add(id0+14, slatsegNB[5]); | |
529 | chamberSeg->Add(id0+12, slatsegNB[5]); | |
530 | chamberSeg->Add(id0+11, slatsegNB[5]); | |
531 | chamberSeg->Add(id0+24, slatsegNB[5]); | |
532 | chamberSeg->Add(id0+25, slatsegNB[5]); | |
533 | chamberSeg->Add(id0+ 1, slatsegNB[5]); | |
534 | chamberSeg->Add(id0+ 2, slatsegNB[5]); | |
f48459ab | 535 | } |
24def874 | 536 | // type 222333 |
f48459ab | 537 | if (cathod == 0) { |
b413978f | 538 | chamberSeg->Add(id0+16, slatsegB[11]); |
539 | chamberSeg->Add(id0+10, slatsegB[11]); | |
540 | chamberSeg->Add(id0+23, slatsegB[11]); | |
f48459ab | 541 | chamberSeg->Add(id0+ 3, slatsegB[11]); |
f48459ab | 542 | } else { |
b413978f | 543 | chamberSeg->Add(id0+16, slatsegNB[11]); |
544 | chamberSeg->Add(id0+10, slatsegNB[11]); | |
545 | chamberSeg->Add(id0+23, slatsegNB[11]); | |
f48459ab | 546 | chamberSeg->Add(id0+ 3, slatsegNB[11]); |
f48459ab | 547 | } |
24def874 | 548 | // type 223330 |
f48459ab | 549 | if (cathod == 0) { |
b413978f | 550 | chamberSeg->Add(id0+17, slatsegB[12]); |
551 | chamberSeg->Add(id0+ 9, slatsegB[12]); | |
552 | chamberSeg->Add(id0+22, slatsegB[12]); | |
553 | chamberSeg->Add(id0+ 4, slatsegB[12]); | |
f48459ab | 554 | } else { |
b413978f | 555 | chamberSeg->Add(id0+17, slatsegNB[12]); |
556 | chamberSeg->Add(id0+ 9, slatsegNB[12]); | |
557 | chamberSeg->Add(id0+22, slatsegNB[12]); | |
558 | chamberSeg->Add(id0+ 4, slatsegNB[12]); | |
f48459ab | 559 | } |
24def874 | 560 | // type 333300 |
f48459ab | 561 | if (cathod == 0) { |
b413978f | 562 | chamberSeg->Add(id0+18, slatsegB[13]); |
563 | chamberSeg->Add(id0+ 8, slatsegB[13]); | |
564 | chamberSeg->Add(id0+21, slatsegB[13]); | |
565 | chamberSeg->Add(id0+ 5, slatsegB[13]); | |
f48459ab | 566 | } else { |
b413978f | 567 | chamberSeg->Add(id0+18, slatsegNB[13]); |
568 | chamberSeg->Add(id0+ 8, slatsegNB[13]); | |
569 | chamberSeg->Add(id0+21, slatsegNB[13]); | |
570 | chamberSeg->Add(id0+ 5, slatsegNB[13]); | |
f48459ab | 571 | } |
24def874 | 572 | // type 333000 |
f48459ab | 573 | if (cathod == 0) { |
b413978f | 574 | chamberSeg->Add(id0+19, slatsegB[9]); |
575 | chamberSeg->Add(id0+ 7, slatsegB[9]); | |
576 | chamberSeg->Add(id0+20, slatsegB[9]); | |
577 | chamberSeg->Add(id0+ 6, slatsegB[9]); | |
f48459ab | 578 | } else { |
b413978f | 579 | chamberSeg->Add(id0+19, slatsegNB[9]); |
580 | chamberSeg->Add(id0+ 7, slatsegNB[9]); | |
581 | chamberSeg->Add(id0+20, slatsegNB[9]); | |
582 | chamberSeg->Add(id0+ 6, slatsegNB[9]); | |
f48459ab | 583 | } |
584 | } | |
585 | ||
586 | ||
587 | if (!id0) { | |
588 | AliWarning(Form("Segmentation for chamber %d , cathod %d is not yet defined", | |
589 | chamberId, cathod)); | |
590 | return 0; | |
24def874 | 591 | |
152d6f4e | 592 | } |
f48459ab | 593 | |
594 | DrawSegmentation(chamberSeg); | |
595 | return chamberSeg; | |
596 | ||
152d6f4e | 597 | } |
58d53b65 | 598 | //_____________________________________________________________________________ |
79b4ba23 | 599 | |
58d53b65 | 600 | AliMUONGeometrySegmentation* |
601 | AliMUONTest::CreateTriggerSegmentation(Int_t chamberId, Int_t cathod) | |
602 | { | |
603 | // Create Trigger geometry segmentation for given chamber and cathod | |
604 | ||
605 | printf("in CreateTriggerSegmentation chamber=%d cathode=%d\n", | |
606 | chamberId,cathod); | |
607 | AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON"); | |
608 | if (!muon) { | |
609 | AliFatal("MUON detector not defined."); | |
610 | return 0; | |
611 | } | |
612 | ||
65bcb249 | 613 | // AliMUONGeometrySegmentation *chamberSeg[2] new AliMUONGeometrySegmentation(muon->Chamber(chamberId).GetGeometry()); |
614 | ||
58d53b65 | 615 | AliMUONGeometrySegmentation *chamberSeg = new AliMUONGeometrySegmentation(muon->Chamber(chamberId).GetGeometry()); |
616 | ||
79b4ba23 | 617 | //Trigger Segmentation |
58d53b65 | 618 | AliMUONTriggerSegmentation *trigSegX[9]; |
619 | AliMUONTriggerSegmentation *trigSegY[9]; | |
620 | for(Int_t i=0; i<9; i++) { | |
79b4ba23 | 621 | trigSegX[i] = new AliMUONTriggerSegmentation(1); |
622 | trigSegY[i] = new AliMUONTriggerSegmentation(0); | |
623 | trigSegX[i]->SetLineNumber(9-i); | |
624 | trigSegY[i]->SetLineNumber(9-i); | |
58d53b65 | 625 | } |
626 | ||
627 | AliMUONChamber *iChamber, *iChamber1; | |
628 | iChamber1 = &muon->Chamber(10); | |
629 | iChamber = &muon->Chamber(chamberId); | |
65bcb249 | 630 | Float_t zpos1= iChamber1->Z(); |
631 | Float_t zpos = iChamber->Z(); | |
58d53b65 | 632 | Float_t zRatio = zpos / zpos1; |
633 | ||
634 | // init | |
79b4ba23 | 635 | Float_t stripWidth[3]={0.,0.,0.}; // 1.0625 2.125 4.25 |
636 | Float_t stripLength[4]={0.,0.,0.,0.}; // 17. 34. 51. 68. | |
637 | for (Int_t i=0; i<3; i++) | |
638 | stripWidth[i]=AliMUONTriggerConstants::StripWidth(i)*zRatio; | |
639 | for (Int_t i=0; i<4; i++) | |
640 | stripLength[i]=AliMUONTriggerConstants::StripLength(i)*zRatio; | |
58d53b65 | 641 | Int_t nStrip[7]={0,0,0,0,0,0,0}; |
642 | Float_t stripYsize[7]={0.,0.,0.,0.,0.,0.,0.}; | |
643 | Float_t stripXsize[7]={0.,0.,0.,0.,0.,0.,0.}; | |
644 | ||
79b4ba23 | 645 | // chamber 8 0 cathode 0 |
58d53b65 | 646 | for (Int_t i=0; i<7; i++) nStrip[i]=16; |
79b4ba23 | 647 | for (Int_t i=0; i<7; i++) stripYsize[i]=stripWidth[2]; |
648 | for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1]; | |
649 | stripXsize[6]=stripLength[2]; | |
650 | trigSegX[8]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
651 | trigSegX[0]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
652 | ||
653 | // chamber 8 7 1 0 cathode 1 | |
58d53b65 | 654 | for (Int_t i=0; i<6; i++) nStrip[i]=8; |
27b0e0ab | 655 | nStrip[6]=16; |
79b4ba23 | 656 | for (Int_t i=0; i<7; i++) stripYsize[i]=stripLength[3]; |
657 | for (Int_t i=0; i<7; i++) stripXsize[i]=stripWidth[2]; | |
658 | trigSegY[8]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
659 | trigSegY[7]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
660 | trigSegY[1]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
661 | trigSegY[0]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
58d53b65 | 662 | |
79b4ba23 | 663 | // chamber 7 6 2 1 cathode 0 |
58d53b65 | 664 | for (Int_t i=0; i<6; i++) nStrip[i]=32; |
58d53b65 | 665 | nStrip[6]=16; |
79b4ba23 | 666 | for (Int_t i=0; i<6; i++) stripYsize[i]=stripWidth[1]; |
667 | stripYsize[6]=stripWidth[2]; | |
668 | for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1]; | |
669 | stripXsize[6]=stripLength[2]; | |
670 | trigSegX[7]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
671 | trigSegX[6]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
672 | trigSegX[2]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
673 | trigSegX[1]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
674 | ||
675 | // chamber 6 2 cathode 1 | |
676 | for (Int_t i=0; i<5; i++) nStrip[i]=16; | |
677 | for (Int_t i=5; i<6; i++) nStrip[i]=8; | |
678 | nStrip[6]=16; | |
679 | for (Int_t i=0; i<7; i++) stripYsize[i]=stripLength[3]; | |
680 | for (Int_t i=0; i<5; i++) stripXsize[i]=stripWidth[1]; | |
681 | for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2]; | |
682 | trigSegY[6]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
683 | trigSegY[2]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
684 | ||
685 | // chamber 5 3 cathode 0 | |
58d53b65 | 686 | nStrip[0]=48; |
79b4ba23 | 687 | for (Int_t i=1; i<3; i++) nStrip[i]=64; |
58d53b65 | 688 | for (Int_t i=3; i<6; i++) nStrip[i]=32; |
79b4ba23 | 689 | nStrip[6]=16; |
690 | for (Int_t i=0; i<3; i++) stripYsize[i]=stripWidth[0]; | |
691 | for (Int_t i=3; i<6; i++) stripYsize[i]=stripWidth[1]; | |
692 | stripYsize[6]=stripWidth[2]; | |
693 | for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1]; | |
694 | stripXsize[6]=stripLength[2]; | |
695 | trigSegX[5]->Init(0,nStrip,stripYsize,stripXsize,stripLength[0]); | |
696 | trigSegX[3]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
697 | ||
698 | // chamber 5 3 cathode 1 | |
58d53b65 | 699 | for (Int_t i=0; i<5; i++) nStrip[i]=16; |
79b4ba23 | 700 | for (Int_t i=5; i<6; i++) nStrip[5]=8; |
701 | nStrip[6]=16; | |
702 | stripYsize[0]=stripLength[2]; | |
703 | for (Int_t i=1; i<8; i++) stripYsize[i]=stripLength[3]; | |
704 | for (Int_t i=0; i<5; i++) stripXsize[i]=stripWidth[1]; | |
705 | for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2]; | |
706 | trigSegY[5]->Init(0,nStrip,stripYsize,stripXsize,stripLength[0]); | |
707 | trigSegY[3]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
58d53b65 | 708 | |
709 | // chamber 4 cathode 0 | |
710 | nStrip[0]=0; | |
711 | for (Int_t i=1; i<3; i++) nStrip[i]=64; | |
712 | for (Int_t i=3; i<6; i++) nStrip[i]=32; | |
713 | nStrip[6]=16; | |
714 | stripYsize[0]=0.; | |
79b4ba23 | 715 | for (Int_t i=1; i<3; i++) stripYsize[i]=stripWidth[0]; |
716 | for (Int_t i=3; i<6; i++) stripYsize[i]=stripWidth[1]; | |
717 | stripYsize[6]=stripWidth[2]; | |
58d53b65 | 718 | stripXsize[0]=0; |
79b4ba23 | 719 | stripXsize[1]=stripLength[0]; |
720 | for (Int_t i=2; i<6; i++) stripXsize[i]=stripLength[1]; | |
721 | stripXsize[6]=stripLength[2]; | |
722 | trigSegX[4]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
58d53b65 | 723 | |
724 | // chamber 4 cathode 1 | |
725 | nStrip[0]=0; | |
726 | nStrip[1]=8; | |
727 | for (Int_t i=2; i<5; i++) nStrip[i]=16; | |
79b4ba23 | 728 | for (Int_t i=5; i<6; i++) nStrip[i]=8; |
729 | nStrip[6]=16; | |
58d53b65 | 730 | stripYsize[0]=0.; |
79b4ba23 | 731 | for (Int_t i=1; i<7; i++) stripYsize[i]=stripLength[3]; |
58d53b65 | 732 | stripXsize[0]=0.; |
79b4ba23 | 733 | for (Int_t i=1; i<5; i++) stripXsize[i]=stripWidth[1]; |
734 | for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2]; | |
735 | trigSegY[4]->Init(0,nStrip,stripYsize,stripXsize,0.); | |
58d53b65 | 736 | |
737 | Int_t icount=chamberId-10; // chamber counter (0 1 2 3) | |
738 | Int_t id0=(10+icount+1)*100; | |
739 | ||
65bcb249 | 740 | if (cathod==0) { |
741 | chamberSeg->Add(id0+0, trigSegX[4]); | |
742 | chamberSeg->Add(id0+1, trigSegX[5]); | |
743 | chamberSeg->Add(id0+2, trigSegX[6]); | |
744 | chamberSeg->Add(id0+3, trigSegX[7]); | |
745 | chamberSeg->Add(id0+4, trigSegX[8]); | |
746 | chamberSeg->Add(id0+5, trigSegX[8]); | |
747 | chamberSeg->Add(id0+6, trigSegX[7]); | |
748 | chamberSeg->Add(id0+7, trigSegX[6]); | |
749 | chamberSeg->Add(id0+8, trigSegX[5]); | |
750 | chamberSeg->Add(id0+9, trigSegX[4]); | |
751 | chamberSeg->Add(id0+10, trigSegX[3]); | |
752 | chamberSeg->Add(id0+11, trigSegX[2]); | |
753 | chamberSeg->Add(id0+12, trigSegX[1]); | |
754 | chamberSeg->Add(id0+13, trigSegX[0]); | |
755 | chamberSeg->Add(id0+14, trigSegX[0]); | |
756 | chamberSeg->Add(id0+15, trigSegX[1]); | |
757 | chamberSeg->Add(id0+16, trigSegX[2]); | |
758 | chamberSeg->Add(id0+17, trigSegX[3]); | |
759 | } else if (cathod==1) { | |
760 | chamberSeg->Add(id0+0, trigSegY[4]); | |
761 | chamberSeg->Add(id0+1, trigSegY[5]); | |
762 | chamberSeg->Add(id0+2, trigSegY[6]); | |
763 | chamberSeg->Add(id0+3, trigSegY[7]); | |
764 | chamberSeg->Add(id0+4, trigSegY[8]); | |
765 | chamberSeg->Add(id0+5, trigSegY[8]); | |
766 | chamberSeg->Add(id0+6, trigSegY[7]); | |
767 | chamberSeg->Add(id0+7, trigSegY[6]); | |
768 | chamberSeg->Add(id0+8, trigSegY[5]); | |
769 | chamberSeg->Add(id0+9, trigSegY[4]); | |
770 | chamberSeg->Add(id0+10, trigSegY[3]); | |
771 | chamberSeg->Add(id0+11, trigSegY[2]); | |
772 | chamberSeg->Add(id0+12, trigSegY[1]); | |
773 | chamberSeg->Add(id0+13, trigSegY[0]); | |
774 | chamberSeg->Add(id0+14, trigSegY[0]); | |
775 | chamberSeg->Add(id0+15, trigSegY[1]); | |
776 | chamberSeg->Add(id0+16, trigSegY[2]); | |
777 | chamberSeg->Add(id0+17, trigSegY[3]); | |
58d53b65 | 778 | } |
65bcb249 | 779 | |
58d53b65 | 780 | |
58d53b65 | 781 | if (!id0) { |
782 | AliWarning(Form("Segmentation for chamber %d , cathod %d is not yet defined",chamberId, cathod)); | |
783 | return 0; | |
784 | } | |
785 | ||
786 | DrawSegmentation(chamberSeg); | |
787 | return chamberSeg; | |
788 | } | |
789 | ||
152d6f4e | 790 | // |
791 | // public methods | |
792 | // | |
793 | ||
794 | //______________________________________________________________________________ | |
795 | AliMUONGeometrySegmentation* | |
796 | AliMUONTest::CreateSegmentation(Int_t chamberId, Int_t cath) | |
797 | { | |
798 | // Create geometry segmentation for the specified chamber and cathod | |
799 | ||
800 | switch (chamberId) { | |
801 | ||
802 | // Station1 | |
803 | case 0: | |
804 | case 1: | |
805 | return CreateSt1Segmentation(chamberId, cath); | |
806 | break; | |
807 | ||
808 | // Station2 | |
809 | case 2: | |
810 | case 3: | |
580c28fd | 811 | return CreateSt2Segmentation(chamberId, cath); |
152d6f4e | 812 | break; |
813 | ||
814 | // Slat stations | |
815 | case 4: | |
816 | case 5: | |
817 | case 6: | |
818 | case 7: | |
819 | case 8: | |
820 | case 9: | |
821 | return CreateSlatSegmentation(chamberId, cath); | |
822 | break; | |
823 | ||
824 | // Trigger stations | |
825 | case 10: | |
826 | case 11: | |
827 | case 12: | |
828 | case 13: | |
58d53b65 | 829 | return CreateTriggerSegmentation(chamberId, cath); |
152d6f4e | 830 | break; |
831 | ||
832 | default: | |
833 | AliWarning("Wrong chamber Id"); | |
834 | return 0; | |
835 | break; | |
836 | } | |
837 | } | |
152d6f4e | 838 | //______________________________________________________________________________ |
839 | void AliMUONTest::DetElemTransforms() | |
840 | { | |
841 | // | |
842 | AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON"); | |
843 | if (!muon) { | |
844 | AliFatal("MUON detector not defined."); | |
845 | return; | |
846 | } | |
847 | ||
848 | // Loop over chambers | |
849 | for (Int_t i=0; i<AliMUONConstants::NCh(); i++) { | |
850 | ||
851 | AliMUONGeometryModule* geometry = muon->Chamber(i).GetGeometry(); | |
852 | AliMUONGeometryStore* detElements = geometry->GetDetElementStore(); | |
853 | ||
854 | // Loop over detection elements | |
855 | for (Int_t j=0; j<detElements->GetNofEntries(); j++) { | |
856 | ||
857 | //Int_t detElemId = geometry->GetDetElemId(j); | |
858 | Int_t detElemId = detElements->GetEntry(j)->GetUniqueID(); | |
859 | cout << "Detection element Id: " << detElemId << endl; | |
860 | ||
861 | Double_t x, y, z; | |
862 | geometry->Local2Global(detElemId, 0., 0., 0., x, y, z); | |
863 | cout << " Global DE position: " | |
864 | << x << ", " << y << ", " << z << endl; | |
865 | ||
866 | Double_t x2, y2, z2; | |
867 | geometry->Global2Local(detElemId, 0., 0., 0., x2, y2, z2); | |
868 | cout << " ALIC center in the local frame: " | |
869 | << x2 << ", " << y2 << ", " << z2 << endl; | |
870 | ||
871 | Double_t x3, y3, z3; | |
872 | geometry->Global2Local(detElemId, x, y, z, x3, y3, z3); | |
873 | cout << " Back in the local frame: " | |
874 | << x3 << ", " << y3 << ", " << z3 << endl; | |
875 | cout << endl; | |
876 | } | |
24def874 | 877 | } |
152d6f4e | 878 | } |
879 | ||
152d6f4e | 880 | //______________________________________________________________________________ |
881 | void AliMUONTest::ForWhole(AliMUONTests testCase) | |
882 | { | |
883 | // Perform test for all chambers and first cathod | |
884 | ||
885 | AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON"); | |
886 | if (!muon) { | |
887 | AliFatal("MUON detector not defined."); | |
888 | return; | |
889 | } | |
890 | ||
891 | TStopwatch timer; | |
892 | timer.Start(); | |
893 | ||
894 | // Loop over chambers | |
580c28fd | 895 | for (Int_t iChamber=0; iChamber<AliMUONConstants::NCh(); iChamber++) { |
896 | // for (Int_t iChamber=0; iChamber<3; iChamber=iChamber+2) { | |
152d6f4e | 897 | |
898 | // Loop over cathods | |
d640924e | 899 | //for (Int_t cath=0; cath<2; cath++) { |
900 | for (Int_t cath=0; cath<1; cath++) { | |
152d6f4e | 901 | |
902 | AliMUONGeometrySegmentation* segmentation | |
903 | = CreateSegmentation(iChamber, cath); | |
904 | ||
905 | if (!segmentation) continue; | |
906 | ||
907 | cout << setw(6) << "Pads in chamber " << iChamber | |
908 | << " cathod " << cath << endl; | |
909 | cout << "===================================" << endl; | |
910 | ||
911 | ForSegmentation(testCase, segmentation); | |
912 | ||
913 | //if (testCase == kDrawPads) { | |
914 | //} | |
915 | } | |
916 | } | |
917 | timer.Stop(); | |
918 | timer.Print(); | |
919 | } | |
920 | ||
921 | //______________________________________________________________________________ | |
922 | void AliMUONTest::ForSegmentation(AliMUONTests testCase, | |
923 | AliMUONGeometrySegmentation *segmentation) | |
924 | { | |
925 | // Perform test for a given segmentation | |
926 | ||
927 | TStopwatch timer; | |
928 | timer.Start(); | |
929 | ||
930 | Before(testCase); | |
931 | ||
932 | // Loop over detection elements | |
933 | // | |
934 | AliMUONGeometryStore* detElements | |
935 | = segmentation->GetGeometry()->GetDetElementStore(); | |
936 | ||
937 | for (Int_t j=0; j<detElements->GetNofEntries(); j++) { | |
938 | ||
939 | Int_t detElemId = detElements->GetEntry(j)->GetUniqueID(); | |
940 | cout << "Detection element id: " << detElemId << endl; | |
941 | ||
942 | ForDetElement(testCase, detElemId, segmentation); | |
943 | } | |
944 | ||
945 | After(testCase); | |
946 | ||
947 | timer.Stop(); | |
948 | timer.Print(); | |
24def874 | 949 | } |
152d6f4e | 950 | |
951 | //______________________________________________________________________________ | |
952 | void AliMUONTest::ForDetElement(AliMUONTests testCase, | |
953 | Int_t detElemId, | |
954 | AliMUONGeometrySegmentation *segmentation) | |
955 | { | |
956 | // Prints global pad positions for given detection element | |
957 | // in a given geometry segmentation | |
958 | ||
959 | ||
960 | Int_t counter = 0; | |
961 | ||
962 | // Loop over pads in a detection element | |
963 | // | |
964 | ||
965 | for(Int_t ix=1; ix<=segmentation->Npx(detElemId); ix++) | |
966 | for(Int_t iy=1; iy<=segmentation->Npy(detElemId); iy++) | |
967 | { | |
968 | switch (testCase) { | |
969 | ||
970 | case kPrintPads: | |
971 | PrintPad(counter, detElemId, ix, iy, segmentation); | |
972 | break; | |
973 | ||
974 | case kDrawPads: | |
975 | DrawPad(counter, detElemId, ix, iy, segmentation); | |
976 | break; | |
977 | } | |
978 | } | |
979 | } | |
980 | ||
981 | //______________________________________________________________________________ | |
982 | void AliMUONTest::Before(AliMUONTests testCase) | |
983 | { | |
984 | // Do some initialization if necessary | |
985 | ||
986 | switch (testCase) { | |
987 | ||
988 | case kPrintPads: | |
989 | break; | |
990 | ||
991 | case kDrawPads: | |
992 | if (!fCanvas) { | |
993 | fCanvas = new TCanvas("c1","c1", 0, 0, 600, 600); | |
994 | fCanvas->Range(-300,-300, 300, 300); | |
995 | fCanvas->cd(); | |
996 | } | |
997 | break; | |
998 | } | |
999 | } | |
1000 | ||
1001 | //______________________________________________________________________________ | |
1002 | void AliMUONTest::After(AliMUONTests testCase) | |
1003 | { | |
1004 | // Do some cleanup if necessary | |
1005 | ||
1006 | switch (testCase) { | |
1007 | ||
1008 | case kPrintPads: | |
1009 | break; | |
1010 | ||
1011 | case kDrawPads: | |
1012 | fCanvas->Update(); | |
1013 | cout << "Print any key + enter to continue ..." << endl; | |
1014 | char c; | |
1015 | cin >> c; | |
1016 | fCanvas->Clear(); | |
1017 | break; | |
1018 | } | |
1019 | } | |
1020 | ||
1021 | //______________________________________________________________________________ | |
1022 | void AliMUONTest::PrintPad(Int_t& counter, | |
1023 | Int_t detElemId, Int_t ix, Int_t iy, | |
1024 | AliMUONGeometrySegmentation* segmentation) | |
1025 | { | |
1026 | // Prints global pad positions for the given pad | |
1027 | ||
1028 | Float_t x, y, z; | |
1029 | Bool_t success | |
1030 | = segmentation->GetPadC(detElemId, ix, iy, x, y, z); | |
1031 | ||
152d6f4e | 1032 | cout << setw(6) << "counter " << counter++ << " "; |
1033 | cout << "Pad indices: ( " << detElemId << "; " << ix << ", " << iy << " ) " ; | |
580c28fd | 1034 | |
1035 | if (success) { | |
1036 | cout << "Pad position: ( " << x << ", " << y << ", " << z << " ); "; | |
1037 | Int_t sector = segmentation->Sector(detElemId, ix, iy); | |
1038 | Float_t dpx = segmentation->Dpx(detElemId, sector); | |
1039 | Float_t dpy = segmentation->Dpy(detElemId, sector); | |
1040 | cout << " dimensions: ( " << dpx << ", " << dpy << " )" << endl; | |
1041 | } | |
1042 | else { | |
1043 | counter--; | |
1044 | cout << "... no pad " << endl; | |
1045 | } | |
152d6f4e | 1046 | } |
1047 | ||
1048 | //______________________________________________________________________________ | |
1049 | void AliMUONTest::DrawPad(Int_t& counter, | |
1050 | Int_t detElemId, Int_t ix, Int_t iy, | |
1051 | AliMUONGeometrySegmentation* segmentation) | |
1052 | { | |
1053 | // Prints global pad positions for the given pad | |
1054 | ||
1055 | Float_t x, y, z; | |
1056 | Bool_t success | |
1057 | = segmentation->GetPadC(detElemId, ix, iy, x, y, z); | |
1058 | ||
1059 | if (!success) return; | |
1060 | ||
1061 | // PrintPad(counter,detElemId, ix, iy, segmentation); | |
1062 | ||
1063 | counter++; | |
1064 | ||
1065 | Int_t sector = segmentation->Sector(detElemId, ix, iy); | |
1066 | Float_t dpx = segmentation->Dpx(detElemId, sector); | |
1067 | Float_t dpy = segmentation->Dpy(detElemId, sector); | |
1068 | ||
1069 | //printf(" ***** Pad position is ix: %d iy: %d x: %f y: %f sector: %d dpx: %f dpy: %f \n", | |
1070 | // ix, iy, x, y, sector, dpx, dpy); | |
1071 | ||
6b1e4b22 | 1072 | if (!fCanvas) Before(kDrawPads); |
1073 | ||
152d6f4e | 1074 | fCanvas->cd(); |
1075 | TPave* pave = new TPave(x-dpx/2., y-dpy/2., x+dpx/2., y+dpy/2., 1); | |
1076 | pave->Draw(); | |
1077 | } | |
1078 | ||
1079 | //______________________________________________________________________________ | |
f48459ab | 1080 | void AliMUONTest::DrawSegmentation(AliMUONGeometrySegmentation *seg) |
152d6f4e | 1081 | { |
1082 | // TBR | |
1083 | ||
1084 | // Drawing slat504 | |
1085 | Int_t ix, iy, deId; | |
1086 | Float_t x, y, z; | |
1087 | Float_t dpx, dpy; | |
1088 | // TH2F * frame = new TH2F(" "," ",10,-10.,245.,10, -5., 45.); | |
f48459ab | 1089 | // TH2F * frame = new TH2F(" "," ",10,-300.,300.,10, -300., 300.); |
65bcb249 | 1090 | TH2F * frame = new TH2F(" "," ",10,-350.,350.,10, -350., 350.); |
152d6f4e | 1091 | frame->Draw(); |
1092 | // (new TPave( 0., 0., 40., 40.,2))->Draw(); | |
1093 | // (new TPave( 40., 0., 80., 40.,2))->Draw(); | |
1094 | // (new TPave( 80., 0.,120., 40.,2))->Draw(); | |
1095 | // (new TPave(120., 0.,160., 40.,2))->Draw(); | |
1096 | // (new TPave(160., 0.,200., 40.,2))->Draw(); | |
1097 | // (new TPave(200., 0.,240., 40.,2))->Draw(); | |
1098 | ||
f48459ab | 1099 | // Loop over detection elements |
1100 | // | |
1101 | AliMUONGeometryStore* detElements | |
1102 | = seg->GetGeometry()->GetDetElementStore(); | |
1103 | ||
1104 | for (Int_t iDE=0; iDE<detElements->GetNofEntries(); iDE++) { | |
152d6f4e | 1105 | |
f48459ab | 1106 | deId = detElements->GetEntry(iDE)->GetUniqueID(); |
65bcb249 | 1107 | |
f48459ab | 1108 | cout << "Detection element id: " << deId << endl; |
1109 | ||
1110 | ||
1111 | // for ( seg->FirstPad(detElementId, 0., 0., 0., 100., 100.); | |
1112 | // seg->MorePads(detElementId); | |
1113 | // seg->NextPad(detElementId) ) { | |
1114 | for(ix=1; ix<=seg->Npx(deId); ix++) { | |
1115 | for(iy=1; iy<=seg->Npy(deId); iy++) { | |
152d6f4e | 1116 | |
f48459ab | 1117 | seg->GetPadC(deId, ix, iy, x, y, z); |
1118 | Int_t sector = seg->Sector(deId, ix, iy); | |
1119 | dpx = seg->Dpx(deId,sector); | |
1120 | dpy = seg->Dpy(deId,sector); | |
152d6f4e | 1121 | |
f48459ab | 1122 | //printf(" ***** Pad position is ix: %d iy: %d x: %f y: %f sector: %d dpx: %f dpy: %f \n",ix, iy, x, y, sector, dpx, dpy); |
1123 | (new TPave(x-dpx/2., y-dpy/2., x+dpx/2., y+dpy/2., 1))->Draw(); | |
152d6f4e | 1124 | } |
f48459ab | 1125 | |
152d6f4e | 1126 | } |
1127 | } | |
1128 | } | |
1129 | ||
58d53b65 | 1130 | |
1131 |