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