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