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