New code from Piergiorgio added
[u/mrichter/AliRoot.git] / TPC / AliTPCv2.cxx
CommitLineData
4c039060 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/*
17$Log$
930ee558 18Revision 1.23 2000/07/10 20:57:39 hristov
19Update of TPC code and macros by M.Kowalski
20
37831078 21Revision 1.22 2000/06/30 12:07:50 kowal2
22Updated from the TPC-PreRelease branch
23
73042f01 24Revision 1.21.2.4 2000/06/26 07:39:42 kowal2
25Changes to obey the coding rules
26
27Revision 1.21.2.3 2000/06/25 08:38:41 kowal2
28Splitted from AliTPCtracking
29
30Revision 1.21.2.2 2000/06/16 12:58:13 kowal2
31Changed parameter settings
32
33Revision 1.21.2.1 2000/06/09 07:15:07 kowal2
34
35Defaults loaded automatically (hard-wired)
36Optional parameters can be set via macro called in the constructor
37
38Revision 1.21 2000/05/15 10:00:30 kowal2
39Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
40
e94dd9ca 41Revision 1.20 2000/04/17 09:37:33 kowal2
42removed obsolete AliTPCDigitsDisplay.C
43
cc80f89e 44Revision 1.19.8.2 2000/04/10 08:31:52 kowal2
45
46Different geometry for different sectors
47Updated readout chambers
48Some modifications to StepManager by J.Belikov
49
50Revision 1.19.8.1 2000/04/10 07:56:53 kowal2
51Not used anymore - removed
52
53Revision 1.19 1999/11/04 17:28:07 fca
54Correct barrel part of HV Degrader
55
a5371c42 56Revision 1.18 1999/10/14 16:52:08 fca
57Only use PDG codes and not GEANT ones
58
69e40cce 59Revision 1.17 1999/10/08 06:27:23 fca
60Corrected bug in the HV degrader geometry, thanks to G.Tabary
61
d183a600 62Revision 1.16 1999/10/04 13:39:54 fca
63Correct array index problem
64
cdde5b1e 65Revision 1.15 1999/09/29 09:24:34 fca
66Introduction of the Copyright and cvs Log
67
4c039060 68*/
69
73042f01 70//
fe4da5cc 71///////////////////////////////////////////////////////////////////////////////
72// //
73// Time Projection Chamber version 2 -- detailed TPC and slow simulation //
74// //
75//Begin_Html
76/*
1439f98e 77<img src="picts/AliTPCv2Class.gif">
fe4da5cc 78*/
79//End_Html
80// //
81// //
82///////////////////////////////////////////////////////////////////////////////
2a49965d 83#include <stdlib.h>
fe4da5cc 84
85#include <TMath.h>
bcac8ae4 86
fe4da5cc 87#include "AliTPCv2.h"
cc80f89e 88#include "AliTPCDigitsArray.h"
fe4da5cc 89#include "AliRun.h"
fe4da5cc 90#include "AliConst.h"
69e40cce 91#include "AliPDG.h"
73042f01 92#include "AliTPCParam.h"
93#include "AliTPCParamSR.h"
8c555625 94
fe4da5cc 95ClassImp(AliTPCv2)
96
97//_____________________________________________________________________________
98AliTPCv2::AliTPCv2(const char *name, const char *title) :
99 AliTPC(name, title)
100{
101 //
102 // Standard constructor for Time Projection Chamber version 2
103 //
37831078 104 fIdSens=0;
105 fIdLSec=0;
106 fIdUSec=0;
107
fe4da5cc 108 SetBufferSize(128000);
73042f01 109
110 SetGasMixt(2,20,10,-1,0.9,0.1,0.); // Ne-CO2 90-10
111
112 // Default sectors
113
114 SetSecAL(4);
115 SetSecAU(4);
116 SetSecLows(1, 2, 3, 19, 20, 21);
117 SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
37831078 118 SetSens(1); // sensitive strips set
73042f01 119
120 if (fTPCParam)
121 fTPCParam->Write(fTPCParam->GetTitle());
fe4da5cc 122}
123
124//_____________________________________________________________________________
125void AliTPCv2::CreateGeometry()
126{
127 //
128 // Create the geometry of Time Projection Chamber version 2
129 //
130 //Begin_Html
131 /*
37831078 132 <img src="picts/AliTPC.gif">
fe4da5cc 133 */
134 //End_Html
135 //Begin_Html
136 /*
1439f98e 137 <img src="picts/AliTPCv2Tree.gif">
fe4da5cc 138 */
139 //End_Html
140
8c555625 141
1283eee5 142 Int_t *idtmed = fIdtmed->GetArray();
143
37831078 144 Float_t dm[50];
62a73ee5 145 Int_t idrotm[120];
1283eee5 146
147 Int_t nRotMat = 0;
148
73042f01 149 Int_t i,ifl1,ifl2=0;
1283eee5 150
37831078 151 // number of sectors
152
1283eee5 153 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
154 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
fe4da5cc 155
156 // ---------------------------------------------------
157 // sector specification check
158 // ---------------------------------------------------
159 if (fSecAL >= 0) {
160 ifl1 = 0;
161
162 for (i = 0; i < 6; ++i) {
1283eee5 163 if (fSecLows[i] >= 0 && fSecLows[i] < 2*nInnerSector) {
fe4da5cc 164 ifl1 = 1;
165 printf("*** SECTOR %d selected\n",fSecLows[i]);
166 }
167 }
168
169 } else {
170 printf("*** ALL LOWER SECTORS SELECTED ***\n");
8c555625 171 ifl1 = 1;
fe4da5cc 172 }
173
174 if (fSecAU >= 0) {
175 ifl2 = 0;
176
177 for (i = 0; i < 12; ++i) {
1283eee5 178 if (fSecUps[i] > 2*nInnerSector-1 &&
179 fSecUps[i] < 2*(nInnerSector+nOuterSector)) {
fe4da5cc 180 ifl2 = 1;
181 printf("*** SECTOR %d selected\n",fSecUps[i]);
182 }
183 }
184
185 } else {
186 printf("*** ALL UPPER SECTORS SELECTED ***\n");
8c555625 187 ifl1 = 1;
fe4da5cc 188 }
189
190 if (ifl1 == 0 && ifl2 == 0) {
191 printf("*** ERROR: AT LEAST ONE SECTOR MUST BE SPECIFIED ***\n");
192 printf("!!! PROGRAM STOPPED !!!\n");
193 exit(1);
194 }
195
196 if ((fSecAL < 0 || fSecAU < 0) && fSens >= 0) {
197 printf("** ERROR: STRIPS CANNOT BE SPECIFIED FOR ALL SECTORS **\n");
198 printf("!!! PROGRAM STOPPED !!!\n");
199 exit(1);
200 }
37831078 201
202 //--------------------------------------------------------------------
203
204 //
205 // Mother volume (Air) - all volumes will be positioned in it
206 //
1283eee5 207
37831078 208 dm[0]=0.;
209 dm[1]=360.;
210 dm[2]=12.;
1283eee5 211
37831078 212 //
213
214 dm[3]= -283.7;
215 dm[4]= 66.2;
216 dm[5]= 277.95;
1283eee5 217
37831078 218 //
1283eee5 219
37831078 220 dm[6]= -255.6;
221 dm[7]= 66.2;
222 dm[8]= 277.95;
1283eee5 223
37831078 224 //
1283eee5 225
37831078 226 dm[9]= -73.3;
227 dm[10]= 59.0;
228 dm[11]= 277.95;
1283eee5 229
37831078 230 //
1283eee5 231
37831078 232 dm[12]= -73.3;
233 dm[13]= 56.9;
234 dm[14]= 277.95;
1283eee5 235
37831078 236 //
1283eee5 237
37831078 238 dm[15]= -72.1;
239 dm[16]= 56.9;
240 dm[17]= 277.95;
1283eee5 241
37831078 242 //
1283eee5 243
37831078 244 dm[18]= -72.1;
245 dm[19]= 60.65;
246 dm[20]= 277.95;
1283eee5 247
37831078 248 //
1283eee5 249
37831078 250 dm[21]= 72.1;
251 dm[22]= 60.65;
252 dm[23]= 277.95;
1283eee5 253
37831078 254 //
1283eee5 255
37831078 256 dm[24]= 72.1;
257 dm[25]= 56.9;
258 dm[26]= 277.95;
1283eee5 259
37831078 260 //
1283eee5 261
37831078 262 dm[27]= 73.3;
263 dm[28]= 56.9;
264 dm[29]= 277.95;
1283eee5 265
37831078 266 //
1283eee5 267
37831078 268 dm[30]= 73.3;
269 dm[31]= 60.65;
270 dm[32]= 277.95;
1283eee5 271
37831078 272 //
1283eee5 273
37831078 274 dm[33]= 250.4;
275 dm[34]= 66.0;
276 dm[35]= 277.95;
1283eee5 277
37831078 278 //
1283eee5 279
37831078 280 dm[36]= 283.7;
281 dm[37]= 66.0;
282 dm[38]= 277.95;
1283eee5 283
1283eee5 284
37831078 285 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,39);
1283eee5 286
1283eee5 287
37831078 288 //-------------------------------------------------------------------
289 // Tpc Outer INsulator (CO2)
290 //-------------------------------------------------------------------
1283eee5 291
37831078 292 dm[0]= 0.;
293 dm[1]= 360.;
294 dm[2]= 6.;
1283eee5 295
37831078 296 //
297
298 dm[3]= -253.6;
299 dm[4]= 258.;
300 dm[5]= 266.65;
1283eee5 301
37831078 302 //
1283eee5 303
37831078 304 dm[6]= -253.;
305 dm[7]= 258.;
306 dm[8]= 266.65;
1283eee5 307
37831078 308 dm[9]= -253.;
309 dm[10]= 258.;
310 dm[11]= 277.97;
1283eee5 311
37831078 312 dm[12]= 253.6;
313 dm[13]= 258.;
314 dm[14]= 277.97;
1283eee5 315
37831078 316 //
1283eee5 317
37831078 318 dm[15]= 253.6;
319 dm[16]= 265.2;
320 dm[17]= 277.95;
1283eee5 321
37831078 322 //
cc80f89e 323
37831078 324 dm[18]= 255.6;
325 dm[19]= 265.2;
326 dm[20]= 277.95;
1283eee5 327
1283eee5 328
37831078 329 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
1283eee5 330
37831078 331 //---------------------------------------------------------------
332 // shreds (G10) - TPC Rings
333 //---------------------------------------------------------------
1283eee5 334
37831078 335 gMC->Gsvolu("TPCR","TUBE",idtmed[12],dm,0);
1283eee5 336
37831078 337 dm[0]= 258.;
338 dm[1]= 266.65;
339 dm[2]= 0.3;
1283eee5 340
37831078 341 gMC->Gsposp("TPCR",1,"TOIN",0.,0.,-253.3,0,"ONLY",dm,3); // left bottom
1283eee5 342
37831078 343 //
1283eee5 344
37831078 345 dm[0]= 258.;
346 dm[1]= 270.9;
347 dm[2]= 0.3;
1283eee5 348
37831078 349 gMC->Gsposp("TPCR",2,"TOIN",0.,0.,253.3,0,"ONLY",dm,3); // right
1283eee5 350
37831078 351 //
1283eee5 352
37831078 353 dm[0]= 272.2;
354 dm[1]= 277.95;
355 dm[2]= 0.3;
1283eee5 356
37831078 357 gMC->Gsposp("TPCR",3,"TOIN",0.,0.,-250.7,0,"ONLY",dm,3); // left top
1283eee5 358
37831078 359 //----------------------------------------------------------------
360 // Tpc Outer Contaiment Vessel
361 // mother volume - Al, daughters - composite (sandwich)
362 //----------------------------------------------------------------
363
364 dm[0]= 0.;
365 dm[1]= 360.;
366 dm[2]=5.;
1283eee5 367
37831078 368 //
cc80f89e 369
37831078 370 dm[3]= -250.4;
371 dm[4]= 272.2;
372 dm[5]= 277.95;
1283eee5 373
37831078 374 //
1283eee5 375
37831078 376 dm[6]= -248.4;
377 dm[7]= 272.2;
378 dm[8]= 277.95;
1283eee5 379
37831078 380 //
1283eee5 381
37831078 382 dm[9]= 253.6;
383 dm[10]= 272.2;
384 dm[11]= 277.95;
1283eee5 385
37831078 386 //
387
388 dm[12]= 253.6;
389 dm[13]= 265.2;
390 dm[14]= 277.95;
391
392 //
393
394 dm[15]= 255.6;
395 dm[16]= 265.2;
396 dm[17]= 277.95;
1283eee5 397
37831078 398 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,18);
399
400 // Daughter volumes
401
402 // Tpc SAndwich 1 - Al
403
404 dm[0]= 274.81;
405 dm[1]= 277.95;
406 dm[2]= 251.7;
407
408 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
409
410 // Tpc SAndwich 2 - Tedlar
411
412 dm[0] += 5.e-3;
413 dm[1] -= 5.e-3;
1283eee5 414
37831078 415 gMC->Gsvolu("TSA2","TUBE",idtmed[9],dm,3);
416
417 // Tpc SAndwich 3 - Kevlar
418
419 dm[0] += 5e-3;
420 dm[1] -= 5.e-3;
421
422 gMC->Gsvolu("TSA3","TUBE",idtmed[5],dm,3);
423
424 // Tpc SAndwich 4 - NOMEX honeycomb
1283eee5 425
37831078 426 dm[0] += 0.06;
427 dm[1] -= 0.06;
428
429 gMC->Gsvolu("TSA4","TUBE",idtmed[5],dm,3);
1283eee5 430
37831078 431 // 4->3->2->1->TOCV
1283eee5 432
37831078 433 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
434 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
435 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
1283eee5 436
37831078 437 gMC->Gspos("TSA1",1,"TOCV",0.,0.,2.6,0,"ONLY");
1283eee5 438
37831078 439 // TCOV-> TOIN
1283eee5 440
37831078 441 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
1283eee5 442
37831078 443 //-------------------------------------------------------
444 // Tpc Outer Field Cage
445 // mother volume - Al, daughters - composite (sandwich)
446 //-------------------------------------------------------
1283eee5 447
37831078 448 dm[0]=0.;
449 dm[1]=360.;
450 dm[2]=6.;
1283eee5 451
37831078 452 dm[3]= -253.;
453 dm[4]= 258.;
454 dm[5]= 277.95;
1283eee5 455
37831078 456 //
8c555625 457
37831078 458 dm[6]= -251.;
459 dm[7]= 258.;
460 dm[8]= 277.95;
8c555625 461
37831078 462 //
463
464 dm[9]= -251.;
465 dm[10]= 258.;
466 dm[11]= 260.05;
467
468 //
8c555625 469
37831078 470 dm[12]= 251.;
471 dm[13]= 258.;
472 dm[14]= 260.05;
1283eee5 473
37831078 474 //
1283eee5 475
37831078 476 dm[15]= 251.;
477 dm[16]= 258.;
478 dm[17]= 260.05;
8c555625 479
37831078 480 //
fe4da5cc 481
37831078 482 dm[18]= 253.;
483 dm[19]= 258.;
484 dm[20]= 270.9;
fe4da5cc 485
37831078 486 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
fe4da5cc 487
37831078 488 // Daughter volumes
fe4da5cc 489
37831078 490 // Tpc SAndwich 5 - Al
1283eee5 491
37831078 492 dm[0]= 258.;
493 dm[1]= 260.05;
494 dm[2]= 251.7;
1283eee5 495
37831078 496 gMC->Gsvolu("TSA5","TUBE",idtmed[4],dm,3);
1283eee5 497
37831078 498 // Tpc SAndwich 6 - Tedlar
1283eee5 499
37831078 500 dm[0] += 5.e-3;
501 dm[1] -= 5.e-3;
1283eee5 502
37831078 503 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
1283eee5 504
37831078 505 // Tpc SAndwich 7 - Kevlar
1283eee5 506
37831078 507 dm[0] += 5.e-3;
508 dm[1] -= 5.e-3;
1283eee5 509
37831078 510 gMC->Gsvolu("TSA7","TUBE",idtmed[5],dm,3);
1283eee5 511
37831078 512 // Tpc SAndwich 8 - NOMEX
1283eee5 513
37831078 514 dm[0] += 0.02;
515 dm[1] -= 0.02;
1283eee5 516
37831078 517 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
1283eee5 518
37831078 519 // 8->7->6->5->TOFC
1283eee5 520
37831078 521 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
522 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
523 gMC->Gspos("TSA6",1,"TSA5",0.,0.,0.,0,"ONLY");
1283eee5 524
37831078 525 gMC->Gspos("TSA5",1,"TOFC",0.,0.,0.,0,"ONLY");
1283eee5 526
37831078 527 // TOFC->TOIN
1283eee5 528
37831078 529 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
1283eee5 530
37831078 531 // TOIN->TPC
1283eee5 532
37831078 533 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
1283eee5 534
37831078 535 //--------------------------------------------------------------------
536 // Tpc Inner INsulator (CO2)
537 //--------------------------------------------------------------------
1283eee5 538
1283eee5 539
37831078 540 dm[0]=0.;
541 dm[1]= 360.;
542 dm[2]= 15.;
1283eee5 543
37831078 544 //
1283eee5 545
37831078 546 dm[3]= -255.6;
547 dm[4]= 66.2;
548 dm[5]= 74.8;
1283eee5 549
37831078 550 //
1283eee5 551
37831078 552 Float_t tanL = (66.2-59.0)/(255.6-73.3); // tangent of the left cone part
1283eee5 553
37831078 554 dm[6]= -253.6;
555 dm[7]= 59.0+ (253.6-73.3)*tanL;
556 dm[8]= 74.8;
1283eee5 557
37831078 558 //
1283eee5 559
37831078 560 dm[9]= -253.6;
561 dm[10]= dm[7];
562 dm[11]= 79.2;
fe4da5cc 563
37831078 564 //
fe4da5cc 565
37831078 566 dm[12]= -73.3;
567 dm[13]= 59.0;
568 dm[14]= 79.2;
1283eee5 569
37831078 570 //
571
572 dm[15]= -73.3;
573 dm[16]= 56.9;
574 dm[17]= 79.2;
575
576 //
577
578 dm[18]= -72.1;
579 dm[19]= 59.6;
580 dm[20]= 79.2;
581
582 //
583
584 dm[21]= -72.1;
585 dm[22]= 60.65;
586 dm[23]= 79.2;
587
588 //
589
590 dm[24]= 72.1;
591 dm[25]= 60.65;
592 dm[26]= 79.2;
593
594 //
595
596 dm[27]= 72.1;
597 dm[28]= 59.6;
598 dm[29]= 79.2;
599
600 //
601
602 dm[30]= 73.3;
603 dm[31]= 56.9;
604 dm[32]= 79.2;
605
606 //
607
608 dm[33]= 73.3;
609 dm[34]= 59.0;
610 dm[35]= 79.2;
611
612 //
613
614 dm[36]= 250.4;
615 dm[37]= 66.0;
616 dm[38]= 79.2;
617
618 //
619
620 dm[39]= 253.0;
621 dm[40]= 66.0;
622 dm[41]= 79.2;
623
624 //
625
626 dm[42]= 253.0;
627 dm[43]= 75.3;
628 dm[44]= 79.2;
629
630 //
631
632 dm[45]= 253.6;
633 dm[46]= 75.3;
634 dm[47]= 79.2;
635
636 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,48);
637
638
639 //--------------------------------------------------------------------
640 // Tpc Inner Containment vessel, Left part
641 // mother volume - Al, daughter - composite (sandwich)
642 //--------------------------------------------------------------------
643
644 dm[0]= 0.;
645 dm[1]= 360.;
646 dm[2]= 8.;
647
648 //
649
650 dm[3]= -255.6;
651 dm[4]= 66.2;
652 dm[5]= 74.8;
653
654 //
655
656 Float_t cosL = 1./TMath::Sqrt(1.+tanL*tanL);
657 Float_t sandThick = 2.14; // cone composite thickness
658
659
660 //
661
662 dm[6]= -253.6;
663 dm[7]= 59.0 + (253.6-73.3)*tanL;
664 dm[8]= 74.8;
665
666 //
667
668 dm[9]= -253.6;
669 dm[10]= dm[7];
670 dm[11]= dm[7]+sandThick/cosL;
671
672 //
1283eee5 673
37831078 674 dm[12]= -75.6;
675 dm[13]= 59.0+(75.6-73.3)*tanL;
676 dm[14]= dm[13]+sandThick/cosL;
1283eee5 677
37831078 678 //
679
680 dm[15]= -75.6;
681 dm[16]= dm[13];
682 dm[17]= 60.65;
683
684 //
685
686 dm[18]= -73.3;
687 dm[19]= 59.0;
688 dm[20]= 60.65;
689
690 //
691
692 dm[21]= -73.3;
693 dm[22]= 56.9;
694 dm[23]= 60.65;
695
696 //
697
698 dm[24]= -72.1;
699 dm[25]= 56.9;
700 dm[26]= 60.65;
701
702 gMC->Gsvolu("TICL","PCON",idtmed[4],dm,27);
703
704 // Daughter volumes
705
706 // Tpc SAndwich 9 - Al
707
708 dm[0]= 0.;
709 dm[1]= 360.;
710 dm[2]= 2.;
711
712 //
713
714 dm[3]= - 254.3;
715 dm[4]= 59.0+(254.3-73.3)*tanL;
716 dm[5]= dm[4]+sandThick/cosL;
717
718 //
719
720 dm[6]= -78.3;
721 dm[7]= 59.0+(78.3-73.3)*tanL;
722 dm[8]= dm[7]+sandThick/cosL;
723
724 //
725
726 gMC->Gsvolu("TSA9","PCON",idtmed[4],dm,9);
727
728 // Tpc SAndwich 10 - Tedlar
729
730 dm[4]+= 5.e-3/cosL;
731 dm[5]-= 5.e-3/cosL;
732
733 //
734
735 dm[7]+= 5.e-3/cosL;
736 dm[8]+= 5.e-3/cosL;
737
738 gMC->Gsvolu("TS10","PCON",idtmed[9],dm,9);
739
740 // Tpc SAndwich 11 - Kevlar
741
742 dm[4]+= 5.e-3/cosL;
743 dm[5]-= 5.e-3/cosL;
744
745 //
746
747 dm[7]+= 5.e-3/cosL;
748 dm[8]+= 5.e-3/cosL;
749
750 gMC->Gsvolu("TS11","PCON",idtmed[5],dm,9);
751
752 // Tpc SAndwich 12 - NOMEX
753
754 dm[4]+= 0.06/cosL;
755 dm[5]-= 0.06/cosL;
756
757 //
758
759 dm[7]+= 0.06/cosL;
760 dm[8]+= 0.06/cosL;
761
762 gMC->Gsvolu("TS12","PCON",idtmed[6],dm,9);
763
764 // 12->11->10->9
765
766 gMC->Gspos("TS12",1,"TS11",0.,0.,0.,0,"ONLY");
767 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
768 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
769
770 // TSA9->TICL
771
772 gMC->Gspos("TSA9",1,"TICL",0.,0.,0.,0,"ONLY");
1283eee5 773
37831078 774 //--------------------------------------------------------------------
775 // Tpc Inner Containment vessel, Right part
776 // mother volume - Al, daughter - composite (sandwich)
777 //--------------------------------------------------------------------
1283eee5 778
37831078 779 dm[0]= 0.;
780 dm[1]= 360.;
781 dm[2]=8.;
1283eee5 782
37831078 783 //
1283eee5 784
37831078 785 dm[3]= 72.1;
786 dm[4]= 56.9;
787 dm[5]= 60.65;
1283eee5 788
37831078 789 //
1283eee5 790
37831078 791 dm[6]= 73.3;
792 dm[7]= 56.9;
793 dm[8]= 60.65;
1283eee5 794
37831078 795 //
1283eee5 796
37831078 797 dm[9]= 73.3;
798 dm[10]= 59.0;
799 dm[11]= 60.65;
1283eee5 800
37831078 801 //
1283eee5 802
37831078 803 Float_t tanR = (66.0-59.0)/(250.5-73.3); // to avoid accuracy problems
804 Float_t cosR = 1./TMath::Sqrt(1.+tanR*tanR); //as above
1283eee5 805
37831078 806 //
1283eee5 807
37831078 808 dm[12]= 75.6;
809 dm[13]= 59.0+(75.6-73.3)*tanR;
810 dm[14]= 60.65;
1283eee5 811
37831078 812 //
1283eee5 813
37831078 814 dm[15]= 75.6;
815 dm[16]= dm[13];
816 dm[17]= dm[16]+sandThick/cosR;
1283eee5 817
37831078 818 //
1283eee5 819
37831078 820 dm[18]= 248.4;
821 dm[19]= 59.0+(248.4-73.3)*tanR;
822 dm[20]= dm[19]+sandThick/cosR;
1283eee5 823
37831078 824 //
1283eee5 825
37831078 826 dm[21]= 248.4;
827 dm[22]= dm[19];
828 dm[23]= 70.2;
1283eee5 829
37831078 830 //
1283eee5 831
37831078 832 dm[24]= 250.4;
833 dm[25]= 66.0;
834 dm[26]= 70.2;
1283eee5 835
37831078 836 gMC->Gsvolu("TICR","PCON",idtmed[4],dm,27);
1283eee5 837
1283eee5 838
1283eee5 839
37831078 840 // Daughter volumes
1283eee5 841
37831078 842 // Tpc SAndwich 13 - Al
1283eee5 843
37831078 844 dm[0]= 0.;
845 dm[1]= 360.;
846 dm[2]= 2.;
1283eee5 847
37831078 848 //
1283eee5 849
37831078 850 dm[3]= 78.3;
851 dm[4]= 59.0+(78.3-73.3)*tanR;
852 dm[5]= dm[4]+sandThick/cosR;
1283eee5 853
37831078 854 //
855
856 dm[6]= 249.1;
857 dm[7]= 59.0+(249.1-73.3)*tanR;
858 dm[8]= dm[7]+sandThick/cosR;
859
860 //
861
862 gMC->Gsvolu("TS13","PCON",idtmed[4],dm,9);
1283eee5 863
37831078 864 // Tpc SAndwich 14 - Tedlar
1283eee5 865
37831078 866 dm[4]+= 5.e-3/cosR;
867 dm[5]-= 5.e-3/cosR;
1283eee5 868
869 //
37831078 870
871 dm[7]+= 5.e-3/cosR;
872 dm[8]+= 5.e-3/cosR;
873
874 gMC->Gsvolu("TS14","PCON",idtmed[9],dm,9);
875
876 // Tpc SAndwich 15 - Kevlar
877
878 dm[4]+= 5.e-3/cosR;
879 dm[5]-= 5.e-3/cosR;
880
1283eee5 881 //
882
37831078 883 dm[7]+= 5.e-3/cosR;
884 dm[8]+= 5.e-3/cosR;
1283eee5 885
37831078 886 gMC->Gsvolu("TS15","PCON",idtmed[5],dm,9);
1283eee5 887
37831078 888 // Tpc SAndwich 16 - NOMEX
1283eee5 889
37831078 890 dm[4]+= 0.06/cosR;
891 dm[5]-= 0.06/cosR;
1283eee5 892
37831078 893 //
894
895 dm[7]+= 0.06/cosR;
896 dm[8]+= 0.06/cosR;
897
898 gMC->Gsvolu("TS16","PCON",idtmed[6],dm,9);
1283eee5 899
37831078 900 // 16->15->14->13
1283eee5 901
37831078 902 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
903 gMC->Gspos("TS15",1,"TS14",0.,0.,0.,0,"ONLY");
904 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
1283eee5 905
37831078 906 // TS12->TICR
907
908 gMC->Gspos("TS13",1,"TICR",0.,0.,0.,0,"ONLY");
909
910 //------------------------------------------------------
911 // Tpc Inner Field Cage
912 // mother volume - Al, daughters - composite (sandwich)
913 //------------------------------------------------------
914
915 dm[0]= 0.;
916 dm[1]= 360.;
917 dm[2]=6.;
1283eee5 918
919 //
37831078 920
921 dm[3]= -253.0;
922 dm[4]= 70.7;
923 dm[5]= 79.2;
924
1283eee5 925 //
926
37831078 927 dm[6]= -251.0;
928 dm[7]= 70.7;
929 dm[8]= 79.2;
1283eee5 930
37831078 931 //
1283eee5 932
37831078 933 dm[9]= -251.0;
934 dm[10]= 77.15;
935 dm[11]= 79.2;
936
937 //
1283eee5 938
37831078 939 dm[12]= 251.0;
940 dm[13]= 77.15;
941 dm[14]= 79.2;
1283eee5 942
37831078 943 //
1283eee5 944
37831078 945 dm[15]= 251.0;
946 dm[16]= 66.0;
947 dm[17]= 79.2;
1283eee5 948
37831078 949 //
1283eee5 950
37831078 951 dm[18]= 253.0;
952 dm[19]= 66.0;
953 dm[20]= 79.2;
1283eee5 954
37831078 955 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,21);
1283eee5 956
37831078 957 // Daughter volumes
1283eee5 958
37831078 959 // Tpc Sandwich 17 - Al
1283eee5 960
37831078 961 dm[0]= 77.15;
962 dm[1]= 79.2;
963 dm[2]= 251.7;
1283eee5 964
37831078 965 gMC->Gsvolu("TS17","TUBE",idtmed[4],dm,3);
1283eee5 966
37831078 967 // Tpc Sandwich 18 - Tedlar
1283eee5 968
37831078 969 dm[0]+= 5.e-3;
970 dm[1]-= 5.e-3;
1283eee5 971
37831078 972 gMC->Gsvolu("TS18","TUBE",idtmed[9],dm,3);
1283eee5 973
37831078 974 // Tpc Sandwich 19 - Kevlar
1283eee5 975
37831078 976 dm[0]+= 5.e-3;
977 dm[1]-= 5.e-3;
1283eee5 978
37831078 979 gMC->Gsvolu("TS19","TUBE",idtmed[5],dm,3);
1283eee5 980
37831078 981 // Tpc Sandwich 20 - NOMEX
1283eee5 982
37831078 983 dm[0]+= 0.06;
984 dm[1]-= 0.06;
1283eee5 985
37831078 986 gMC->Gsvolu("TS20","TUBE",idtmed[6],dm,3);
1283eee5 987
37831078 988 // 20->19->18->17
1283eee5 989
37831078 990 gMC->Gspos("TS20",1,"TS19",0.,0.,0.,0,"ONLY");
991 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
992 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
1283eee5 993
37831078 994 // TS17->TIFC
1283eee5 995
37831078 996 gMC->Gspos("TS17",1,"TIFC",0.,0.,0.,0,"ONLY");
1283eee5 997
37831078 998 // TPC Rings
1283eee5 999
37831078 1000 dm[0]= 70.7;
1001 dm[1]= 79.2;
1002 dm[2]= 0.3;
1283eee5 1003
37831078 1004 gMC->Gsposp("TPCR",4,"TIIN",0.,0.,-253.3,0,"ONLY",dm,3);
1283eee5 1005
37831078 1006 dm[0]= 66.0;
1007 dm[1]= 70.2;
1283eee5 1008
37831078 1009 gMC->Gsposp("TPCR",5,"TIIN",0.,0.,250.7,0,"ONLY",dm,3);
1283eee5 1010
37831078 1011 dm[0]= 75.3;
1012 dm[1]= 79.2;
1283eee5 1013
37831078 1014 gMC->Gsposp("TPCR",6,"TIIN",0.,0.,253.3,0,"ONLY",dm,3);
1283eee5 1015
37831078 1016 // TICL->TIIN
1283eee5 1017
37831078 1018 gMC->Gspos("TICL",1,"TIIN",0.,0.,0.,0,"ONLY");
1283eee5 1019
37831078 1020 // TICR->TIIN
1283eee5 1021
37831078 1022 gMC->Gspos("TICR",1,"TIIN",0.,0.,0.,0,"ONLY");
1283eee5 1023
37831078 1024 // TIFC->TIIN
1025
1026 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
1027
1028 // Tpc Sandwich 21 - Al (central barrel)
1029
1030 dm[0]= 77.15;
1031 dm[1]= 79.2;
1032 dm[2]= 75.2;
1033
1034 gMC->Gsvolu("TS21","TUBE",idtmed[4],dm,3);
1035
1036 // Tpc Sandwich 22 - Tedlar (central barrel)
1037
1038 dm[0]+= 5.e-3;
1039 dm[1]-= 5.e-3;
1040
1041 gMC->Gsvolu("TS22","TUBE",idtmed[9],dm,3);
1042
1043 // Tpc Sandwich 23 - Kevlar (central barrel)
1044
1045 dm[0]+= 5.e-3;
1046 dm[1]-= 5.e-3;
1047
1048 gMC->Gsvolu("TS23","TUBE",idtmed[5],dm,3);
1049
1050 // Tpc Sandwich 24 - NOMEX (central barrel)
1051
1052 dm[0]+= 0.02;
1053 dm[1]-= 0.02;
1054
1055 gMC->Gsvolu("TS24","TUBE",idtmed[6],dm,3);
1056
1057 // 24->23->22->21
1058
1059 gMC->Gspos("TS24",1,"TS23",0.,0.,0.,0,"ONLY");
1060 gMC->Gspos("TS23",1,"TS22",0.,0.,0.,0,"ONLY");
1061 gMC->Gspos("TS22",1,"TS21",0.,0.,0.,0,"ONLY");
1062
1063 gMC->Gspos("TS21",1,"TIIN",0.,0.,0.,0,"ONLY");
1064
1065 // put everything into the TPC
1066
1067 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
1283eee5 1068
1283eee5 1069
1283eee5 1070 //---------------------------------------------------------
37831078 1071 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
1072 // and its daughters (HV membrane, rods, readout chambers)
1283eee5 1073 //---------------------------------------------------------
1074
37831078 1075 dm[0]= 79.2;
1076 dm[1]= 258.0;
1077 dm[2]= 253.6;
1078
1079 gMC->Gsvolu("TDGN","TUBE",idtmed[1],dm,3); // nonsensitive
1080
1081 // sector opening angles
1082
1083 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
1084 Float_t outerOpenAngle = fTPCParam->GetOuterAngle();
1085
1086 // sector angle shift
1087
1088 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
1089
1090 // All above parameters are identical for inner and outer
1091 // sectors. The distinction is kept for the historical reasons
1092 // and eventually will disappear.
1093
1094 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
1095 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
1096 Float_t space;
1097
1098 //-------------------------------------------------------------------------
1099 // Tpc Inner Readout Chambers
1100 //-------------------------------------------------------------------------
1101
1102 dm[0]= 14.483;
1103 dm[1]= 23.3345;
1104 dm[2]= 1.6; // thickness
1105 dm[3]= 25.1;
1106
1107 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
1108
1109 // this volume will be positioned in the empty space
1110 // of the end-cap to avoid overlaps
1111
1112 dm[0]= 13.7305;
1113 dm[1]= 21.1895;
1114 dm[2]= 2.25;
1115 dm[3]= 21.15;
1116
1117 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
1118
1119 //------------------------------------------------
1120 // Tpc Inner readout chamber Pad Plane
1121 //------------------------------------------------
1122
1123 dm[0]= 14.483;
1124 dm[1]= 23.3345;
1125 dm[2]= 0.5;
1126 dm[3]= 25.1;
1127
1128 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
1129
1130 //
1131
1132 dm[0] -= 1.218511934;
1133 dm[1] -= 1.218511934;
1134 dm[2] = 0.35;
1283eee5 1135
37831078 1136 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
1283eee5 1137
37831078 1138 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
1283eee5 1139
37831078 1140 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
1283eee5 1141
37831078 1142 //----------------------------------------------
1143 // Tpc Readout Chambers Empty spaces - for both
1144 // inner and outer sectors
1145 //----------------------------------------------
1283eee5 1146
37831078 1147 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
1283eee5 1148
37831078 1149 // Inner sector - 4 spaces
1283eee5 1150
1283eee5 1151
37831078 1152 dm[3] = 4.7625;
1153 dm[0] = 12.472;
1283eee5 1154
37831078 1155 Float_t rr = 90.52;
1156 Float_t zz;
1283eee5 1157
37831078 1158 zz= -12.7875;
1159
1160 space = rr*tanAlpha-dm[0];
1161
1162 for(Int_t nsLow=0;nsLow<4;nsLow++){
1163
1164 rr += 9.525;
1165 dm[1]= rr*tanAlpha - space;
1166
1167 dm[2]=0.8;
1168
1169 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1170
1171 //
1283eee5 1172
37831078 1173 dm[2]= 1.2;
1283eee5 1174
37831078 1175 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1176
1177 rr += 0.4;
1178 dm[0] = rr*tanAlpha - space;
1179 zz += (0.4+9.525);
1283eee5 1180
1181 }
1182
37831078 1183 dm[0]= 12.472;
1184 // dm[1] - this is the dm[1] from the previous TRCE
1185 dm[2]= 1.05;
1186 dm[3]= 19.65;
1283eee5 1187
37831078 1188 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
1283eee5 1189
37831078 1190 //
1191 // TPc Space for Connectors
1192 //
1283eee5 1193
37831078 1194 dm[0]= .3;
1195 dm[1]= .3;
1196 dm[2]= 4.5;
1283eee5 1197
37831078 1198 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1283eee5 1199
37831078 1200 // TPC Connectors
1283eee5 1201
37831078 1202 dm[0]= .25;
1203 dm[1]= .15;
1204 dm[2]= 3.75;
1283eee5 1205
37831078 1206 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1283eee5 1207
37831078 1208 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1283eee5 1209
37831078 1210 zz = -12.7875;
1283eee5 1211
37831078 1212 Float_t alpha;
1213 Float_t astep;
1283eee5 1214
37831078 1215 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
1283eee5 1216
37831078 1217 // inner part of the inner sector - 2 x 20 holes
1218
1219 astep = 20.00096874/19.;
1220
1221 alpha = 10.00048437-astep;
1222
1223 Float_t x1,x2;
1224
1225 x1 = 13.31175725;
1226 x1 -= 0.996357832;
1227
1228 x2 = 15.06180253;
1229 x2 -= 1.163028812;
1230
1231 Int_t ncon;
1232
1233 for(ncon=0;ncon<20;ncon++){
1234
1235 phi1 = 0.;
1236 theta1 = 90.+alpha;
1237 phi2=90.;
1238 theta2 = 90.;
1239 phi3 = (alpha>0) ? 0. : 180.;
1240 theta3 = TMath::Abs(alpha);
1241
1242 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1243
1244
1283eee5 1245
37831078 1246 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1247 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1248
1249
1250 x1 -= 1.296357833;
1251 x2 -= 1.463028812;
1252
1253 alpha -= astep;
1254 nRotMat++;
1255
1256 }
1257
1258 // outer part of the inner sector - 2 x 25 holes
1259
1260 astep = 20.00096874/24.;
1261 alpha = 10.00048437-astep;
1262
1263 x1 = 16.81184781;
1264 x1 -= 1.016295986;
1265
1266 x2 = 18.5618931;
1267 x2 -= 1.150914854;
1268
1269 for(ncon=0;ncon<25;ncon++){
1270
1271 phi1 = 0.;
1272 theta1 = 90.+alpha;
1273 phi2=90.;
1274 theta2 = 90.;
1275 phi3 = (alpha>0) ? 0. : 180.;
1276 theta3 = TMath::Abs(alpha);
1277
1278 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1279
1280
1281
1282 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1283 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1284
1285
1286 x1 -= 1.316295986;
1287 x2 -= 1.450914854;
1288
1289 alpha -= astep;
1290 nRotMat++;
1283eee5 1291
1292 }
37831078 1293
1294 //--------------------------------------------------------------------------
1295 // TPC Outer Readout Chambers
1296 // this is NOT a final design
1297 //--------------------------------------------------------------------------
1298
1299 dm[0]= 23.3875;
1300 dm[1]= 43.524;
1301 dm[2]= 1.5; //thickness
1302 dm[3]= 57.1;
1303
1304 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1305
1306 //------------------------------------------------
1307 // Tpc Outer readout chamber Pad Plane
1308 //------------------------------------------------
1309
1310 dm[2]= 0.5;
1311
1312 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1313
1314 dm[0] -= 1.218511934;
1315 dm[1] -= 1.218511934;
1316 dm[2] = 0.35;
1317
1318 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1319
1320 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1321
1322 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1323
1324 // empty space
1325
1326
1327 dm[0]= 21.035;
1328 dm[1]= 38.7205;
1329 dm[2]= 0.7;
1330 dm[3]= 50.15;
1331
1332 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1333
1334 dm[0]= 22.2935;
1335 dm[1]= 40.5085;
1336 dm[2]= 2.25;
1337 dm[3]= 51.65;
1338
1339 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1340
1341 dm[0]= 21.35;
1342 dm[1]= 38.7205;
1343 dm[2]= 2.25;
1344 dm[3]= 50.15;
1345
1346 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1347
1348
1349
1350 //-----------------------------------------------
1351 // Tpc Services Support Wheel
1352 //-----------------------------------------------
1353
1354 dm[0]=0.;
1355 dm[1]=360.;
1356 dm[2]=18.;
1357 dm[3]=2.;
1358
1359 dm[4]= -5.;
1360 dm[5]= 77.017;
1361 dm[6]= 255.267;
1362
1363 dm[7]= 5.;
1364 dm[8]= dm[5];
1365 dm[9]= dm[6];
1366
1367 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1368
1369 // Tpc Services Wheel Cover
1370
1371 dm[4]= -0.5;
1372 dm[7]= 0.5;
1373
1374 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1375
1376 // Tpc Service wheel Cover Empty space
1377
1378 dm[0]= 10.99;
1379 dm[1]= 39.599;
1380 dm[2]= .5;
1381 dm[3]= 81.125;
1382
1383 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1384
1385 // Tpc services Wheel Empty Spaces
1386
1387 dm[0]= 13.18017507;
1388 dm[1]= 44.61045938;
1389 dm[2]= 4.;
1390 dm[3]= 89.125;
1391
1392 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1393
1394 // Tpc Services Wheel Bars
1395
1396 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1397
1398 // bars-> TWES
1399
1400 dm[2]= 4.;
1401 dm[3]= .4;
1402
1403 dm[0]= 13.8149522;
1404 dm[1]= 13.95601379;
1283eee5 1405
37831078 1406 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1407
1408 dm[0]= 43.83462067;
1409 dm[1]= 43.97568225;
1410
1411 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1412
1413 // TPc ELectronics - right now 30% X0 Si
1283eee5 1414
37831078 1415 dm[0]= 14.03813696;
1416 dm[1]= 43.3524075;
1417 dm[2]= 1.404;
1418 dm[3]= 83.125;
1419
1420 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1421 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1422
1423 //--------------------------------------------------------------------------
1424 // End caps
1425 //--------------------------------------------------------------------------
1426
1427 // TPc Main Wheel - Al
1428
1429 dm[0]= 75.3;
1430 dm[1]= 264.8;
1431 dm[2]= 3.0;
1432
1433 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1434
1435 // TPc Extra Wheel (to avoid overlapping) - Al
1436
1437 dm[0]= 264.8;
1438 dm[1]= 277.0;
1439 dm[2]= 1.95;
1440
1441 gMC->Gsvolu("TPEW","TUBE",idtmed[4],dm,3);
1442
1443 //--------------------------------------------------------------------------
1444 // Tpc Empty Space for the Readout chambers
1445 //--------------------------------------------------------------------------
1446
1447 Float_t rLow= 86.2;
1448 Float_t rUp= 243.5;
1449 Float_t dR = 0.5*(rUp-rLow);
1450
1451 space= 1.4/cosAlpha; // wheel ribs are 2.8 cm wide
1452
1453 dm[0]= rLow*tanAlpha-space;
1454 dm[1]= rUp*tanAlpha-space;
1455 dm[2]= 3.0;
1456 dm[3]= dR;
1457
1458 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1459
1460 // TIC1->TESR
1461
1462
1463 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1464
1465
1466 // TOC1->TESR
1467
1468 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1469
1470 // Tpc Empty Space Bars - Al (daughters of TESR)
1471
1472 Float_t zBar;
1473
1474 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1475
1476 // lower bar
1477
1478 dm[0]= rLow*tanAlpha-space;
1479 dm[1]= 88.7*tanAlpha-space;
1480 dm[2]= 0.95;
1481 dm[3]= 1.275;
1482
1483 zBar = -dR+dm[3];
1484
1485 gMC->Gsposp("TESB",1,"TESR",0.,2.05,zBar,0,"ONLY",dm,4);
1486
1487 // middle bar
1488
1489 dm[0]= 131.65*tanAlpha-space;
1490 dm[1]= 136.5*tanAlpha-space;
1491 dm[3]= 2.425;
1492
1493 zBar = -dR +131.65+dm[3]-rLow;
1494
1495 gMC->Gsposp("TESB",2,"TESR",0.,2.05,zBar,0,"ONLY",dm,4);
1496
1497 // upper bar
1498
1499 dm[0]= 240.4*tanAlpha-space;
1500 dm[1]= rUp*tanAlpha-space;
1501 dm[3]= 1.55;
1502
1503 zBar = dR-dm[3];
1504
1505 gMC->Gsposp("TESB",3,"TESR",0.,2.05,zBar,0,"ONLY",dm,4);
1506
1507 //------------------------------------------------------
1508 // TPc Lower "S" Sectors
1509 //------------------------------------------------------
1510
1511
1512 Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow();
1513 Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp();
1514
1515 dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1516 dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1517 dm[2] = 0.5*(250. - 0.3);
1518 dm[3] = 0.5*(inSecUpEdge-inSecLowEdge);
1519
1520 gMC->Gsvolu("TPLS", "TRD1", idtmed[2], dm, 4); // sensitive
1521
1522 //----------------------------------------------------------
1523 // TPc Upper Sectors
1524 //----------------------------------------------------------
1525
1526 Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow();
1527 Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp();
1528
1529 dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1530 dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1531 dm[2] = 0.5*(250. - 0.3);
1532 dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge);
1533
1534 gMC->Gsvolu("TPUS", "TRD1", idtmed[2], dm, 4); // sensitive
1535
1536
1537 // if sensitive strips selected
1538
1539 if(fSens >= 0){
1540
1541 gMC->Gsvolu("TPSS","TRD1",idtmed[2],dm,0); // sensitive
1542
1543 Int_t nofStrips,nstr;
1544 Float_t r1,r2,zs;
1545 Float_t stripThick = 0.01; // 100 microns
1546 Float_t deadSpace;
1547
1548 // inner sector
1549
1550 nofStrips = fTPCParam->GetNRowLow();
1551 deadSpace = fTPCParam->GetInnerWireMount();
1552
1553 dm[2] = 0.5*(250. - 0.3);
1554 dm[3] = 0.5 * stripThick;
1555
1556 for(nstr=0;nstr<nofStrips;nstr++){
1557
1558 r1 = fTPCParam->GetPadRowRadiiLow(nstr);
1559 r2 = r1 + stripThick;
1560 dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1561 dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1562 zs = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge);
1563 zs += r1;
1564 zs += dm[3];
1565
1566 gMC->Gsposp("TPSS", nstr+1, "TPLS", 0., 0., zs, 0, "ONLY", dm, 4);
1567
1568 gMC->Gsord("TPLS",3);
1569
1570 }
1571
1572 Int_t nsSave = nofStrips;
1573
1574 // outer sector
1575
1576 nofStrips = fTPCParam->GetNRowUp();
1577 deadSpace = fTPCParam->GetOuterWireMount();
1578
1579 dm[2] = 0.5*(250. - 0.3);
1580 dm[3] = 0.5 * stripThick;
1283eee5 1581
37831078 1582 for(nstr=0;nstr<nofStrips;nstr++){
1583
1584 r1 = fTPCParam->GetPadRowRadiiUp(nstr);
1585 r2 = r1 + stripThick;
1586 dm[0] = r1 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1587 dm[1] = r2 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1588 zs = -ouSecLowEdge -0.5*(ouSecUpEdge-ouSecLowEdge);
1589 zs += r1;
1590 zs += dm[3];
1591
1592 gMC->Gsposp("TPSS", nstr+1+nsSave, "TPUS", 0., 0., zs, 0, "ONLY", dm, 4);
1593
1594 }
1595 } // if strips
1596
1597 //-------------------------------------------------------
1598 // positioning of the empty spaces into the main wheel
1599 // and readout chambers and sectors into the drift gas
1600 //-------------------------------------------------------
1601
1602 Float_t rCenter,xc,yc;
1603 Float_t rInner,rOuter; // center of the inner and outer chamber
1604
1605 rCenter = rLow+dR;
1606
1607 rInner = 108.07;
1608 rOuter = 190.68;
1609
1610 for(Int_t ns=0; ns<nInnerSector;ns++){
1611
1612 phi1 = ns * innerOpenAngle + innerAngleShift;
1613 phi1 *= kRaddeg; // in degrees
1614
1615 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1616
1617 if (phi1 > 360.) phi1 -= 360.;
1618
1619 theta1 = 90.;
1620 phi2 = 90.;
1621 theta2 = 180.;
1622 phi3 = ns * innerOpenAngle + innerAngleShift;
1623 phi3 *= kRaddeg; // in degrees
1624
1625 phi3 = (Float_t)TMath::Nint(phi3);
1626
1627 if(phi3 > 360.) phi3 -= 360.;
1628
1629 theta3 = 90.;
1630
1631 // "holes"->End plate
1632
1633 xc = rCenter*TMath::Cos(phi3*kDegrad);
1634 yc = rCenter*TMath::Sin(phi3*kDegrad);
1635
1636 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1637
1638 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1639
1640 // TSCE->TSWC (services wheel volumes)
1641
1642 xc = 166.142*TMath::Cos(phi3*kDegrad);
1643 yc = 166.142*TMath::Sin(phi3*kDegrad);
1644
1645 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1646 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1647
1648 // readout chambers->TDGN (drift gas)
1649
1650 xc = rInner*TMath::Cos(phi3*kDegrad);
1651 yc = rInner*TMath::Sin(phi3*kDegrad);
1652
1653 gMC->Gspos("TIRC",ns+1,"TDGN",xc,yc,252.,idrotm[nRotMat],"ONLY");
1654
1655 // here lower sectors
1656
1657 if(fSecAL <0){
1658
1659 // all lower sectors are positioned
1660
1661 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.15,idrotm[nRotMat],"ONLY");
1662 gMC->
1663 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.15,idrotm[nRotMat],"ONLY");
1664 }
1665 else{
1666
1667 // only selected sectors are positioned (up to 6 sectors)
1668
1669 for(Int_t sel=0;sel<6;sel++){
1670
1671 if(fSecLows[sel] == ns){
1672 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.15,idrotm[nRotMat],"ONLY");
1673 }
1674 else if(fSecLows[sel] == ns+nInnerSector){
1675 gMC->
1676 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.15,idrotm[nRotMat],"ONLY");
1677 }
1678 }
1679 } // lower sectors finished
1680
1681 xc = rOuter*TMath::Cos(phi3*kDegrad);
1682 yc = rOuter*TMath::Sin(phi3*kDegrad);
1683
1684 gMC->Gspos("TORC",ns+1,"TDGN",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1685
1686 // here upper sectors
1687
1688 if(fSecAU <0){
1689
1690 // all upper sectors
1691
1692 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.15,idrotm[nRotMat],"ONLY");
1693 gMC->
1694 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.15,idrotm[nRotMat],"ONLY");
1695 }
1696 else{
1697
1698 // only selected sectors (up to 12)
1699
1700 for(Int_t sel=0;sel<12;sel++){
1701 if(fSecUps[sel] == ns+2*nInnerSector){
1702 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.15,idrotm[nRotMat],"ONLY");
1703 }
1704 else if(fSecUps[sel] == ns+2*nInnerSector+nOuterSector){
1705 gMC->
1706 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.15,idrotm[nRotMat],"ONLY");
1707 }
1708 }
1709 } // upper sectors finished
1710
1711 nRotMat++;
1712
1713 theta2 = 0.; // reflection, needed for readout chambers!
1714
1715 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1716
1717 xc = rInner*TMath::Cos(phi3*kDegrad);
1718 yc = rInner*TMath::Sin(phi3*kDegrad);
1719
1720 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGN",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1721
1722 xc = rOuter*TMath::Cos(phi3*kDegrad);
1723 yc = rOuter*TMath::Sin(phi3*kDegrad);
1724
1725 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGN",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1726
1727 nRotMat++;
1728
1729
1730 }
1731
1732 // reflection matrix
1283eee5 1733
1734 theta1 = 90.;
1735 phi1 = 0.;
1736 theta2 = 90.;
1737 phi2 = 270.;
1738 theta3 = 180.;
1739 phi3 = 0.;
37831078 1740
1283eee5 1741 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1283eee5 1742
1283eee5 1743
37831078 1744 // TPMW->TPC
1283eee5 1745
37831078 1746 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1747 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[nRotMat],"ONLY");
1748 gMC->Gspos("TPEW",1,"TPC ",0.,0.,257.65,0,"ONLY");
1749 gMC->Gspos("TPEW",2,"TPC ",0.,0.,-257.65,0,"ONLY");
1283eee5 1750
1283eee5 1751
1283eee5 1752
37831078 1753 //-------------------------------------------------------
1754 // Tpc High Voltage Membrane - NOMEX honeycomb
1755 //-------------------------------------------------------
1283eee5 1756
37831078 1757 dm[0]=0.,
1758 dm[1]=360.;
1759 dm[2]=18.;
1760 dm[3]=2.;
1283eee5 1761
37831078 1762 //
1283eee5 1763
37831078 1764 dm[4]= -0.3;
1765 dm[5]= 81.156;
1766 dm[6]= 253.386;
1767
1768 //
1769
1770 dm[7]= 0.3;
1771 dm[8]= dm[5];
1772 dm[9]= dm[6];
1283eee5 1773
37831078 1774 gMC->Gsvolu("THVM","PGON",idtmed[6],dm,10);
1283eee5 1775
37831078 1776 gMC->Gspos("THVM",1,"TDGN",0.,0.,0.,0,"ONLY");
1283eee5 1777
37831078 1778 //----------------------------------------------------------
1779 // TPc Support Rods - MAKROLON
1780 //----------------------------------------------------------
1283eee5 1781
37831078 1782 dm[0]= 0.9;
1783 dm[1]= 1.2;
1784 dm[2]= 126.65;
1283eee5 1785
37831078 1786 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,3);
1283eee5 1787
37831078 1788 for(Int_t nrod=1;nrod<18;nrod++){
1789 Float_t angle=innerOpenAngle*(Float_t)nrod;
1283eee5 1790
37831078 1791 xc=82.4*TMath::Cos(angle);
1792 yc=82.4*TMath::Sin(angle);
1283eee5 1793
37831078 1794 gMC->Gspos("TPSR",nrod,"TDGN",xc,yc,126.95,0,"ONLY");
1795 gMC->Gspos("TPSR",nrod+17,"TDGN",xc,yc,-126.95,0,"ONLY");
1283eee5 1796
37831078 1797 xc=254.2*TMath::Cos(angle);
1798 yc=254.2*TMath::Sin(angle);
1283eee5 1799
37831078 1800 gMC->Gspos("TPSR",nrod+34,"TDGN",xc,yc,126.95,0,"ONLY");
1801 gMC->Gspos("TPSR",nrod+51,"TDGN",xc,yc,-126.95,0,"ONLY");
1283eee5 1802
37831078 1803 }
1283eee5 1804
37831078 1805 //----------------------------------------------------------
1806 // Tpc High Voltage rod - MAKROLON + Copper cable
1807 //----------------------------------------------------------
1808
1809 // rod with cable (Left)
1810
1811 dm[0]=0.;
1812 dm[1]=2.25;
1813 dm[2]=126.65;
1814
1815 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1816
1817 // HV cable
1818
1819 dm[0]=0.;
1820 dm[1]=0.3;
1821 dm[2]=126.65;
1822
1823 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1824
1825 // empty space
1826
1827 dm[0]=0.3;
1828 dm[1]=1.;
1829 dm[2]=126.65;
1830
1831 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1832
1833 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1834 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1835
1836 // rod without cable
1837
1838 dm[0]=1.8;
1839 dm[1]=2.25;
1840 dm[2]=126.65;
1841
1842 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1843
1844
1283eee5 1845
37831078 1846 gMC->Gspos("THVL",1,"TDGN",82.4,0.,-126.95,0,"ONLY");
1847 gMC->Gspos("THVL",2,"TDGN",254.2,0.,-126.95,0,"ONLY");
1848
1849 gMC->Gspos("THVR",1,"TDGN",82.4,0.,126.95,0,"ONLY");
1850 gMC->Gspos("THVR",2,"TDGN",254.2,0.,126.95,0,"ONLY");
1851
1852
1853
1854 gMC->Gspos("TDGN",1,"TPC ",0.,0.,0.,0,"ONLY");
1855
1856 // services wheel cover -> wheel
1857
1858
1859 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1860 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1861
1862
1863 // put the wheel into the TPC
1864
1865 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1866 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1867
1868 gMC->Gsord("TPMW",6);
1869 gMC->Gsord("TPLS",3);
1870 gMC->Gsord("TPUS",3);
1871 gMC->Gsord("TDGN",6);
1872 gMC->Gsord("TSSW",6);
1873 gMC->Gsord("TSWC",6);
1874
1875 // put the TPC into ALIC (main mother volume)
1876
1877 gMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
1283eee5 1878
1879} // end of function
fe4da5cc 1880
1881//_____________________________________________________________________________
8c555625 1882void AliTPCv2::DrawDetector()
fe4da5cc 1883{
1884 //
1885 // Draw a shaded view of the Time Projection Chamber version 1
1886 //
1887
fe4da5cc 1888 // Set everything unseen
cfce8870 1889 gMC->Gsatt("*", "seen", -1);
fe4da5cc 1890 //
1891 // Set ALIC mother transparent
cfce8870 1892 gMC->Gsatt("ALIC","SEEN",0);
fe4da5cc 1893 //
1894 // Set the volumes visible
37831078 1895 //
1896
1897 gMC->Gsatt("TPC ","SEEN",0);
1898 gMC->Gsatt("TOIN","SEEN",1);
1899 gMC->Gsatt("TOIN","COLO",7);
1900 gMC->Gsatt("TPCR","SEEN",0);
1901 gMC->Gsatt("TOCV","SEEN",1);
1902 gMC->Gsatt("TOCV","COLO",4);
1903 gMC->Gsatt("TSA1","SEEN",0);
1904 gMC->Gsatt("TSA2","SEEN",0);
1905 gMC->Gsatt("TSA3","SEEN",0);
1906 gMC->Gsatt("TSA4","SEEN",0);
1907 gMC->Gsatt("TOFC","SEEN",1);
1908 gMC->Gsatt("TOFC","COLO",4);
1909 gMC->Gsatt("TSA5","SEEN",0);
1910 gMC->Gsatt("TSA6","SEEN",0);
1911 gMC->Gsatt("TSA7","SEEN",0);
1912 gMC->Gsatt("TSA8","SEEN",0);
1913 gMC->Gsatt("TIIN","COLO",7);
1914 gMC->Gsatt("TIIN","SEEN",1);
1915 gMC->Gsatt("TICL","SEEN",0);
1916 gMC->Gsatt("TSA9","SEEN",0);
1917 gMC->Gsatt("TS10","SEEN",0);
1918 gMC->Gsatt("TS11","SEEN",0);
1919 gMC->Gsatt("TS12","SEEN",0);
1920 gMC->Gsatt("TICR","SEEN",0);
1921 gMC->Gsatt("TS13","SEEN",0);
1922 gMC->Gsatt("TS14","SEEN",0);
1923 gMC->Gsatt("TS15","SEEN",0);
1924 gMC->Gsatt("TS16","SEEN",0);
1925 gMC->Gsatt("TIFC","SEEN",1);
1926 gMC->Gsatt("TIFC","COLO",4);
1927 gMC->Gsatt("TS17","SEEN",0);
1928 gMC->Gsatt("TS18","SEEN",0);
1929 gMC->Gsatt("TS19","SEEN",0);
1930 gMC->Gsatt("TS20","SEEN",0);
1931 gMC->Gsatt("TS21","SEEN",0);
1932 gMC->Gsatt("TS22","SEEN",0);
1933 gMC->Gsatt("TS23","SEEN",0);
1934 gMC->Gsatt("TS24","SEEN",0);
1935 gMC->Gsatt("TDGN","SEEN",0);
1936 gMC->Gsatt("TIRC","SEEN",0);
1937 gMC->Gsatt("TIC1","SEEN",1);
1938 gMC->Gsatt("TIPP","SEEN",0);
1939 gMC->Gsatt("TIC3","SEEN",0);
1940 gMC->Gsatt("TRCE","SEEN",0);
1941 gMC->Gsatt("TPSC","SEEN",0);
1942 gMC->Gsatt("TPCC","SEEN",0);
1943 gMC->Gsatt("TORC","SEEN",0);
1944 gMC->Gsatt("TOPP","SEEN",0);
1945 gMC->Gsatt("TOC3","SEEN",0);
1946 gMC->Gsatt("TOC1","SEEN",1);
1947 gMC->Gsatt("TSSW","SEEN",1);
1948 gMC->Gsatt("TSWC","SEEN",1);
1949 gMC->Gsatt("TSCE","SEEN",1);
1950 gMC->Gsatt("TSSW","COLO",3);
1951 gMC->Gsatt("TSWC","COLO",3);
1952 gMC->Gsatt("TSCE","COLO",6);
1953 gMC->Gsatt("TWES","SEEN",0);
1954 gMC->Gsatt("TSWB","SEEN",0);
1955 gMC->Gsatt("TPEL","SEEN",0);
1956 gMC->Gsatt("TPMW","SEEN",1);
1957 gMC->Gsatt("TPEW","SEEN",1);
1958 gMC->Gsatt("TESR","SEEN",1);
1959 gMC->Gsatt("TPMW","COLO",12);
1960 gMC->Gsatt("TPEW","COLO",12);
1961 gMC->Gsatt("TWES","COLO",5);
1962 gMC->Gsatt("TIC1","COLO",5);
1963 gMC->Gsatt("TOC1","COLO",5);
1964 gMC->Gsatt("TESB","SEEN",0);
1965 gMC->Gsatt("TPLS","SEEN",0);
1966 gMC->Gsatt("TPUS","SEEN",0);
1967 gMC->Gsatt("TPSS","SEEN",0);
1968 gMC->Gsatt("THVM","SEEN",1);
1969 gMC->Gsatt("THVM","COLO",11);
1970 gMC->Gsatt("TPSR","SEEN",0);
1971 gMC->Gsatt("THVL","SEEN",0);
1972 gMC->Gsatt("THVC","SEEN",0);
1973 gMC->Gsatt("THVE","SEEN",0);
1974 gMC->Gsatt("THVR","SEEN",0);
1975
fe4da5cc 1976 //
cfce8870 1977 gMC->Gdopt("hide", "on");
1978 gMC->Gdopt("shad", "on");
1979 gMC->Gsatt("*", "fill", 7);
1980 gMC->SetClipBox(".");
37831078 1981 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1982 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1983 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1984 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1985 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
cfce8870 1986 gMC->DefaultRange();
1987 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1988 gMC->Gdhead(1111, "Time Projection Chamber");
1989 gMC->Gdman(18, 4, "MAN");
1990 gMC->Gdopt("hide","off");
fe4da5cc 1991}
1992
1993//_____________________________________________________________________________
1994void AliTPCv2::CreateMaterials()
1995{
1996 //
1997 // Define materials for version 2 of the Time Projection Chamber
1998 //
37831078 1999
fe4da5cc 2000 AliTPC::CreateMaterials();
2001}
2002
2003//_____________________________________________________________________________
2004void AliTPCv2::Init()
2005{
2006 //
2007 // Initialises version 2 of the TPC after that it has been built
2008 //
37831078 2009
2010 Int_t *idtmed = fIdtmed->GetArray();
2011
fe4da5cc 2012 AliTPC::Init();
37831078 2013 fIdSens=gMC->VolId("TPSS"); // sensitive strips (not always used)
2014 fIdLSec=gMC->VolId("TPLS"); // lower sector
2015 fIdUSec=gMC->VolId("TPUS"); // upper sector
fe4da5cc 2016
cfce8870 2017 gMC->SetMaxNStep(30000); // max. number of steps increased
fe4da5cc 2018
37831078 2019 gMC->Gstpar(idtmed[2],"LOSS",5); // specific energy loss
fe4da5cc 2020
2021 printf("*** TPC version 2 initialized ***\n");
cfce8870 2022 printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
fe4da5cc 2023
2024 //
2025
2026}
2027
2028//_____________________________________________________________________________
2029void AliTPCv2::StepManager()
2030{
2031 //
2032 // Called for every step in the Time Projection Chamber
2033 //
2034
2035 //
2036 // parameters used for the energy loss calculations
2037 //
73042f01 2038 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
2039 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
2040 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
fe4da5cc 2041
2042
73042f01 2043 const Float_t kbig = 1.e10;
fe4da5cc 2044
2045 Int_t id,copy;
2046 Float_t hits[4];
2047 Int_t vol[2];
2048 TClonesArray &lhits = *fHits;
37831078 2049 TLorentzVector p;
fe4da5cc 2050
37831078 2051 vol[1]=0; // preset row number to 0
fe4da5cc 2052
2053 //
2054
73042f01 2055 gMC->SetMaxStep(kbig);
fe4da5cc 2056
0a6d8768 2057 if(!gMC->IsTrackAlive()) return; // particle has disappeared
fe4da5cc 2058
cfce8870 2059 Float_t charge = gMC->TrackCharge();
fe4da5cc 2060
2061 if(TMath::Abs(charge)<=0.) return; // take only charged particles
2062
37831078 2063 // check the sensitive volume
2064
2065 id = gMC->CurrentVolID(copy); // current volume Id
2066
2067 if(id == fIdLSec){
2068 vol[0] = copy-1; // lower sector number
2069 }
2070 else if(id == fIdUSec){
2071 vol[0] = copy+fTPCParam->GetNInnerSector()-1; // upper sector number
2072 }
2073 else if(id == fIdSens && gMC->IsTrackEntering()){
2074
2075 // track is entering the sensitive strip
2076
2077 vol[1]= copy-1; // row number (absolute)
2078
2079 // sector type
2080
2081 id = gMC->CurrentVolOffID(1,copy);
2082
2083 if(id == fIdLSec){
2084
2085 // lower sector
2086
2087 vol[0] = copy-1; // sector number
2088
fe4da5cc 2089 }
37831078 2090 else {
2091
2092 // upper sector
2093
2094 vol[0] = copy-1+fTPCParam->GetNInnerSector(); // sector number
2095 vol[1] -= fTPCParam->GetNRowLow(); // row number
2096
2097 }
2098
2099 if(vol[1] == 0){
2100
2101 // because Jouri wants to have this
2102
2103 gMC->TrackMomentum(p);
2104 hits[0]=p[0];
2105 hits[1]=p[1];
2106 hits[2]=p[2];
fe4da5cc 2107 hits[3]=0.; // this hit has no energy loss
2108 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
37831078 2109
930ee558 2110 }
37831078 2111
930ee558 2112 gMC->TrackPosition(p);
2113 hits[0]=p[0];
2114 hits[1]=p[1];
2115 hits[2]=p[2];
2116 hits[3]=0.; // this hit has no energy loss
2117 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2118
2119
37831078 2120 }
fe4da5cc 2121 else return;
37831078 2122
2123 //-----------------------------------------------------------------
fe4da5cc 2124 // charged particle is in the sensitive volume
37831078 2125 //-----------------------------------------------------------------
fe4da5cc 2126
cfce8870 2127 if(gMC->TrackStep() > 0) {
fe4da5cc 2128
73042f01 2129 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
fe4da5cc 2130 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
2131
37831078 2132 gMC->TrackPosition(p);
2133 hits[0]=p[0];
2134 hits[1]=p[1];
2135 hits[2]=p[2];
fe4da5cc 2136 hits[3]=(Float_t)nel;
2137
2138 // Add this hit
2139
2140 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2141
2142 }
2143
2144 // Stemax calculation for the next step
2145
2146 Float_t pp;
0a6d8768 2147 TLorentzVector mom;
2148 gMC->TrackMomentum(mom);
2149 Float_t ptot=mom.Rho();
73042f01 2150 Float_t betaGamma = ptot/gMC->TrackMass();
fe4da5cc 2151
69e40cce 2152 Int_t pid=gMC->TrackPid();
cc80f89e 2153 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
fe4da5cc 2154 {
73042f01 2155 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
fe4da5cc 2156 }
2157 else
2158 {
73042f01 2159 pp=kprim*BetheBloch(betaGamma);
fe4da5cc 2160 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
2161 }
2162
2163 Float_t random[1];
cfce8870 2164 gMC->Rndm(random,1); // good, old GRNDM from Geant3
fe4da5cc 2165
2166 Double_t rnd = (Double_t)random[0];
2167
cfce8870 2168 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
fe4da5cc 2169
2170}
2171
2172//_____________________________________________________________________________
2173Float_t AliTPCv2::BetheBloch(Float_t bg)
2174{
2175 //
2176 // Bethe-Bloch energy loss formula
2177 //
73042f01 2178 const Double_t kp1=0.76176e-1;
2179 const Double_t kp2=10.632;
2180 const Double_t kp3=0.13279e-4;
2181 const Double_t kp4=1.8631;
2182 const Double_t kp5=1.9479;
fe4da5cc 2183
2184 Double_t dbg = (Double_t) bg;
2185
2186 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
2187
73042f01 2188 Double_t aa = TMath::Power(beta,kp4);
2189 Double_t bb = TMath::Power(1./dbg,kp5);
fe4da5cc 2190
73042f01 2191 bb=TMath::Log(kp3+bb);
fe4da5cc 2192
73042f01 2193 return ((Float_t)((kp2-aa-bb)*kp1/aa));
fe4da5cc 2194}
73042f01 2195
2196