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