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