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