Fix long line
[u/mrichter/AliRoot.git] / TPC / AliTPCv1.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$
73042f01 18Revision 1.17.2.4 2000/06/26 07:39:42 kowal2
19Changes to obey the coding rules
20
21Revision 1.17.2.3 2000/06/25 08:38:41 kowal2
22Splitted from AliTPCtracking
23
24Revision 1.17.2.2 2000/06/16 12:58:13 kowal2
25Changed parameter settings
26
27Revision 1.17.2.1 2000/06/09 07:15:07 kowal2
28
29Defaults loaded automatically (hard-wired)
30Optional parameters can be set via macro called in the constructor
31
32Revision 1.17 2000/05/15 10:00:30 kowal2
33Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
34
e94dd9ca 35Revision 1.16 2000/04/17 09:37:33 kowal2
36removed obsolete AliTPCDigitsDisplay.C
37
cc80f89e 38Revision 1.15.8.2 2000/04/10 08:29:48 kowal2
39
40Different pad geometry for different sectors
41Updated readouch chambers geometry
42
43Revision 1.15.8.1 2000/04/10 07:56:53 kowal2
44Not used anymore - removed
45
46Revision 1.15 1999/11/04 17:28:07 fca
47Correct barrel part of HV Degrader
48
a5371c42 49Revision 1.14 1999/10/08 06:27:23 fca
50Corrected bug in the HV degrader geometry, thanks to G.Tabary
51
d183a600 52Revision 1.13 1999/10/04 13:39:54 fca
53Correct array index problem
54
cdde5b1e 55Revision 1.12 1999/09/29 09:24:34 fca
56Introduction of the Copyright and cvs Log
57
4c039060 58*/
59
73042f01 60//
fe4da5cc 61///////////////////////////////////////////////////////////////////////////////
62// //
63// Time Projection Chamber version 1 -- detailed TPC and fast simulation //
64// //
65//Begin_Html
66/*
1439f98e 67<img src="picts/AliTPCv1Class.gif">
fe4da5cc 68*/
69//End_Html
70// //
71// //
72///////////////////////////////////////////////////////////////////////////////
73
74#include <TMath.h>
75#include <TGeometry.h>
76#include <TNode.h>
77#include <TBRIK.h>
78#include <TTUBE.h>
79#include "AliTPCv1.h"
80#include "AliRun.h"
81#include <iostream.h>
82#include <fstream.h>
83
84#include "AliMC.h"
85#include "AliConst.h"
86
8c555625 87#include "AliTPCParam.h"
73042f01 88#include "AliTPCParamSR.h"
cc80f89e 89#include "AliTPCDigitsArray.h"
73042f01 90#include <TInterpreter.h>
8c555625 91
fe4da5cc 92ClassImp(AliTPCv1)
93
94//_____________________________________________________________________________
95AliTPCv1::AliTPCv1(const char *name, const char *title)
96 :AliTPC(name, title) {
97 //
98 // Standard constructor for Time Projection Chamber
99 //
100 fIdSens1=fIdSens2=0;
73042f01 101
102 SetGasMixt(2,20,10,-1,0.9,0.1,0.);
103
104 if (fTPCParam)
105 fTPCParam->Write(fTPCParam->GetTitle());
fe4da5cc 106}
107
108//_____________________________________________________________________________
109void AliTPCv1::CreateGeometry()
110{
111 //
112 // Creates geometry for Time Projection Chamber version 1
113 // Detailed geometry -- Fast simulation
114 // Origin M.Kowalski
115 //
116 //Begin_Html
117 /*
1439f98e 118 <img src="picts/AliTPCv1.gif">
fe4da5cc 119 */
120 //End_Html
121 //Begin_Html
122 /*
1439f98e 123 <img src="picts/AliTPCv1Tree.gif">
fe4da5cc 124 */
125 //End_Html
126
8c555625 127
1283eee5 128 Int_t *idtmed = fIdtmed->GetArray();
8c555625 129
1283eee5 130 Float_t dm[21];
62a73ee5 131 Int_t idrotm[120];
1283eee5 132
133 Int_t nRotMat = 0;
134
135
fe4da5cc 136 // ----------------------------------------------------
1283eee5 137 // FIELD CAGE WITH ENDCAPS - G10
fe4da5cc 138 // THIS IS ALSO A TPC MOTHER VOLUME
139 // ----------------------------------------------------
1283eee5 140
fe4da5cc 141 dm[0] = 76.;
142 dm[1] = 278.;
143 dm[2] = 275.;
1283eee5 144
145 gMC->Gsvolu("TPC ", "TUBE", idtmed[8], dm, 3);
146
147 //-----------------------------------------------------
148 // Endcap cover c-fibre 0.86% X0
149 //-----------------------------------------------------
150
151 dm[0] = 78.;
152 dm[1] = 258.;
153 dm[2] = 0.95;
154
155 gMC->Gsvolu("TPEC","TUBE",idtmed[10],dm,3);
156
157 //-----------------------------------------------------
158 // Drift gas , leave 2 cm at the outer radius
159 // and inner raddius
160 //-----------------------------------------------------
161
162 dm[0] = 78.;
163 dm[1] = 258.;
fe4da5cc 164 dm[2] = 250.;
fe4da5cc 165
1283eee5 166 gMC->Gsvolu("TGAS", "TUBE", idtmed[3], dm, 3);
167
168
169 //------------------------------------------------------
170 // membrane holder - carbon fiber
171 //------------------------------------------------------
172
173
174 gMC->Gsvolu("TPMH","TUBE",idtmed[6],dm,0);
175
176 dm[0] = 252.;
177 dm[1] = 258.;
178 dm[2] = 0.2;
179
180 gMC->Gsposp("TPMH",1,"TGAS",0.,0.,0.,0,"ONLY",dm,3);
181
182 dm[0] = 78.;
cdde5b1e 183 dm[1] = 82.;
1283eee5 184 dm[2] = 0.1;
185
186 gMC->Gsposp("TPMH",2,"TGAS",0.,0.,0.,0,"ONLY",dm,3);
187
188 //----------------------------------------------------------
189 // HV membrane - 25 microns of mylar
190 //----------------------------------------------------------
191
192 dm[0] = 82.;
193 dm[1] = 252.;
194 dm[2] = 0.00125;
195
196 gMC->Gsvolu("TPHV","TUBE",idtmed[5],dm,3);
197
198 gMC->Gspos("TPHV",1,"TGAS",0.,0.,0.,0,"ONLY");
199
200 gMC->Gspos("TGAS",1,"TPC ",0.,0.,0.,0,"ONLY");
201
202 //----------------------------------------------------------
203 // "side" gas volume, the same as the drift gas
204 // the readout chambers are placed there.
205 //----------------------------------------------------------
206
207 dm[0] = 78.;
208 dm[1] = 258.;
209 dm[2] = 0.5*(275. - 250.);
210
211 gMC->Gsvolu("TPSG", "TUBE", idtmed[2], dm, 3);
212
73042f01 213 Float_t zSide = dm[2]; // 1/2 of the side gas thickness
1283eee5 214
215 //-----------------------------------------------------------
216 // Readout chambers , 25% of X0, I use Al as the material
217 //-----------------------------------------------------------
218
73042f01 219 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
220 Float_t outerOpenAngle = fTPCParam->GetOuterAngle();
1283eee5 221
73042f01 222 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
223 Float_t outerAngleShift = fTPCParam->GetOuterAngleShift();
1283eee5 224
225
226 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
227 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
228
229
73042f01 230 Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow();
231 Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp();
1283eee5 232
73042f01 233 Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow();
234 Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp();
1283eee5 235
73042f01 236 Float_t secThick = 2.225; // Al
1283eee5 237
1283eee5 238 // S (Inner) sectors
239
73042f01 240 Float_t lowEdge = fTPCParam->GetInnerFrameSpace();
cc80f89e 241
73042f01 242 dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge;
243 dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-lowEdge;
244 dm[2] = 0.5*secThick;
245 dm[3] = 0.5*(inSecUpEdge-inSecLowEdge);
1283eee5 246
73042f01 247 Float_t xCenterS = inSecLowEdge+dm[3];
1283eee5 248
249 gMC->Gsvolu("TRCS", "TRD1", idtmed[0], dm, 4);
250
251 // L (Outer) sectors
252
73042f01 253 Float_t upEdge = fTPCParam->GetOuterFrameSpace();
cc80f89e 254
73042f01 255 dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge;
256 dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-upEdge;
257 dm[2] = 0.5*secThick;
258 dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge);
1283eee5 259
73042f01 260 Float_t xCenterL = ouSecLowEdge+dm[3];
1283eee5 261
262 gMC->Gsvolu("TRCL", "TRD1", idtmed[0], dm, 4);
263
73042f01 264 Float_t z1 = -zSide + secThick*0.5;
1283eee5 265
266 //------------------------------------------------------------------
267 // S sectors - "gas sectors" (TRD1)
268 //------------------------------------------------------------------
269
73042f01 270 dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
271 dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1283eee5 272 dm[2] = 0.5*(250. - 0.001);
73042f01 273 dm[3] = 0.5*(inSecUpEdge-inSecLowEdge);
1283eee5 274
275 gMC->Gsvolu("TSGA", "TRD1", idtmed[3], dm, 4); // nonsensitive
276
277 //------------------------------------------------------------------
278 // sensitive strips - "pad rows"
279 //------------------------------------------------------------------
280
281 Int_t ns;
282 Float_t r1,r2,zz;
283
73042f01 284 Float_t stripThick = 0.01; // 100 microns
cc80f89e 285 Float_t dead;
1283eee5 286
287 gMC->Gsvolu("TSST", "TRD1", idtmed[4], dm, 0);
288
289 dm[2] = 0.5*(250. - 0.002);
73042f01 290 dm[3] = 0.5 * stripThick;
1283eee5 291
8c555625 292
1283eee5 293 // S-sector
8c555625 294
cc80f89e 295 dead = fTPCParam->GetInnerWireMount();
296
1283eee5 297 for (ns = 0; ns < fTPCParam->GetNRowLow(); ns++) {
298
299 r1 = fTPCParam->GetPadRowRadiiLow(ns);
73042f01 300 r2 = r1 + stripThick;
301 dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - dead;
302 dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - dead;
1283eee5 303
73042f01 304 zz = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge);
1283eee5 305 zz += r1;
306 zz += dm[3];
307
308 gMC->Gsposp("TSST", ns+1, "TSGA", 0., 0., zz, 0, "ONLY", dm, 4);
309
8c555625 310
fe4da5cc 311 }
8c555625 312
1283eee5 313 //-----------------------------------------------------------------
314 // L sectors - "gas sectors" (PGON to avoid overlaps)
315 //-----------------------------------------------------------------
316
73042f01 317 dm[0] = 360.*kDegrad - 0.5*outerOpenAngle;
1283eee5 318 dm[0] *= kRaddeg;
319 dm[0] = (Float_t)TMath::Nint(dm[0]);
320
73042f01 321 dm[1] = outerOpenAngle*kRaddeg;
1283eee5 322 dm[1] = (Float_t)TMath::Nint(dm[1]);
323
324 dm[2] = 1.;
325 dm[3] = 4.;
326
327 dm[4] = 0.002;
73042f01 328 dm[5] = ouSecLowEdge;
329 dm[6] = 252.*TMath::Cos(0.5*outerOpenAngle)-0.002;
1283eee5 330
331 dm[7] = dm[4]+0.2;
332 dm[8] = dm[5];
333 dm[9] = dm[6];
334
335 dm[10] = dm[7];
73042f01 336 dm[11] = ouSecLowEdge;
337 dm[12] = ouSecUpEdge;
1283eee5 338
339 dm[13] = 250.;
340 dm[14] = dm[11];
341 dm[15] = dm[12];
342
343 gMC->Gsvolu("TLGA","PGON",idtmed[3],dm,16);
344
345 //------------------------------------------------------------------
346 // sensitive strips - "pad rows"
347 //------------------------------------------------------------------
348
349 Float_t rmax = dm[6];
350
351 // L-sectors
352
353 gMC->Gsvolu("TLST", "PGON", idtmed[4], dm, 0);
354
73042f01 355 dm[0] = 360.*kDegrad - 0.5*outerOpenAngle;
1283eee5 356 dm[0] *= kRaddeg;
357 dm[0] = (Float_t)TMath::Nint(dm[0]);
358
73042f01 359 dm[1] = outerOpenAngle*kRaddeg;
1283eee5 360 dm[1] = (Float_t)TMath::Nint(dm[1]);
361
362 dm[2] = 1.;
363 dm[3] = 2.;
364
365 dm[7] = 250.;
366
cc80f89e 367 dead = fTPCParam->GetOuterWireMount();
368
73042f01 369 Float_t xx = dead/TMath::Tan(0.5*outerOpenAngle);
1283eee5 370
371 for(ns=0;ns<fTPCParam->GetNRowUp();ns++){
372
373 r1 = fTPCParam->GetPadRowRadiiUp(ns)-xx;
73042f01 374 r2 = r1 + stripThick;
8c555625 375
1283eee5 376 dm[5] = r1;
377 dm[6] = r2;
378
379 dm[8] = r1;
380 dm[9] = r2;
381
382 if(r2+xx < rmax){
383 dm[4] = 0.002;
384 }
385 else{
386 dm[4] = 0.202;
387 }
388
389 gMC->Gsposp("TLST",ns+1,"TLGA",xx,0.,0.,0,"ONLY",dm,10);
8c555625 390
fe4da5cc 391 }
fe4da5cc 392
1283eee5 393 //------------------------------------------------------------------
394 // Positioning of the S-sector readout chambers
395 //------------------------------------------------------------------
396
397 Float_t zs = 0.5*(250.+0.002);
398
399 Float_t theta1,theta2,theta3;
400 Float_t phi1,phi2,phi3;
401 Float_t alpha;
402 Float_t x,y;
403
404 for(ns=0;ns<nInnerSector;ns++){
405
73042f01 406 phi1 = ns * innerOpenAngle + 270.*kDegrad + innerAngleShift;
1283eee5 407 phi1 *= kRaddeg; // in degrees
408
409 phi1 = (Float_t)TMath::Nint(phi1);
410
411 if (phi1 > 360.) phi1 -= 360.;
62a73ee5 412
1283eee5 413
fe4da5cc 414 theta1 = 90.;
415 phi2 = 90.;
416 theta2 = 180.;
73042f01 417 phi3 = ns * innerOpenAngle + innerAngleShift;
1283eee5 418 phi3 *= kRaddeg; // in degrees
419
420 phi3 = (Float_t)TMath::Nint(phi3);
421
422 if(phi3 > 360.) phi3 -= 360.;
423
fe4da5cc 424 theta3 = 90.;
1283eee5 425
426 alpha = phi3*kDegrad;
427
428 x = xCenterS * TMath::Cos(alpha);
429 y = xCenterS * TMath::Sin(alpha);
430
431 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
432
433 gMC->Gspos("TRCS", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY");
434
435 gMC->Gspos("TSGA",ns+1,"TGAS",x,y,zs,idrotm[nRotMat], "ONLY");
436 gMC->Gspos("TSGA",ns+1+nInnerSector,"TGAS",x,y,-zs,idrotm[nRotMat], "ONLY");
437
438 nRotMat++;
439
440 }
fe4da5cc 441
1283eee5 442 //-------------------------------------------------------------------
443 // Positioning of the L-sectors readout chambers
444 //-------------------------------------------------------------------
fe4da5cc 445
1283eee5 446 for(ns=0;ns<nOuterSector;ns++){
73042f01 447 phi1 = ns * outerOpenAngle + 270.*kDegrad + outerAngleShift;
1283eee5 448 phi1 *= kRaddeg; // in degrees
fe4da5cc 449
1283eee5 450 phi1 = (Float_t)TMath::Nint(phi1);
fe4da5cc 451
1283eee5 452
453 if (phi1 > 360.) phi1 -= 360.;
454
fe4da5cc 455 theta1 = 90.;
456 phi2 = 90.;
457 theta2 = 180.;
73042f01 458 phi3 = ns * outerOpenAngle+outerAngleShift;
1283eee5 459 phi3 *= kRaddeg; // in degrees
460
461 phi3 = (Float_t)TMath::Nint(phi3);
462
463
464 if(phi3 > 360.) phi3 -= 360.;
465
fe4da5cc 466 theta3 = 90.;
1283eee5 467
468 alpha = phi3*kDegrad;
469
470 x = xCenterL * TMath::Cos(alpha);
471 y = xCenterL * TMath::Sin(alpha);
472
473 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
474
475
476 gMC->Gspos("TRCL", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY");
477
478 nRotMat++;
479
fe4da5cc 480 }
fe4da5cc 481
1283eee5 482 //-------------------------------------------------------------------
483 // Positioning of the L-sectors (gas sectors)
484 //-------------------------------------------------------------------
485
486 for(ns=0;ns<nOuterSector;ns++){
487
73042f01 488 phi1 = ns*outerOpenAngle + outerAngleShift;
1283eee5 489 phi1 *= kRaddeg;
490
491 phi1 = (Float_t)TMath::Nint(phi1);
492 if(phi1>360.) phi1 -= 360.;
493
494 theta1 = 90.;
495
496 phi2 = 90. + phi1;
497 if(phi2>360.) phi2 -= 360.;
498
499 theta2 = 90.;
500
501 phi3 = 0.;
502 theta3 = 0.;
503
504 alpha = phi1*kDegrad;
505
506
507 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
508
509
510 gMC->Gspos("TLGA",ns+1,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
511
512 nRotMat++;
513
514 // reflection !!
515
516 phi3 = 0.;
517 theta3 = 180.;
518
519 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
520
521 gMC->Gspos("TLGA",ns+1+nOuterSector,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
522
523 nRotMat++;
524 }
fe4da5cc 525
73042f01 526 Float_t z0 = zSide - 0.95;
1283eee5 527
528 gMC->Gspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY");
529
fe4da5cc 530 // ==========================================================
531 // wheels
532 // ==========================================================
1283eee5 533
534 //
535 // auxilary structures
536 //
537
538
539 gMC->Gsvolu("TPWI","TUBE",idtmed[24],dm,0); // "air"
540
fe4da5cc 541 // ----------------------------------------------------------
542 // Large wheel -> positioned in the TPC
543 // ----------------------------------------------------------
1283eee5 544
545
546 z0 = 263.5; // TPC length - 1/2 spoke wheel width
547
548 dm[0] = 258.;
fe4da5cc 549 dm[1] = 278.;
550 dm[2] = 11.5;
fe4da5cc 551
1283eee5 552 gMC->Gsvolu("TPWL", "TUBE", idtmed[0], dm, 3);
553
554 dm[0] = dm[0]+2.;
555 dm[1] = 278.;
556 dm[2] = dm[2]-2.;
557
558 gMC->Gsposp("TPWI",1,"TPWL",0.,0.,0.,0,"ONLY",dm,3);
559
560 gMC->Gspos("TPWL", 1, "TPC ", 0, 0, z0, 0, "ONLY");
561 gMC->Gspos("TPWL", 2, "TPC ", 0, 0, -z0, 0, "ONLY");
562
563 //
564 // Outer vessel + CO2 HV degrader
565 //
566
567 dm[0] = 260.;
568 dm[1] = 278.;
569 dm[2] = 252.;
570
571 gMC->Gsvolu("TPCO","TUBE",idtmed[12],dm,3);
572
573 dm[0] = 275.;
fe4da5cc 574 dm[1] = 278.;
fe4da5cc 575
1283eee5 576 gMC->Gsvolu("TPOV","TUBE",idtmed[10],dm,3);
577
578 gMC->Gspos("TPOV",1,"TPCO",0.,0.,0.,0,"ONLY");
579
580
e94dd9ca 581
1283eee5 582
583 gMC->Gspos("TPCO",1,"TPC ",0.,0.,0.,0,"ONLY");
584
585
586 //----------------------------------------------------------
587 // Small wheel -> positioned in "side gas
588 //----------------------------------------------------------
589
590 dm[0] = 78.;
fe4da5cc 591 dm[1] = 82.;
592 dm[2] = 11.5;
1283eee5 593
594 gMC->Gsvolu("TPWS", "TUBE", idtmed[0], dm, 3);
595
596 dm[0] = 78.;
597 dm[1] = dm[1]-2;
598 dm[2] = dm[2]-2.;
599
600 gMC->Gsvolu("TPW1", "TUBE", idtmed[2], dm, 3);
fe4da5cc 601
1283eee5 602 gMC->Gspos("TPW1", 1, "TPWS", 0., 0., 0., 0, "ONLY");
603
604 z0 = 1.; // spoke wheel is shifted w.r.t. center of the "side gas"
605
606 gMC->Gspos("TPWS", 1, "TPSG", 0, 0, z0, 0, "ONLY");
607
608
609 // to avoid overlaps
610
611 dm[0] = 76.;
612 dm[1] = 78.;
613 dm[2] = 11.5;
614
615 gMC->Gsvolu("TPS1","TUBE",idtmed[0],dm,3);
616
fe4da5cc 617 dm[2] = 9.5;
1283eee5 618
619 gMC->Gsvolu("TPS2","TUBE",idtmed[24],dm,3);
620
621 gMC->Gspos("TPS2",1,"TPS1",0.,0.,0.,0,"ONLY");
622
623 z0= 263.5;
fe4da5cc 624
1283eee5 625 gMC->Gspos("TPS1",1,"TPC ",0.,0.,z0,0,"ONLY");
626 gMC->Gspos("TPS1",2,"TPC ",0.,0.,-z0,0,"ONLY");
627
628 // G10 plug
629
630 dm[0] = 76.;
7d7bb9e5 631 dm[1] = 78.;
632 dm[2] = 1.;
1283eee5 633
634 gMC->Gsvolu("TPG2","TUBE",idtmed[8],dm,3);
635
636 z0 = 251.;
637
638 gMC->Gspos("TPG2",1,"TPC ",0.,0.,z0,0,"ONLY");
639 gMC->Gspos("TPG2",2,"TPC ",0.,0.,-z0,0,"ONLY");
640
641
642 //---------------------------------------------------------
643 // central wheel 6 (radial direction) x 4 (along z) cm2
644 //---------------------------------------------------------
645
646 dm[0] = 140.;
647 dm[1] = 146.;
fe4da5cc 648 dm[2] = 2.;
1283eee5 649
650 gMC->Gsvolu("TPWC","TUBE",idtmed[0],dm,3);
651
652 dm[0] = dm[0] + 2.;
653 dm[1] = dm[1] - 2.;
654 dm[2] = dm[2] - 1.;
655
656 gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3);
657
73042f01 658 z0 = zSide - 1.9 - 2.;
1283eee5 659
660 gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY");
661
662 //
663
664 gMC->Gsvolu("TPSE","BOX ",idtmed[24],dm,0); // "empty" part of the spoke
665
666
667 //---------------------------------------------------------
668 // inner spokes (nSectorInner)
669 //---------------------------------------------------------
670
671 dm[0] = 0.5*(139.9-82.1);
fe4da5cc 672 dm[1] = 3.;
673 dm[2] = 2.;
1283eee5 674
675 Float_t x1 = dm[0]+82.;
676
677 gMC->Gsvolu("TPSI","BOX",idtmed[0],dm,3);
678
679 dm[1] = dm[1]-1.;
680 dm[2] = dm[2]-1.;
681
682 gMC->Gsposp("TPSE",1,"TPSI",0.,0.,0.,0,"ONLY",dm,3);
683
684 for(ns=0;ns<nInnerSector;ns++){
685
73042f01 686 phi1 = 0.5*innerOpenAngle + ns*innerOpenAngle + innerAngleShift;
1283eee5 687 theta1=90.;
688 phi1 *=kRaddeg;
689
690 phi1 = (Float_t)TMath::Nint(phi1);
691 if(phi1>360.) phi1 -= 360.;
692
693 phi2 = phi1+90.;
694 if(phi2>360.) phi2 -= 360.;
695 theta2=90.;
696 phi3=0.;
697 theta3=0.;
698
fe4da5cc 699 alpha = phi1 * kDegrad;
700 x = x1 * TMath::Cos(alpha);
1283eee5 701 y = x1 * TMath::Sin(alpha);
702
703 AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3);
704
705 gMC->Gspos("TPSI",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY");
706
707 nRotMat++;
708
fe4da5cc 709 }
1283eee5 710
711 //-------------------------------------------------------------
712 // outer spokes (nSectorOuter)
713 //-------------------------------------------------------------
714
715 dm[0] = 0.5*(257.9-146.1);
716 dm[1] = 3.;
717 dm[2] = 2.;
718
719 x1 = dm[0] + 146.;
720
721 gMC->Gsvolu("TPSO","BOX ",idtmed[0],dm,3);
722
723 dm[1] = dm[1] - 1.;
724 dm[2] = dm[2] - 1.;
725
726 gMC->Gsposp("TPSE",2,"TPSO",0.,0.,0.,0,"ONLY",dm,3);
727
728 for(ns=0;ns<nOuterSector;ns++){
729
73042f01 730 phi1 = 0.5*outerOpenAngle + ns*outerOpenAngle + outerAngleShift;
1283eee5 731 theta1=90.;
732 phi1 *=kRaddeg;
733
734 phi1 = (Float_t)TMath::Nint(phi1);
735 if(phi1>360.) phi1 -= 360.;
736
737 phi2 = phi1+90.;
738 if(phi2>360.) phi2 -= 360.;
739 theta2=90.;
740 phi3=0.;
741 theta3=0.;
742
fe4da5cc 743 alpha = phi1 * kDegrad;
1283eee5 744 x = x1 * TMath::Cos(alpha);
745 y = x1 * TMath::Sin(alpha);
746
747 AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3);
748
749 gMC->Gspos("TPSO",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY");
750
751 nRotMat++;
752
753 }
fe4da5cc 754
1283eee5 755
fe4da5cc 756
fe4da5cc 757 // --------------------------------------------------------
758 // put the readout chambers into the TPC
759 // --------------------------------------------------------
1283eee5 760
fe4da5cc 761 theta1 = 90.;
762 phi1 = 0.;
763 theta2 = 90.;
764 phi2 = 270.;
765 theta3 = 180.;
766 phi3 = 0.;
767
1283eee5 768 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
fe4da5cc 769
73042f01 770 z0 = zSide + 250.;
fe4da5cc 771
cfce8870 772 gMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY");
1283eee5 773 gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY");
fe4da5cc 774
cfce8870 775 gMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
fe4da5cc 776
1283eee5 777 //----------------------------------------------------
778 // Inner vessel and HV degrader
779 //----------------------------------------------------
fe4da5cc 780
fe4da5cc 781 dm[0] = 0.;
782 dm[1] = 360.;
783 dm[2] = 4.;
784
785 dm[3] = -250.;
1283eee5 786 dm[4] = 74.4;
fe4da5cc 787 dm[5] = 76.;
1283eee5 788
fe4da5cc 789 dm[6] = -64.5;
790 dm[7] = 50.;
791 dm[8] = 76.;
1283eee5 792
d183a600 793 dm[9] = 64.5;
fe4da5cc 794 dm[10] = 50.;
795 dm[11] = 76.;
1283eee5 796
fe4da5cc 797 dm[12] = 250.;
1283eee5 798 dm[13] = 74.4;
fe4da5cc 799 dm[14] = 76.;
1283eee5 800
801 gMC->Gsvolu("TPVD", "PCON", idtmed[12], dm, 15); // CO2
802
803 // cone parts
fe4da5cc 804
805 dm[0] = 0.;
806 dm[1] = 360.;
1283eee5 807 dm[2] = 2.;
808
809 dm[3] = 64.5;
810 dm[4] = 50.;
811 dm[5] = 51.6;
812
813 dm[6] = 250.;
814 dm[7] = 74.4;
815 dm[8] = 76.;
816
817
818 gMC->Gsvolu("TIVC","PCON",idtmed[11],dm,9); // C-fibre
819
820 gMC->Gspos("TIVC",1,"TPVD",0.,0.,0.,0,"ONLY");
821 gMC->Gspos("TIVC",2,"TPVD",0.,0.,0.,idrotm[nRotMat],"ONLY");
822
823 // barrel part
824
825 dm[0] = 50.;
826 dm[1] = 50.5;
a5371c42 827 dm[2] = 64.5;
1283eee5 828
829 gMC->Gsvolu("TIVB","TUBE",idtmed[9],dm,3);
830
831 gMC->Gspos("TIVB",1,"TPVD",0.,0.,0.,0,"ONLY");
832
833 gMC->Gspos("TPVD",1,"ALIC",0.,0.,0.,0,"ONLY");
834
fe4da5cc 835
1283eee5 836
fe4da5cc 837
1283eee5 838
fe4da5cc 839 // ---------------------------------------------------
840 // volumes ordering
841 // ---------------------------------------------------
cfce8870 842 gMC->Gsord("TGAS", 6);
843 gMC->Gsord("TPSG", 6);
844 gMC->Gsord("TSGA", 3);
8022212f 845 gMC->Gsord("TLGA", 4);
1283eee5 846
847} // end of function
848
fe4da5cc 849
850//_____________________________________________________________________________
8c555625 851void AliTPCv1::DrawDetector()
fe4da5cc 852{
853 //
854 // Draw a shaded view of the Time Projection Chamber version 1
855 //
856
fe4da5cc 857 // Set everything unseen
cfce8870 858 gMC->Gsatt("*", "seen", -1);
fe4da5cc 859 //
860 // Set ALIC mother transparent
cfce8870 861 gMC->Gsatt("ALIC","SEEN",0);
fe4da5cc 862 //
863 // Set the volumes visible
cfce8870 864 gMC->Gsatt("TPC","SEEN",0);
865 gMC->Gsatt("TGAS","SEEN",0);
866 gMC->Gsatt("TPSG","SEEN",0);
867 gMC->Gsatt("TPHV","SEEN",1);
1283eee5 868 gMC->Gsatt("TPMH","SEEN",1);
869 gMC->Gsatt("TPEC","SEEN",0);
cfce8870 870 gMC->Gsatt("TRCS","SEEN",1);
871 gMC->Gsatt("TRCL","SEEN",1);
1283eee5 872 gMC->Gsatt("TPWL","SEEN",1);
873 gMC->Gsatt("TPWI","SEEN",1);
874 gMC->Gsatt("TPWS","SEEN",1);
cfce8870 875 gMC->Gsatt("TPW1","SEEN",1);
1283eee5 876 gMC->Gsatt("TPS1","SEEN",1);
877 gMC->Gsatt("TPS2","SEEN",1);
878 gMC->Gsatt("TPG1","SEEN",1);
879 gMC->Gsatt("TPG2","SEEN",1);
880 gMC->Gsatt("TPWC","SEEN",1);
881 gMC->Gsatt("TPSI","SEEN",1);
882 gMC->Gsatt("TPSO","SEEN",1);
883 gMC->Gsatt("TPCO","SEEN",1);
884 gMC->Gsatt("TPOV","SEEN",1);
cfce8870 885 gMC->Gsatt("TPVD","SEEN",1);
cc80f89e 886
cfce8870 887 gMC->Gdopt("hide", "on");
888 gMC->Gdopt("shad", "on");
889 gMC->Gsatt("*", "fill", 7);
890 gMC->SetClipBox(".");
891 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
892 gMC->DefaultRange();
893 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
894 gMC->Gdhead(1111, "Time Projection Chamber");
895 gMC->Gdman(18, 4, "MAN");
896 gMC->Gdopt("hide","off");
fe4da5cc 897}
898
899//_____________________________________________________________________________
900void AliTPCv1::CreateMaterials()
901{
902 //
903 // Define materials for Time Projection Chamber
904 //
905 AliTPC::CreateMaterials();
906}
907
908//_____________________________________________________________________________
909void AliTPCv1::Init()
910{
911 //
912 // Initialises TPC detector after it has been created
913 //
cfce8870 914
1283eee5 915 fIdSens1=gMC->VolId("TLST"); // L-sector
916 fIdSens2=gMC->VolId("TSST"); // S-sector
fe4da5cc 917
918 printf("TPC version 1 initialized\n");
919}
920
921//_____________________________________________________________________________
922void AliTPCv1::StepManager()
923{
924 //
925 // Called at every step in the Time Projection Chamber
926 //
0a6d8768 927 Int_t copy, id, i;
fe4da5cc 928 Float_t hits[4];
929 Int_t vol[2];
0a6d8768 930 TLorentzVector p;
fe4da5cc 931 TClonesArray &lhits = *fHits;
1283eee5 932
fe4da5cc 933 //
1283eee5 934
0a6d8768 935 if(gMC->TrackCharge() && gMC->IsTrackEntering()) {
fe4da5cc 936 //
937 // Only entering charged tracks
1283eee5 938 //
0a6d8768 939 if((id=gMC->CurrentVolID(copy))==fIdSens1) {
1283eee5 940
941 // L
942
943 vol[1]=copy-1; // row
0a6d8768 944 id=gMC->CurrentVolOffID(1,copy);
1283eee5 945 vol[0]=copy+fTPCParam->GetNInnerSector()-1; // sector
cc80f89e 946
947 //I.Belikov's modification
948 if (vol[1]==0) {
949 gMC->TrackMomentum(p);
950 hits[0]=p[0];
951 hits[1]=p[1];
952 hits[2]=p[2];
953 hits[3]=0.; // this hit has no energy loss
954 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
955
956 gMC->TrackPosition(p);
957 hits[0]=p[0];
958 hits[1]=p[1];
959 hits[2]=p[2];
960 hits[3]=0.; // this hit has no energy loss
961 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
962 }
963 //end of I.Belikov's modification
fe4da5cc 964 } else if(id==fIdSens2) {
1283eee5 965
966 // S
967
968 vol[1]=copy-1; // row
969 id=gMC->CurrentVolOffID(1,copy); // sector
970 vol[0]=copy-1;
cc80f89e 971
972 //I.Belikov's modification
973 if (vol[1]==0) {
974 gMC->TrackMomentum(p);
975 hits[0]=p[0];
976 hits[1]=p[1];
977 hits[2]=p[2];
978 hits[3]=0.; // this hit has no energy loss
979 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
980
981 gMC->TrackPosition(p);
982 hits[0]=p[0];
983 hits[1]=p[1];
984 hits[2]=p[2];
985 hits[3]=0.; // this hit has no energy loss
986 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
987 }
988 //end of I.Belikov's modification
989
fe4da5cc 990 } else return;
1283eee5 991
0a6d8768 992 gMC->TrackPosition(p);
993 for(i=0;i<3;++i) hits[i]=p[i];
cc80f89e 994 hits[3]=1; //I'd like to have something positive here (I.Belikov)
fe4da5cc 995 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
996 }
997}
1283eee5 998
999
1000