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