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