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