]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCv1.cxx
Set variable dummy even if not used.
[u/mrichter/AliRoot.git] / TPC / AliTPCv1.cxx
CommitLineData
fe4da5cc 1///////////////////////////////////////////////////////////////////////////////
2// //
3// Time Projection Chamber version 1 -- detailed TPC and fast simulation //
4// //
5//Begin_Html
6/*
7<img src="gif/AliTPCv1Class.gif">
8*/
9//End_Html
10// //
11// //
12///////////////////////////////////////////////////////////////////////////////
13
14#include <TMath.h>
15#include <TGeometry.h>
16#include <TNode.h>
17#include <TBRIK.h>
18#include <TTUBE.h>
19#include "AliTPCv1.h"
20#include "AliRun.h"
21#include <iostream.h>
22#include <fstream.h>
23
24#include "AliMC.h"
25#include "AliConst.h"
26
27ClassImp(AliTPCv1)
28
29//_____________________________________________________________________________
30AliTPCv1::AliTPCv1(const char *name, const char *title)
31 :AliTPC(name, title) {
32 //
33 // Standard constructor for Time Projection Chamber
34 //
35 fIdSens1=fIdSens2=0;
36}
37
38//_____________________________________________________________________________
39void AliTPCv1::CreateGeometry()
40{
41 //
42 // Creates geometry for Time Projection Chamber version 1
43 // Detailed geometry -- Fast simulation
44 // Origin M.Kowalski
45 //
46 //Begin_Html
47 /*
48 <img src="gif/AliTPCv1.gif">
49 */
50 //End_Html
51 //Begin_Html
52 /*
53 <img src="gif/AliTPCv1Tree.gif">
54 */
55 //End_Html
56
57 AliMC* pMC = AliMC::GetMC();
58
59 Int_t *idtmed = gAlice->Idtmed();
60
61 Float_t padl, tana, rlsl, wlsl, rssl, rlsu, wssl, wlsu,
62 rssu, wssu, alpha, x, y, z, sec_thick;
63
64 Float_t r1, r2, x1, z0, z1, x2, theta1, theta2, theta3, dm[21];
65 Int_t il, iu;
66 Float_t z_side, zz;
67 Int_t idrotm[100];
68
69 Float_t x0l, x0u;
70 Int_t idr;
71 Float_t thl;
72 Int_t ils;
73 Float_t opl;
74 Int_t iss;
75 Float_t thu, opu, dzz, phi1, phi2, phi3;
76
77 // ----------------------------------------------------
78 // FIELD CAGE WITH ENDCAPS - CARBON FIBER
79 // THIS IS ALSO A TPC MOTHER VOLUME
80 // ----------------------------------------------------
81 dm[0] = 76.;
82 dm[1] = 278.;
83 dm[2] = 275.;
84
85 pMC->Gsvolu("TPC ", "TUBE", idtmed[407], dm, 3);
86
87 // -------------------------------------------------------
88 // drift gas Ne/CO2 (90/10 volume) - nonsensitive
89 // field cage thickness = 0.52% X0
90 // ----------------------------------------------------
91
92 //Begin_Html
93 /*
94 <img src="gif/spec_tgas1.gif">
95 */
96 //End_Html
97
98 dm[0] = 76.+0.09776;
99 dm[1] = 257.;
100 dm[2] = 250.;
101
102 pMC->Gsvolu("TGAS", "TUBE", idtmed[402], dm, 3);
103
104 // ------------------------------------------------------
105 // "side" gas volume (the same as drift gas),
106 // here the readout chambers are positioned
107 // ------------------------------------------------------
108
109 //Begin_Html
110 /*
111 <img src="gif/spec_tpsg1.gif">
112 */
113 //End_Html
114
115 dm[2] = 12.5;
116 z_side = dm[2];
117
118 pMC->Gsvolu("TPSG", "TUBE", idtmed[401], dm, 3);
119 // ------------------------------------------------------
120 // HV midplane - 20 microns of mylar
121 // -----------------------------------------------------
122 dm[2] = .001;
123
124 pMC->Gsvolu("TPHV", "TUBE", idtmed[405], dm, 3);
125
126 // ====================================================
127 // lower and upper readout chambers
128 // ====================================================
129 // sectors opening angles in degrees
130 // ---------------------------------------------------
131 opl = 30.;
132 opu = 15.;
133 thl = TMath::Tan(opl * .5 * kDegrad);
134 thu = TMath::Tan(opu * .5 * kDegrad);
135 // ---------------------------------------------------
136 // S and L-sectors radii
137 // ---------------------------------------------------
138 rssl = 88.;
139 rssu = 136.;
140 rlsl = 142.;
141 rlsu = 250.;
142 // --------------------------------------------------
143 // Sectors widths
144 // --------------------------------------------------
145 wssl = 46.5;
146 wssu = 72.2;
147 wlsl = 37.;
148 wlsu = 65.4;
149 // ---------------------------------------------------
150 // Sector thickness 25% of X0 (Al)
151 // ---------------------------------------------------
152 sec_thick = 2.225;
153 // ---------------------------------------------------
154 // S-sectors (lower sectors)
155 // ---------------------------------------------------
156 dm[0] = wssl * .5;
157 dm[1] = wssu * .5;
158 dm[2] = sec_thick * .5;
159 dm[3] = (rssu - rssl) * .5;
160
161 x0l = rssl + dm[3];
162
163 //Begin_Html
164 /*
165 <img src="gif/spec_trcs1.gif">
166 */
167 //End_Html
168
169
170 pMC->Gsvolu("TRCS", "TRD1", idtmed[399], dm, 4);
171 // -----------------------------------------------------
172 // S-sectors --> "gas sectors"
173 // -----------------------------------------------------
174
175 //Begin_Html
176 /*
177 <img src="gif/spec_tsga1.gif">
178 */
179 //End_Html
180
181 dm[2] = (250.-0.001)/2.;
182 pMC->Gsvolu("TSGA", "TRD1", idtmed[402], dm, 4);
183 // ---------------------------------------------------
184 // L-sectors (upper sectors)
185 // ---------------------------------------------------
186 dm[0] = wlsl * .5;
187 dm[1] = wlsu * .5;
188 dm[2] = sec_thick * .5;
189 dm[3] = (rlsu - rlsl) * .5;
190
191 x0u = rlsl + dm[3];
192
193 pMC->Gsvolu("TRCL", "TRD1", idtmed[399], dm, 4);
194 // -----------------------------------------------------
195 // L-sectors - "gas sectors"
196 // -----------------------------------------------------
197 dm[2] = (250.-0.001)/2.;
198 pMC->Gsvolu("TLGA", "TRD1", idtmed[402], dm, 4);
199 // -----------------------------------------------------
200 // thin sensitive strips (100 microns) placed at a center
201 // of each pad row (23 rows) in the "drift gas sector"
202 // -----------------------------------------------------
203 pMC->Gsvolu("TSST", "TRD1", idtmed[403], dm, 0);
204
205 dm[3] = .005;
206 padl = 2.05;
207 z0 = (rssu - rssl) * .5;
208 dzz = (rssu - rssl - padl * 22.) * .5;
209 z0 = -z0 + dzz;
210
211 for (iss = 0; iss < 23; ++iss) {
212 r1 = rssl + dzz + iss * padl - dm[3];
213 r2 = r1 + dm[3] * 2.;
214 dm[0] = r1 * thl - 1.1;
215 dm[1] = r2 * thl - 1.1;
216 zz = z0 + iss * padl;
217 pMC->Gsposp("TSST", iss+1, "TSGA", 0, 0, zz, 0, "ONLY", dm, 4);
218 }
219 // -----------------------------------------------------
220 // thin sensitive strips (100 microns) placed at a center
221 // of each pad row (52 rows) in the "drift gas sector"
222 // -----------------------------------------------------
223 pMC->Gsvolu("TLST", "TRD1", idtmed[403], dm, 0);
224
225 padl = 2.05;
226 z0 = (rlsu - rlsl) * .5;
227 dzz = (rlsu - rlsl - padl * 51.) * .5;
228 z0 = -z0 + dzz;
229
230 for (ils = 0; ils < 52; ++ils) {
231 r1 = rlsl + dzz + ils * padl - dm[3];
232 r2 = r1 + dm[3] * 2.;
233 dm[0] = r1 * thu - 1.1;
234 dm[1] = r2 * thu - 1.1;
235 zz = z0 + ils * padl;
236 pMC->Gsposp("TLST", ils+1, "TLGA", 0, 0, zz, 0, "ONLY", dm, 4);
237 }
238 // ------------------------------------------------
239 // positioning of lower sectors (1-12)*2
240 // rotation matrices 1-12
241 // ------------------------------------------------
242 z = (250.+0.001)/2.;
243 z1 = -z_side + sec_thick * .5;
244
245 for (il = 0; il < 12; ++il) {
246 phi1 = il * opl + 270;
247 if (phi1 > 360.) {
248 phi1 += -360;
249 }
250 theta1 = 90.;
251 phi2 = 90.;
252 theta2 = 180.;
253 phi3 = il * opl;
254 theta3 = 90.;
255
256 idr = il+1;
257 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
258
259 alpha = il * opl * kDegrad;
260 x = x0l * TMath::Cos(alpha);
261 y = x0l * TMath::Sin(alpha);
262
263 pMC->Gspos("TSGA", il+1, "TGAS", x, y, z, idrotm[idr], "ONLY");
264 pMC->Gspos("TSGA", il+13,"TGAS", x, y, -z, idrotm[idr], "ONLY");
265 pMC->Gspos("TRCS", il+1, "TPSG", x, y, z1, idrotm[idr], "ONLY");
266
267 }
268 // ----------------------------------------------------
269 // positioning of upper sectors (1-24)*2
270 // rotation matrices 13-36
271 // ----------------------------------------------------
272 for (iu = 1; iu <= 24; ++iu) {
273 phi1 = (iu - 1) * opu + 270.;
274 if (phi1 > 360.) {
275 phi1 += -360.;
276 }
277 theta1 = 90.;
278 phi2 = 90.;
279 theta2 = 180.;
280 phi3 = (iu - 1) * opu;
281 theta3 = 90.;
282
283 idr = iu + 12;
284 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
285
286 alpha = (iu - 1) * opu * kDegrad;
287 x = x0u * TMath::Cos(alpha);
288 y = x0u * TMath::Sin(alpha);
289
290 pMC->Gspos("TLGA", iu, "TGAS", x, y, z, idrotm[idr], "ONLY");
291 pMC->Gspos("TLGA", iu+24, "TGAS", x, y, -z, idrotm[idr], "ONLY");
292
293 pMC->Gspos("TRCL", iu, "TPSG", x, y, z1, idrotm[idr], "ONLY");
294 }
295 // --------------------------------------------------------
296 // Spoke wheel structures
297 // --------------------------------------------------------
298 pMC->Gsvolu("TSWS", "TUBE", idtmed[399], dm, 0);
299
300 z0 = -z_side + 2.;
301
302 dm[0] = 82.;
303 dm[1] = 86.;
304 dm[2] = 1.;
305
306 pMC->Gsposp("TSWS", 1, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
307
308 dm[0] = 253.;
309 dm[1] = 257.;
310
311 pMC->Gsposp("TSWS", 2, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
312
313 dm[0] = 140.9;
314 dm[1] = 141.9;
315
316 pMC->Gsposp("TSWS", 3, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
317
318 // -------------------------------------------------------
319 // this volumes are to avoid overlaping
320 // -------------------------------------------------------
321 z0 = 253.;
322
323 dm[0] = 76.;
324 dm[1] = 76.+0.09776;
325
326 pMC->Gsposp("TSWS", 4, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
327 pMC->Gsposp("TSWS", 5, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
328
329 z0 += 21.;
330
331 pMC->Gsposp("TSWS", 6, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
332 pMC->Gsposp("TSWS", 7, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
333
334 dm[0] = 257.;
335 dm[1] = 257.+0.09776;
336 dm[2] = 11.5;
337
338 z0 = 263.5;
339
340 pMC->Gsposp("TSWS", 8, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
341 pMC->Gsposp("TSWS", 9, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
342 // ==========================================================
343 // wheels
344 // ==========================================================
345 // ----------------------------------------------------------
346 // Large wheel -> positioned in the TPC
347 // ----------------------------------------------------------
348 dm[0] = 257.+0.09776;
349 dm[1] = 278.;
350 dm[2] = 11.5;
351 pMC->Gsvolu("TPW1", "TUBE", idtmed[399], dm, 3);
352
353 dm[0] = 259.;
354 dm[1] = 278.;
355 dm[2] = 9.5;
356
357 pMC->Gsvolu("TPW2", "TUBE", idtmed[498], dm, 3);
358
359 pMC->Gspos("TPW2", 1, "TPW1", 0, 0, 0, 0, "ONLY");
360
361 pMC->Gspos("TPW1", 1, "TPC ", 0, 0, z0, 0, "ONLY");
362 pMC->Gspos("TPW1", 2, "TPC ", 0, 0, -z0, 0, "ONLY");
363 // -----------------------------------------------------------
364 // Small wheel -> positioned in the TPSG
365 // -----------------------------------------------------------
366 dm[0] = 76.+0.09776;
367 dm[1] = 82.;
368 dm[2] = 11.5;
369
370 pMC->Gsvolu("TPW3", "TUBE", idtmed[399], dm, 3);
371
372 dm[0] = 76.+0.09776;
373 dm[1] = 80.;
374 dm[2] = 9.5;
375
376 pMC->Gsvolu("TPW4", "TUBE", idtmed[401], dm, 3);
377
378 pMC->Gspos("TPW4", 1, "TPW3", 0, 0, 0, 0, "ONLY");
379
380 z0 = 1.;
381
382 pMC->Gspos("TPW3", 1, "TPSG", 0, 0, z0, 0, "ONLY");
383 // ---------------------------------------------------------
384 // spokes, inner and outer, also the inner ring
385 // ---------------------------------------------------------
386
387 //Begin_Html
388 /*
389 <img src="gif/spec_tspo1.gif">
390 */
391 //End_Html
392
393 dm[0] = 0.5*(135.9-82.1);
394 dm[1] = 3.;
395 dm[2] = 2.;
396
397 x1 = dm[0] + 82.;
398
399 pMC->Gsvolu("TSPI", "BOX ", idtmed[399], dm, 3);
400
401 dm[1] = 2.;
402 dm[2] = 1.;
403
404 pMC->Gsvolu("TSP1", "BOX ", idtmed[498], dm, 3);
405
406 pMC->Gspos("TSP1", 1, "TSPI", 0, 0, 0, 0, "ONLY");
407
408 dm[0] = 0.5*(256.9-142.1);
409 dm[1] = 3.;
410 dm[2] = 2.;
411
412 x2 = dm[0] + 142.;
413
414 pMC->Gsvolu("TSPO", "BOX ", idtmed[399], dm, 3);
415
416 dm[1] = 2.;
417 dm[2] = 1.;
418
419 pMC->Gsvolu("TSP2", "BOX ", idtmed[498], dm, 3);
420
421 pMC->Gspos("TSP2", 1, "TSPO", 0, 0, 0, 0, "ONLY");
422 // --------------------------------------------------------
423 dm[0] = 136.;
424 dm[1] = 142.;
425 dm[2] = 2.;
426
427 pMC->Gsvolu("TSWH", "TUBE", idtmed[399], dm, 3);
428
429 dm[0] = 137.;
430 dm[1] = 141.;
431 dm[2] = 1.;
432
433 pMC->Gsvolu("TSW1", "TUBE", idtmed[498], dm, 3);
434
435 pMC->Gspos("TSW1", 1, "TSWH", 0, 0, 0, 0, "ONLY");
436
437 z0 = z_side - .16168 - 2.;
438 // --------------------------------------------------------
439 pMC->Gspos("TSWH", 1, "TPSG", 0, 0, z0, 0, "ONLY");
440 // -------------------------------------------------------
441 // posiioning of the inner spokes
442 // -------------------------------------------------------
443 for (il = 1; il <= 6; ++il) {
444 phi1 = opl * .5 + (il - 1) * 2. * opl;
445 theta1 = 90.;
446 phi2 = opl * .5 + 90. + (il - 1) * 2. * opl;
447 if (phi2 > 360.) {
448 phi2 += -360.;
449 }
450 theta2 = 90.;
451 phi3 = 0.;
452 theta3 = 0.;
453
454 alpha = phi1 * kDegrad;
455 x = x1 * TMath::Cos(alpha);
456 y = x1 * TMath::Sin(alpha);
457
458 idr = il + 36;
459
460 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
461 pMC->Gspos("TSPI", il, "TPSG", x, y, z0, idrotm[idr], "ONLY");
462 }
463
464 for (iu = 1; iu <= 12; ++iu) {
465 phi1 = opu * .5 + (iu - 1) * 2. * opu;
466 theta1 = 90.;
467 phi2 = opu * .5 + 90. + (iu - 1) * 2. * opu;
468 if (phi2 > 360.) {
469 phi2 += -360.;
470 }
471 theta2 = 90.;
472 phi3 = 0.;
473 theta3 = 0.;
474
475 alpha = phi1 * kDegrad;
476 x = x2 * TMath::Cos(alpha);
477 y = x2 * TMath::Sin(alpha);
478
479 idr = iu + 42;
480
481 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
482 pMC->Gspos("TSPO", iu, "TPSG", x, y, z0, idrotm[idr], "ONLY");
483 }
484 // --------------------------------------------------------
485 // endcap cover (C, 0.86% X0)
486 // --------------------------------------------------------
487 dm[0] = 76.+0.09776;
488 dm[1] = 257.;
489 dm[2] = 0.16168*0.5;
490
491 pMC->Gsvolu("TCOV", "TUBE", idtmed[407], dm, 3);
492
493 z0 = z_side - dm[2];
494
495 pMC->Gspos("TCOV", 1, "TPSG", 0, 0, z0, 0, "ONLY");
496 // --------------------------------------------------------
497 // put the readout chambers into the TPC
498 // --------------------------------------------------------
499 theta1 = 90.;
500 phi1 = 0.;
501 theta2 = 90.;
502 phi2 = 270.;
503 theta3 = 180.;
504 phi3 = 0.;
505
506 AliMatrix(idrotm[55], theta1, phi1, theta2, phi2, theta3, phi3);
507
508 z0 = z_side + 250.;
509
510 pMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY");
511 pMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[55], "ONLY");
512 // ---------------------------------------------------------
513 // outer gas insulation (CO2)
514 // ---------------------------------------------------------
515 dm[0] = 257.+0.09776;
516 dm[1] = 278.-0.25004;
517 dm[2] = 275.-23.;
518
519 pMC->Gsvolu("TPOI", "TUBE", idtmed[406], dm, 3);
520
521 pMC->Gspos("TPHV", 1, "TGAS", 0, 0, 0, 0, "ONLY");
522 pMC->Gspos("TGAS", 1, "TPC ", 0, 0, 0, 0, "ONLY");
523 pMC->Gspos("TPOI", 1, "TPC ", 0, 0, 0, 0, "ONLY");
524
525 pMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
526 // ======================================================
527 // all volumes below are positioned in ALIC
528 // ======================================================
529 // ------------------------------------------------------
530 // the last parts of the smaller wheel (TSWS)
531 // ------------------------------------------------------
532 dm[0] = 74.;
533 dm[1] = 76.;
534 dm[2] = 1.;
535
536 z0 = 253.;
537
538 pMC->Gsposp("TSWS", 10, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
539 pMC->Gsposp("TSWS", 11, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
540
541 dm[0] = 70.;
542
543 z0 += 21.;
544
545 pMC->Gsposp("TSWS", 12, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
546 pMC->Gsposp("TSWS", 13, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
547 // ----------------------------------------------------
548 // Inner vessel (PCON)
549 // This volume is to be positioned directly in ALIC
550 // ----------------------------------------------------
551
552 //Begin_Html
553 /*
554 <img src="gif/spec_tpiv1.gif">
555 */
556 //End_Html
557
558 dm[0] = 0.;
559 dm[1] = 360.;
560 dm[2] = 4.;
561
562 dm[3] = -250.;
563 dm[4] = 75.;
564 dm[5] = 76.;
565
566 dm[6] = -64.5;
567 dm[7] = 50.;
568 dm[8] = 76.;
569
570 dm[9] = 64.5;
571 dm[10] = 50.;
572 dm[11] = 76.;
573
574 dm[12] = 250.;
575 dm[13] = 75.;
576 dm[14] = 76.;
577
578 pMC->Gsvolu("TPIV", "PCON", idtmed[407], dm, 15);
579 // --------------------------------------------------------
580 // fill the inner vessel with CO2, (HV kDegrader)
581 // cone parts have different thickness
582 // than the central barrel, according to the TP
583 // --------------------------------------------------------
584 tana = 75./185.5;
585
586 dm[0] = 0.;
587 dm[1] = 360.;
588 dm[2] = 6.;
589
590 dm[3] = -(250.-0.2162);
591 dm[4] = (185.5-0.2126)*tana+0.2126;
592 dm[5] = 76-0.001;
593
594 dm[6] = -64.5;
595 dm[7] = 50.+0.2162;
596 dm[8] = 76-0.001;
597
598 dm[9] = -64.5;
599 dm[10] = 50+0.05076;
600 dm[11] = 76-0.001;
601
602 dm[12] = 64.5;
603 dm[13] = 50+0.05076;
604 dm[14] = 76-0.001;
605
606 dm[15] = 64.5;
607 dm[16] = 50.+0.2162;
608 dm[17] = 76-0.001;
609
610 dm[18] = (250.-0.2162);
611 dm[19] = (185.5-0.2126)*tana+0.2126;
612 dm[20] = 76-0.001;
613
614 pMC->Gsvolu("TPVD", "PCON", idtmed[406], dm, 21);
615
616 pMC->Gspos("TPVD", 1, "TPIV", 0, 0, 0, 0, "ONLY");
617
618 pMC->Gspos("TPIV", 1, "ALIC", 0, 0, 0, 0, "ONLY");
619 // ---------------------------------------------------
620 // volumes ordering
621 // ---------------------------------------------------
622 pMC->Gsord("TGAS", 6);
623 pMC->Gsord("TPSG", 6);
624 pMC->Gsord("TSGA", 3);
625 pMC->Gsord("TLGA", 3);
626}
627
628//_____________________________________________________________________________
1f2a122c 629void AliTPCv1::DrawModule()
fe4da5cc 630{
631 //
632 // Draw a shaded view of the Time Projection Chamber version 1
633 //
634
635 AliMC* pMC = AliMC::GetMC();
636
637 // Set everything unseen
638 pMC->Gsatt("*", "seen", -1);
639 //
640 // Set ALIC mother transparent
641 pMC->Gsatt("ALIC","SEEN",0);
642 //
643 // Set the volumes visible
644 pMC->Gsatt("TPC","SEEN",0);
645 pMC->Gsatt("TGAS","SEEN",0);
646 pMC->Gsatt("TPSG","SEEN",0);
647 pMC->Gsatt("TPHV","SEEN",1);
648 pMC->Gsatt("TRCS","SEEN",1);
649 pMC->Gsatt("TRCL","SEEN",1);
650 pMC->Gsatt("TSST","SEEN",1);
651 pMC->Gsatt("TLST","SEEN",1);
652 pMC->Gsatt("TSWS","SEEN",1);
653 pMC->Gsatt("TPW1","SEEN",1);
654 pMC->Gsatt("TPW2","SEEN",1);
655 pMC->Gsatt("TPW3","SEEN",1);
656 pMC->Gsatt("TPW4","SEEN",1);
657 pMC->Gsatt("TSPI","SEEN",1);
658 pMC->Gsatt("TSP1","SEEN",0);
659 pMC->Gsatt("TSPO","SEEN",1);
660 pMC->Gsatt("TSP2","SEEN",0);
661 pMC->Gsatt("TSWH","SEEN",1);
662 pMC->Gsatt("TSW1","SEEN",1);
663 pMC->Gsatt("TCOV","SEEN",0);
664 pMC->Gsatt("TPOI","SEEN",1);
665 pMC->Gsatt("TPIV","SEEN",1);
666 pMC->Gsatt("TPVD","SEEN",1);
667 //
668 pMC->Gdopt("hide", "on");
669 pMC->Gdopt("shad", "on");
670 pMC->Gsatt("*", "fill", 7);
671 pMC->SetClipBox(".");
672 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
673 pMC->DefaultRange();
674 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
675 pMC->Gdhead(1111, "Time Projection Chamber");
676 pMC->Gdman(18, 4, "MAN");
677 pMC->Gdopt("hide","off");
678}
679
680//_____________________________________________________________________________
681void AliTPCv1::CreateMaterials()
682{
683 //
684 // Define materials for Time Projection Chamber
685 //
686 AliTPC::CreateMaterials();
687}
688
689//_____________________________________________________________________________
690void AliTPCv1::Init()
691{
692 //
693 // Initialises TPC detector after it has been created
694 //
695 AliMC* pMC=AliMC::GetMC();
696 fIdSens1=pMC->VolId("TLST");
697 fIdSens2=pMC->VolId("TSST");
698
699 printf("TPC version 1 initialized\n");
700}
701
702//_____________________________________________________________________________
703void AliTPCv1::StepManager()
704{
705 //
706 // Called at every step in the Time Projection Chamber
707 //
708 Int_t copy, id;
709 Float_t hits[4];
710 Int_t vol[2];
711 TClonesArray &lhits = *fHits;
712 AliMC* pMC=AliMC::GetMC();
713 //
714 if(pMC->TrackCharge() && pMC->TrackEntering()) {
715 //
716 // Only entering charged tracks
717 if((id=pMC->CurrentVol(0, copy))==fIdSens1) {
718 vol[1]=copy+23;
719 id=pMC->CurrentVolOff(1,0,copy);
720 vol[0]=copy+24;
721 } else if(id==fIdSens2) {
722 vol[1]=copy;
723 id=pMC->CurrentVolOff(1,0,copy);
724 vol[0]=copy;
725 } else return;
726 pMC->TrackPosition(hits);
727 hits[3]=0;
728 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
729 }
730}