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