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