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