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