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