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