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