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