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