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