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