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