]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCv0.cxx
Medium array is now private for each module
[u/mrichter/AliRoot.git] / TPC / AliTPCv0.cxx
CommitLineData
fe4da5cc 1///////////////////////////////////////////////////////////////////////////////
2// //
3// Time Projection Chamber version 0 -- "coarse" TPC //
4// //
5//Begin_Html
6/*
1439f98e 7<img src="picts/AliTPCv0Class.gif">
fe4da5cc 8*/
9//End_Html
10// //
11// //
12///////////////////////////////////////////////////////////////////////////////
13
14#include <TMath.h>
15#include <TGeometry.h>
16#include <TNode.h>
17#include <TTUBE.h>
18#include "AliTPCv0.h"
19#include "AliRun.h"
20#include <iostream.h>
21#include <fstream.h>
22
23#include "AliMC.h"
24#include "AliConst.h"
25
26ClassImp(AliTPCv0)
27
28//_____________________________________________________________________________
29AliTPCv0::AliTPCv0(const char *name, const char *title)
30 :AliTPC(name, title)
31{
32 //
33 // Standard creator for TPC version 0
34 //
35}
36
37//_____________________________________________________________________________
38void AliTPCv0::CreateGeometry()
39{
40 //
41 // Creation of the TPC coarse geometry (version 0)
42 // Origin Marek Kowalski Crakow
43 //
44 //Begin_Html
45 /*
1439f98e 46 <img src="picts/AliTPCv0.gif">
fe4da5cc 47 */
48 //End_Html
49 //Begin_Html
50 /*
1439f98e 51 <img src="picts/AliTPCv0Tree.gif">
fe4da5cc 52 */
53 //End_Html
54
55 AliMC* pMC = AliMC::GetMC();
56
ad51aeb0 57 Int_t *idtmed = fIdtmed->GetArray()-399;
fe4da5cc 58
59 Float_t tana, rlsl, wlsl, rssl, rlsu, wssl, wlsu,
60 rssu, wssu, alpha, x, y, sec_thick;
61
62 Float_t x1, z0, z1, x2, theta1, theta2, theta3, dm[21];
63 Int_t il, iu;
64 Float_t z_side;
65 Int_t idrotm[100];
66
67 Float_t x0l, x0u;
68 Int_t idr;
69 //Float_t thl, thu;
70 Float_t opl, opu, phi1, phi2, phi3;
71
72 // ----------------------------------------------------
73 // FIELD CAGE WITH ENDCAPS - CARBON FIBER
74 // THIS IS ALSO A TPC MOTHER VOLUME
75 // ----------------------------------------------------
76 dm[0] = 76.;
77 dm[1] = 278.;
78 dm[2] = 275.;
79
80 pMC->Gsvolu("TPC ", "TUBE", idtmed[407], dm, 3);
81 // -------------------------------------------------------
82 // drift gas Ne/CO2 (90/10 volume) - nonsensitive
83 // field cage thickness = 0.52% X0
84 // ----------------------------------------------------
85 dm[0] = 76.+0.09776;
86 dm[1] = 257.;
87 dm[2] = 250.;
88
89 pMC->Gsvolu("TGAS", "TUBE", idtmed[402], dm, 3);
90 // ------------------------------------------------------
91 // "side" gas volume (the same as drift gas)
92 // here the readout chambers are positioned
93 // ------------------------------------------------------
94 dm[2] = 0.5*(275.-250.);
95 z_side = dm[2];
96
97 pMC->Gsvolu("TPSG", "TUBE", idtmed[401], dm, 3);
98 // ------------------------------------------------------
99 // HV midplane - 20 microns of mylar
100 // -----------------------------------------------------
101 dm[2] = .001;
102
103 pMC->Gsvolu("TPHV", "TUBE", idtmed[405], dm, 3);
104
105 // ====================================================
106 // lower and upper readout chambers
107 // ====================================================
108 // sectros opening angles in degrees
109 // ---------------------------------------------------
110 opl = 30.;
111 opu = 15.;
112 //thl = TMath::Tan(opl * .5 * kDegrad);
113 //thu = TMath::Tan(opu * .5 * kDegrad);
114 // ---------------------------------------------------
115 // S and L-sectors radii
116 // ---------------------------------------------------
117 rssl = 88.;
118 rssu = 136.;
119 rlsl = 142.;
120 rlsu = 250.;
121 // --------------------------------------------------
122 // Sectors widths
123 // --------------------------------------------------
124 wssl = 46.5;
125 wssu = 72.2;
126 wlsl = 37.;
127 wlsu = 65.4;
128 // ---------------------------------------------------
129 // Sector thickness 25% of X0 (Al)
130 // ---------------------------------------------------
131 sec_thick = 2.225;
132 // ---------------------------------------------------
133 // S-sectors readout chambers (lower sectors)
134 // ---------------------------------------------------
135 dm[0] = wssl * .5;
136 dm[1] = wssu * .5;
137 dm[2] = sec_thick * .5;
138 dm[3] = (rssu - rssl) * .5;
139
140 x0l = rssl + dm[3];
141
142 pMC->Gsvolu("TRCS", "TRD1", idtmed[399], dm, 4);
143 // ---------------------------------------------------
144 // L-sectors readout chambers (upper sectors)
145 // ---------------------------------------------------
146 dm[0] = wlsl * .5;
147 dm[1] = wlsu * .5;
148 dm[2] = sec_thick * .5;
149 dm[3] = (rlsu - rlsl) * .5;
150
151 x0u = rlsl + dm[3];
152
153 pMC->Gsvolu("TRCL", "TRD1", idtmed[399], dm, 4);
154 // ----------------------------------------------------
155 // positioning of the S-sector readout chambers
156 // rotation matices 1-12
157 // ----------------------------------------------------
158 z1 = -z_side + sec_thick * .5;
159
160 for (il = 1; il <= 12; ++il) {
161 phi1 = (il - 1) * opl + 270.;
162 if (phi1 > 360.) {
163 phi1 += -360.;
164 }
165 theta1 = 90.;
166 phi2 = 90.;
167 theta2 = 180.;
168 phi3 = (il - 1) * opl;
169 theta3 = 90.;
170
171 idr = il;
172
173 alpha = (il - 1) * opl * kDegrad;
174 x = x0l * TMath::Cos(alpha);
175 y = x0l * TMath::Sin(alpha);
176
177 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
178 pMC->Gspos("TRCS", il, "TPSG", x, y, z1, idrotm[idr], "ONLY");
179 }
180 // ----------------------------------------------------
181 // positioning of the L-sector readout chambers
182 // rotation matices 13-36
183 // ----------------------------------------------------
184 for (iu = 1; iu <= 24; ++iu) {
185 phi1 = (iu - 1) * opu + 270.;
186 if (phi1 > 360.) {
187 phi1 += -360.;
188 }
189 theta1 = 90.;
190 phi2 = 90.;
191 theta2 = 180.;
192 phi3 = (iu - 1) * opu;
193 theta3 = 90.;
194
195 idr = iu + 12;
196 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
197
198 alpha = (iu - 1) * opu * kDegrad;
199 x = x0u * TMath::Cos(alpha);
200 y = x0u * TMath::Sin(alpha);
201
202 pMC->Gspos("TRCL", iu, "TPSG", x, y, z1, idrotm[idr], "ONLY");
203 }
204 // --------------------------------------------------------
205 // Spoke wheel structures
206 // --------------------------------------------------------
207 pMC->Gsvolu("TSWS", "TUBE", idtmed[399], dm, 0);
208
209 z0 = -z_side + 2.;
210
211 dm[0] = 82.;
212 dm[1] = 86.;
213 dm[2] = 1.;
214
215 pMC->Gsposp("TSWS", 1, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
216
217 dm[0] = 253.;
218 dm[1] = 257.;
219
220 pMC->Gsposp("TSWS", 2, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
221
222 dm[0] = 140.9;
223 dm[1] = 141.9;
224
225 pMC->Gsposp("TSWS", 3, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
226
227 // -------------------------------------------------------
228 // this volumes are to avoid overlaping
229 // -------------------------------------------------------
230 z0 = 253.;
231
232 dm[0] = 76.;
233 dm[1] = 76.+0.09776;
234
235 pMC->Gsposp("TSWS", 4, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
236 pMC->Gsposp("TSWS", 5, "TPC ", 0, 0, -z0,0, "ONLY", dm, 3);
237
238 z0 += 21.;
239
240 pMC->Gsposp("TSWS", 6, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
241 pMC->Gsposp("TSWS", 7, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
242
243 dm[0] = 257.;
244 dm[1] = 257.+0.09776;
245 dm[2] = 11.5;
246
247 z0 = 263.5;
248
249 pMC->Gsposp("TSWS", 8, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
250 pMC->Gsposp("TSWS", 9, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
251 // ==========================================================
252 // wheels
253 // ==========================================================
254 // ----------------------------------------------------------
255 // Large wheel -> positioned in the TPC
256 // ----------------------------------------------------------
257 dm[0] = 257.+0.09776;
258 dm[1] = 278.;
259 dm[2] = 11.5;
260 pMC->Gsvolu("TPW1", "TUBE", idtmed[399], dm, 3);
261
262 dm[0] = 259.;
263 dm[1] = 278.;
264 dm[2] = 9.5;
265
266 pMC->Gsvolu("TPW2", "TUBE", idtmed[498], dm, 3);
267
268 pMC->Gspos("TPW2", 1, "TPW1", 0, 0, 0, 0, "ONLY");
269
270 pMC->Gspos("TPW1", 1, "TPC ", 0, 0, z0, 0, "ONLY");
271 pMC->Gspos("TPW1", 2, "TPC ", 0, 0, -z0, 0, "ONLY");
272 // -----------------------------------------------------------
273 // Small wheel -> positioned in the TPSG
274 // -----------------------------------------------------------
275 dm[0] = 76.+0.09776;
276 dm[1] = 82.;
277 dm[2] = 11.5;
278
279 pMC->Gsvolu("TPW3", "TUBE", idtmed[399], dm, 3);
280
281 dm[0] = 76.+0.09776;
282 dm[1] = 80.;
283 dm[2] = 9.5;
284
285 pMC->Gsvolu("TPW4", "TUBE", idtmed[401], dm, 3);
286
287 pMC->Gspos("TPW4", 1, "TPW3", 0, 0, 0, 0, "ONLY");
288
289 z0 = 1.;
290
291 pMC->Gspos("TPW3", 1, "TPSG", 0, 0, z0, 0, "ONLY");
292 // ---------------------------------------------------------
293 // spokes, inner and outer, also the inner ring
294 // ---------------------------------------------------------
295 dm[0] = 0.5*(135.9-82.1);
296 dm[1] = 3.;
297 dm[2] = 2.;
298
299 x1 = dm[0] + 82.;
300
301 pMC->Gsvolu("TSPI", "BOX ", idtmed[399], dm, 3);
302
303 dm[1] = 2.;
304 dm[2] = 1.;
305
306 pMC->Gsvolu("TSP1", "BOX ", idtmed[498], dm, 3);
307
308 pMC->Gspos("TSP1", 1, "TSPI", 0, 0, 0, 0, "ONLY");
309
310 dm[0] = 0.5*(256.9-142.1);
311 dm[1] = 3.;
312 dm[2] = 2.;
313
314 x2 = dm[0] + 142.;
315
316 pMC->Gsvolu("TSPO", "BOX ", idtmed[399], dm, 3);
317
318 dm[1] = 2.;
319 dm[2] = 1.;
320
321 pMC->Gsvolu("TSP2", "BOX ", idtmed[498], dm, 3);
322
323 pMC->Gspos("TSP2", 1, "TSPO", 0, 0, 0, 0, "ONLY");
324 // --------------------------------------------------------
325 dm[0] = 136.;
326 dm[1] = 142.;
327 dm[2] = 2.;
328
329 pMC->Gsvolu("TSWH", "TUBE", idtmed[399], dm, 3);
330
331 dm[0] = 137.;
332 dm[1] = 141.;
333 dm[2] = 1.;
334
335 pMC->Gsvolu("TSW1", "TUBE", idtmed[498], dm, 3);
336
337 pMC->Gspos("TSW1", 1, "TSWH", 0, 0, 0, 0, "ONLY");
338
339 z0 = z_side - .16168 - 2.;
340 // --------------------------------------------------------
341 pMC->Gspos("TSWH", 1, "TPSG", 0, 0, z0, 0, "ONLY");
342 // -------------------------------------------------------
343 // posiioning of the inner spokes
344 // -------------------------------------------------------
345 for (il = 1; il <= 6; ++il) {
346 phi1 = opl * .5 + (il - 1) * 2. * opl;
347 theta1 = 90.;
348 phi2 = opl * .5 + 90. + (il - 1) * 2. * opl;
349 if (phi2 > 360.) {
350 phi2 += -360.;
351 }
352 theta2 = 90.;
353 phi3 = 0.;
354 theta3 = 0.;
355
356 alpha = phi1 * kDegrad;
357 x = x1 * TMath::Cos(alpha);
358 y = x1 * TMath::Sin(alpha);
359
360 idr = il + 36;
361
362 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
363 pMC->Gspos("TSPI", il, "TPSG", x, y, z0, idrotm[idr], "ONLY");
364
365 }
366
367 for (iu = 1; iu <= 12; ++iu) {
368 phi1 = opu * .5 + (iu - 1) * 2. * opu;
369 theta1 = 90.;
370 phi2 = opu * .5 + 90. + (iu - 1) * 2. * opu;
371 if (phi2 > 360.) {
372 phi2 += -360.;
373 }
374 theta2 = 90.;
375 phi3 = 0.;
376 theta3 = 0.;
377
378 alpha = phi1 * kDegrad;
379 x = x2 * TMath::Cos(alpha);
380 y = x2 * TMath::Sin(alpha);
381
382 idr = iu + 42;
383
384 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
385 pMC->Gspos("TSPO", iu, "TPSG", x, y, z0, idrotm[idr], "ONLY");
386 }
387 // --------------------------------------------------------
388 // endcap cover (C, 0.86% X0)
389 // --------------------------------------------------------
390 dm[0] = 76.+0.09776;
391 dm[1] = 257.;
392 dm[2] = 0.16168*0.5;
393
394 pMC->Gsvolu("TCOV", "TUBE", idtmed[407], dm, 3);
395
396 z0 = z_side - dm[2];
397
398 pMC->Gspos("TCOV", 1, "TPSG", 0, 0, z0, 0, "ONLY");
399 // --------------------------------------------------------
400 // put the readout chambers into the TPC
401 // --------------------------------------------------------
402 theta1 = 90.;
403 phi1 = 0.;
404 theta2 = 90.;
405 phi2 = 270.;
406 theta3 = 180.;
407 phi3 = 0.;
408
409 AliMatrix(idrotm[55], theta1, phi1, theta2, phi2, theta3, phi3);
410
411 z0 = z_side + 250.;
412
413 pMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY");
414 pMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[55], "ONLY");
415 // ---------------------------------------------------------
416 // outer gas insulation (CO2)
417 // ---------------------------------------------------------
418 dm[0] = 257.+0.09776;
419 dm[1] = 278.-0.25004;
420 dm[2] = 275.-23.;
421
422 pMC->Gsvolu("TPOI", "TUBE", idtmed[406], dm, 3);
423
424 pMC->Gspos("TPHV", 1, "TGAS", 0, 0, 0, 0, "ONLY");
425 pMC->Gspos("TGAS", 1, "TPC ", 0, 0, 0, 0, "ONLY");
426 pMC->Gspos("TPOI", 1, "TPC ", 0, 0, 0, 0, "ONLY");
427
428 pMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
429 // ======================================================
430 // all volumes below are positioned in ALIC
431 // ======================================================
432 // ------------------------------------------------------
433 // the last parts of the smaller wheel (TSWS)
434 // ------------------------------------------------------
435 dm[0] = 74.;
436 dm[1] = 76.;
437 dm[2] = 1.;
438
439 z0 = 253.;
440
441 pMC->Gsposp("TSWS", 10, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
442 pMC->Gsposp("TSWS", 11, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
443
444 dm[0] = 70.;
445
446 z0 += 21.;
447
448 pMC->Gsposp("TSWS", 12, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
449 pMC->Gsposp("TSWS", 13, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
450 // ----------------------------------------------------
451 // Inner vessel (PCON)
452 // This volume is to be positioned directly in ALIC
453 // ----------------------------------------------------
454 dm[0] = 0.;
455 dm[1] = 360.;
456 dm[2] = 4.;
457
458 dm[3] = -250.;
459 dm[4] = 75.;
460 dm[5] = 76.;
461
462 dm[6] = -64.5;
463 dm[7] = 50.;
464 dm[8] = 76.;
465
466 dm[9] = 64.5;
467 dm[10] = 50.;
468 dm[11] = 76.;
469
470 dm[12] = 250.;
471 dm[13] = 75.;
472 dm[14] = 76.;
473
474 pMC->Gsvolu("TPIV", "PCON", idtmed[407], dm, 15);
475 // --------------------------------------------------------
476 // fill the inner vessel with CO2, (HV kDegrader)
477 // cone parts have different thickness
478 // than the central barrel, according to the TP
479 // --------------------------------------------------------
480 tana = 75./185.5;
481
482 dm[0] = 0.;
483 dm[1] = 360.;
484 dm[2] = 6.;
485
486 dm[3] = -(250.-0.2162);
487 dm[4] = (185.5-0.2126)*tana+0.2126;
488 dm[5] = 76-0.001;
489
490 dm[6] = -64.5;
491 dm[7] = 50.+0.2162;
492 dm[8] = 76-0.001;
493
494 dm[9] = -64.5;
495 dm[10] = 50+0.05076;
496 dm[11] = 76-0.001;
497
498 dm[12] = 64.5;
499 dm[13] = 50+0.05076;
500 dm[14] = 76-0.001;
501
502 dm[15] = 64.5;
503 dm[16] = 50.+0.2162;
504 dm[17] = 76-0.001;
505
506 dm[18] = (250.-0.2162);
507 dm[19] = (185.5-0.2126)*tana+0.2126;
508 dm[20] = 76-0.001;
509
510 pMC->Gsvolu("TPVD", "PCON", idtmed[406], dm, 21);
511
512 pMC->Gspos("TPVD", 1, "TPIV", 0, 0, 0, 0, "ONLY");
513
514 pMC->Gspos("TPIV", 1, "ALIC", 0, 0, 0, 0, "ONLY");
515 // ---------------------------------------------------
516 // volumes ordering
517 // ---------------------------------------------------
518 pMC->Gsord("TPSG", 6);
519}
520
521//_____________________________________________________________________________
522void AliTPCv0::CreateMaterials()
523{
524 //
525 // Define materials for the TPC
526 //
527 AliTPC::CreateMaterials();
528}
529
530//_____________________________________________________________________________
8c555625 531void AliTPCv0::DrawDetector()
fe4da5cc 532{
533 //
534 // Draw a shaded view of the Time Projection Chamber version 0
535 //
536
537 AliMC* pMC = AliMC::GetMC();
538
539 // Set everything unseen
540 pMC->Gsatt("*", "seen", -1);
541 //
542 // Set ALIC mother transparent
543 pMC->Gsatt("ALIC","SEEN",0);
544 //
545 // Set the volumes visible
546 pMC->Gsatt("TPC","SEEN",0);
547 pMC->Gsatt("TGAS","SEEN",0);
548 pMC->Gsatt("TPSG","SEEN",0);
549 pMC->Gsatt("TPHV","SEEN",1);
550 pMC->Gsatt("TRCS","SEEN",1);
551 pMC->Gsatt("TRCL","SEEN",1);
552 pMC->Gsatt("TSWS","SEEN",1);
553 pMC->Gsatt("TPW1","SEEN",1);
554 pMC->Gsatt("TPW2","SEEN",1);
555 pMC->Gsatt("TPW3","SEEN",1);
556 pMC->Gsatt("TPW4","SEEN",1);
557 pMC->Gsatt("TSPI","SEEN",1);
558 pMC->Gsatt("TSP1","SEEN",0);
559 pMC->Gsatt("TSPO","SEEN",1);
560 pMC->Gsatt("TSP2","SEEN",0);
561 pMC->Gsatt("TSWH","SEEN",1);
562 pMC->Gsatt("TSW1","SEEN",1);
563 pMC->Gsatt("TPOI","SEEN",1);
564 pMC->Gsatt("TPIV","SEEN",1);
565 pMC->Gsatt("TPVD","SEEN",1);
566 //
567 pMC->Gdopt("hide", "on");
568 pMC->Gdopt("shad", "on");
569 pMC->Gsatt("*", "fill", 7);
570 pMC->SetClipBox(".");
571 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
572 pMC->DefaultRange();
573 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
574 pMC->Gdhead(1111, "Time Projection Chamber");
575 pMC->Gdman(18, 4, "MAN");
576 pMC->Gdopt("hide","off");
577}
578
579//_____________________________________________________________________________
580void AliTPCv0::Init()
581{
582 //
583 // Initialise Time Projection Chamber version 0
584 //
585 printf("TPC version 0 initialized\n");
586}
587
588//_____________________________________________________________________________
589void AliTPCv0::StepManager()
590{
591 //
592 // Procedure called at each step in the TPC
593 //
594}