1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.21 2000/11/30 11:48:50 kowal2
19 TLorentzVector.h adde to satisfy the latest changes by Federico
21 Revision 1.20 2000/11/14 10:48:57 kowal2
22 Correct material used for TSA4. Thanks to J. Barbosa.
24 Revision 1.19 2000/11/06 17:24:10 kowal2
25 Corrected bug in the outer containment vessel and
26 the outer field cage geometry.
29 Revision 1.18 2000/11/02 16:55:24 kowal2
30 Corrected bug in the inner containment vessel geometry.
33 Revision 1.17 2000/11/02 07:24:11 kowal2
34 Correction in the TPC geometry.
35 Changes due to the new hit structure.
37 Revision 1.16 2000/10/02 21:28:18 fca
38 Removal of useless dependecies via forward declarations
40 Revision 1.15 2000/07/10 20:57:39 hristov
41 Update of TPC code and macros by M.Kowalski
43 Revision 1.14 2000/06/30 12:07:50 kowal2
44 Updated from the TPC-PreRelease branch
46 Revision 1.13.2.4 2000/06/26 07:39:42 kowal2
47 Changes to obey the coding rules
49 Revision 1.13.2.3 2000/06/25 08:38:41 kowal2
50 Splitted from AliTPCtracking
52 Revision 1.13.2.2 2000/06/16 12:58:13 kowal2
53 Changed parameter settings
55 Revision 1.13.2.1 2000/06/09 07:15:07 kowal2
57 Defaults loaded automatically (hard-wired)
58 Optional parameters can be set via macro called in the constructor
60 Revision 1.13 2000/05/15 10:00:30 kowal2
61 Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
63 Revision 1.12 2000/04/17 09:37:33 kowal2
64 removed obsolete AliTPCDigitsDisplay.C
66 Revision 1.11.8.2 2000/04/10 08:36:12 kowal2
68 Updated readout chambers
69 Some modifications to StepManager by M. Kowalski
71 Revision 1.11.8.1 2000/04/10 07:56:53 kowal2
72 Not used anymore - removed
74 Revision 1.11 1999/11/04 17:28:07 fca
75 Correct barrel part of HV Degrader
77 Revision 1.10 1999/10/14 16:52:08 fca
78 Only use PDG codes and not GEANT ones
80 Revision 1.9 1999/10/08 06:27:23 fca
81 Corrected bug in the HV degrader geometry, thanks to G.Tabary
83 Revision 1.8 1999/10/04 13:39:55 fca
84 Correct array index problem
86 Revision 1.7 1999/09/29 09:24:34 fca
87 Introduction of the Copyright and cvs Log
92 ///////////////////////////////////////////////////////////////////////////////
94 // Time Projection Chamber version 3 -- detailed TPC and slow simulation //
98 <img src="picts/AliTPCv3Class.gif">
103 ///////////////////////////////////////////////////////////////////////////////
107 #include "AliTPCv3.h"
110 #include "AliConst.h"
111 #include "AliTPCDigitsArray.h"
112 #include"AliTPCParam.h"
113 #include"AliTPCParamSR.h"
115 #include <TInterpreter.h>
116 #include "TLorentzVector.h"
120 //_____________________________________________________________________________
121 AliTPCv3::AliTPCv3(const char *name, const char *title) :
125 // Standard constructor for Time Projection Chamber version 3
128 SetBufferSize(128000);
131 SetGasMixt(2,20,10,-1,0.9,0.1,0.);
134 fTPCParam->Write(fTPCParam->GetTitle());
137 //_____________________________________________________________________________
138 void AliTPCv3::CreateGeometry()
141 // Creation of the TPC coarse geometry (version 3)
142 // The whole drift volume is sensitive
143 // Origin Marek Kowalski Cracow
147 <img src="picts/AliTPCgif">
152 <img src="picts/AliTPCv3Tree.gif">
157 Int_t *idtmed = fIdtmed->GetArray(); // TPC media
159 Int_t idrotm[120]; // rotation matrices
161 Int_t nRotMat = 0; // actual number of rotation matrices
165 // Mother volume (Air) - all volumes will be positioned in it
245 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,39);
248 //-------------------------------------------------------------------
249 // Tpc Outer INsulator (CO2)
250 //-------------------------------------------------------------------
289 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
291 //---------------------------------------------------------------
292 // shreds (G10) - TPC Rings
293 //---------------------------------------------------------------
295 gMC->Gsvolu("TPCR","TUBE",idtmed[12],dm,0);
301 gMC->Gsposp("TPCR",1,"TOIN",0.,0.,-253.3,0,"ONLY",dm,3); // left bottom
309 gMC->Gsposp("TPCR",2,"TOIN",0.,0.,253.3,0,"ONLY",dm,3); // right
317 gMC->Gsposp("TPCR",3,"TOIN",0.,0.,-250.7,0,"ONLY",dm,3); // left top
319 //----------------------------------------------------------------
320 // Tpc Outer Contaiment Vessel
321 // mother volume - Al, daughters - composite (sandwich)
322 //----------------------------------------------------------------
364 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
368 // Tpc SAndwich 1 - Al
374 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
376 // Tpc SAndwich 2 - Tedlar
381 gMC->Gsvolu("TSA2","TUBE",idtmed[9],dm,3);
383 // Tpc SAndwich 3 - Kevlar
388 gMC->Gsvolu("TSA3","TUBE",idtmed[5],dm,3);
390 // Tpc SAndwich 4 - NOMEX honeycomb
395 gMC->Gsvolu("TSA4","TUBE",idtmed[6],dm,3);
399 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
400 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
401 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
403 gMC->Gspos("TSA1",1,"TOCV",0.,0.,2.6,0,"ONLY");
407 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
409 //-------------------------------------------------------
410 // Tpc Outer Field Cage
411 // mother volume - Al, daughters - composite (sandwich)
412 //-------------------------------------------------------
452 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
456 // Tpc SAndwich 5 - Tedlar
462 gMC->Gsvolu("TSA5","TUBE",idtmed[9],dm,3);
464 // Tpc SAndwich 6 - Kevlar
469 gMC->Gsvolu("TSA6","TUBE",idtmed[5],dm,3);
472 // Tpc SAndwich 7 - NOMEX
477 gMC->Gsvolu("TSA7","TUBE",idtmed[6],dm,3);
481 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
482 gMC->Gspos("TSA6",1,"TSA5",0.,0.,0.,0,"ONLY");
484 gMC->Gspos("TSA5",1,"TOFC",0.,0.,0.,0,"ONLY");
488 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
492 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
494 //--------------------------------------------------------------------
495 // Tpc Inner INsulator (CO2)
496 //--------------------------------------------------------------------
511 Float_t tanL = (66.2-59.0)/(255.6-73.3); // tangent of the left cone part
514 dm[7]= 59.0+ (253.6-73.3)*tanL;
595 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,48);
598 //--------------------------------------------------------------------
599 // Tpc Inner Containment vessel, Left part
600 // mother volume - Al, daughter - composite (sandwich)
601 //--------------------------------------------------------------------
615 Float_t cosL = 1./TMath::Sqrt(1.+tanL*tanL);
616 Float_t sandThick = 2.14; // cone composite thickness
622 dm[7]= 59.0 + (253.6-73.3)*tanL;
629 dm[11]= dm[7]+sandThick/cosL;
634 dm[13]= 59.0+(75.6-73.3)*tanL;
635 dm[14]= dm[13]+sandThick/cosL;
661 gMC->Gsvolu("TICL","PCON",idtmed[4],dm,27);
665 // Tpc SAndwich 9 - Al
674 dm[4]= 59.0+(254.3-73.3)*tanL;
675 dm[5]= dm[4]+sandThick/cosL;
680 dm[7]= 59.0+(78.3-73.3)*tanL;
681 dm[8]= dm[7]+sandThick/cosL;
685 gMC->Gsvolu("TSA9","PCON",idtmed[4],dm,9);
687 // Tpc SAndwich 10 - Tedlar
697 gMC->Gsvolu("TS10","PCON",idtmed[9],dm,9);
699 // Tpc SAndwich 11 - Kevlar
709 gMC->Gsvolu("TS11","PCON",idtmed[5],dm,9);
711 // Tpc SAndwich 12 - NOMEX
721 gMC->Gsvolu("TS12","PCON",idtmed[6],dm,9);
725 gMC->Gspos("TS12",1,"TS11",0.,0.,0.,0,"ONLY");
726 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
727 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
731 gMC->Gspos("TSA9",1,"TICL",0.,0.,0.,0,"ONLY");
733 //--------------------------------------------------------------------
734 // Tpc Inner Containment vessel, Right part
735 // mother volume - Al, daughter - composite (sandwich)
736 //--------------------------------------------------------------------
762 Float_t tanR = (66.0-59.0)/(250.5-73.3); // to avoid accuracy problems
763 Float_t cosR = 1./TMath::Sqrt(1.+tanR*tanR); //as above
768 dm[13]= 59.0+(75.6-73.3)*tanR;
775 dm[17]= dm[16]+sandThick/cosR;
780 dm[19]= 59.0+(248.4-73.3)*tanR;
781 dm[20]= dm[19]+sandThick/cosR;
795 gMC->Gsvolu("TICR","PCON",idtmed[4],dm,27);
801 // Tpc SAndwich 13 - Al
810 dm[4]= 59.0+(78.3-73.3)*tanR;
811 dm[5]= dm[4]+sandThick/cosR;
816 dm[7]= 59.0+(249.1-73.3)*tanR;
817 dm[8]= dm[7]+sandThick/cosR;
821 gMC->Gsvolu("TS13","PCON",idtmed[4],dm,9);
823 // Tpc SAndwich 14 - Tedlar
833 gMC->Gsvolu("TS14","PCON",idtmed[9],dm,9);
835 // Tpc SAndwich 15 - Kevlar
845 gMC->Gsvolu("TS15","PCON",idtmed[5],dm,9);
847 // Tpc SAndwich 16 - NOMEX
857 gMC->Gsvolu("TS16","PCON",idtmed[6],dm,9);
861 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
862 gMC->Gspos("TS15",1,"TS14",0.,0.,0.,0,"ONLY");
863 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
867 gMC->Gspos("TS13",1,"TICR",0.,0.,0.,0,"ONLY");
869 //------------------------------------------------------
870 // Tpc Inner Field Cage
871 // mother volume - Al, daughters - composite (sandwich)
872 //------------------------------------------------------
914 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,21);
918 // Tpc Sandwich 17 - Tedlar
924 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
926 // Tpc Sandwich 18 - Kevlar
931 gMC->Gsvolu("TS18","TUBE",idtmed[5],dm,3);
934 // Tpc Sandwich 19 - NOMEX
939 gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3);
943 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
944 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
948 gMC->Gspos("TS17",1,"TIFC",0.,0.,0.,0,"ONLY");
956 gMC->Gsposp("TPCR",4,"TIIN",0.,0.,-253.3,0,"ONLY",dm,3);
961 gMC->Gsposp("TPCR",5,"TIIN",0.,0.,250.7,0,"ONLY",dm,3);
966 gMC->Gsposp("TPCR",6,"TIIN",0.,0.,253.3,0,"ONLY",dm,3);
970 gMC->Gspos("TICL",1,"TIIN",0.,0.,0.,0,"ONLY");
974 gMC->Gspos("TICR",1,"TIIN",0.,0.,0.,0,"ONLY");
978 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
980 // Tpc Sandwich 21 - Al (central barrel)
986 gMC->Gsvolu("TS21","TUBE",idtmed[4],dm,3);
988 // Tpc Sandwich 22 - Tedlar (central barrel)
993 gMC->Gsvolu("TS22","TUBE",idtmed[9],dm,3);
995 // Tpc Sandwich 23 - Kevlar (central barrel)
1000 gMC->Gsvolu("TS23","TUBE",idtmed[5],dm,3);
1002 // Tpc Sandwich 24 - NOMEX (central barrel)
1007 gMC->Gsvolu("TS24","TUBE",idtmed[6],dm,3);
1011 gMC->Gspos("TS24",1,"TS23",0.,0.,0.,0,"ONLY");
1012 gMC->Gspos("TS23",1,"TS22",0.,0.,0.,0,"ONLY");
1013 gMC->Gspos("TS22",1,"TS21",0.,0.,0.,0,"ONLY");
1015 gMC->Gspos("TS21",1,"TIIN",0.,0.,0.,0,"ONLY");
1017 // put everything into the TPC
1019 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
1022 //---------------------------------------------------------
1023 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
1024 // and its daughters (HV membrane, rods, readout chambers)
1025 //---------------------------------------------------------
1031 gMC->Gsvolu("TDGS","TUBE",idtmed[2],dm,3);
1033 // sector opening angles
1035 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
1037 // sector angle shift
1039 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
1041 // number of sectors
1043 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
1044 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
1046 // All above parameters are identical for inner and outer
1047 // sectors. The distinction is kept for the historical reasons
1048 // and eventually will disappear.
1050 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
1051 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
1054 //-------------------------------------------------------------------------
1055 // Tpc Inner Readout Chambers
1056 //-------------------------------------------------------------------------
1060 dm[2]= 1.6; // thickness
1063 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
1065 // this volume will be positioned in the empty space
1066 // of the end-cap to avoid overlaps
1073 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
1076 //------------------------------------------------
1077 // Tpc Inner readout chamber Pad Plane
1078 //------------------------------------------------
1085 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
1089 dm[0] -= 1.218511934;
1090 dm[1] -= 1.218511934;
1093 gMC->Gsvolu("TIC3","TRD1",idtmed[2],dm,4);
1095 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
1097 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
1100 //----------------------------------------------
1101 // Tpc Readout Chambers Empty spaces - for both
1102 // inner and outer sectors
1103 //----------------------------------------------
1105 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
1107 // Inner sector - 4 spaces
1118 space = rr*tanAlpha-dm[0];
1120 for(Int_t nsLow=0;nsLow<4;nsLow++){
1123 dm[1]= rr*tanAlpha - space;
1127 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1133 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1136 dm[0] = rr*tanAlpha - space;
1142 // dm[1] - this is the dm[1] from the previous TRCE
1146 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.,0.,0,"ONLY",dm,4);
1149 // TPc Space for Connectors
1156 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1164 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1166 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1174 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
1176 // inner part of the inner sector - 2 x 20 holes
1178 astep = 20.00096874/19.;
1180 alpha = 10.00048437-astep;
1192 for(ncon=0;ncon<20;ncon++){
1198 phi3 = (alpha>0) ? 0. : 180.;
1199 theta3 = TMath::Abs(alpha);
1201 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1205 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1206 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1217 // outer part of the inner sector - 2 x 25 holes
1219 astep = 20.00096874/24.;
1220 alpha = 10.00048437-astep;
1228 for(ncon=0;ncon<25;ncon++){
1234 phi3 = (alpha>0) ? 0. : 180.;
1235 theta3 = TMath::Abs(alpha);
1237 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1241 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1242 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1253 //--------------------------------------------------------------------------
1254 // TPC Outer Readout Chambers
1255 // this is NOT a final design
1256 //--------------------------------------------------------------------------
1260 dm[2]= 1.5; //thickness
1263 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1265 //------------------------------------------------
1266 // Tpc Outerr readout chamber Pad Plane
1267 //------------------------------------------------
1271 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1273 dm[0] -= 1.218511934;
1274 dm[1] -= 1.218511934;
1277 gMC->Gsvolu("TOC3","TRD1",idtmed[2],dm,4);
1279 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1281 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1291 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1298 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1306 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1309 //-----------------------------------------------
1310 // Tpc Services Support Wheel
1311 //-----------------------------------------------
1326 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1328 // Tpc Services Wheel Cover
1333 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1335 // Tpc Service wheel Cover Empty space
1342 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1344 // Tpc services Wheel Empty Spaces
1351 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1353 // Tpc Services Wheel Bars
1355 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1365 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1370 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1372 // TPc ELectronics - right now 30% X0 Si
1379 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1380 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1383 //--------------------------------------------------------------------------
1385 //--------------------------------------------------------------------------
1387 // TPc Main Wheel - Al
1393 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1395 // TPc Extra Wheel (to avoid overlapping) - Al
1401 gMC->Gsvolu("TPEW","TUBE",idtmed[4],dm,3);
1403 //--------------------------------------------------------------------------
1404 // Tpc Empty Space for the Readout chambers
1405 //--------------------------------------------------------------------------
1409 Float_t dR = 0.5*(rUp-rLow);
1411 space= 1.4/cosAlpha; // wheel ribs are 2.8 cm wide
1413 dm[0]= rLow*tanAlpha-space;
1414 dm[1]= rUp*tanAlpha-space;
1418 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1423 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1428 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1430 // Tpc Empty Space Bars - Al (daughters of TESR)
1434 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1438 dm[0]= rLow*tanAlpha-space;
1439 dm[1]= 88.7*tanAlpha-space;
1445 gMC->Gsposp("TESB",1,"TESR",0.,2.05,zBar,0,"ONLY",dm,4);
1449 dm[0]= 131.65*tanAlpha-space;
1450 dm[1]= 136.5*tanAlpha-space;
1453 zBar = -dR +131.65+dm[3]-rLow;
1455 gMC->Gsposp("TESB",2,"TESR",0.,2.05,zBar,0,"ONLY",dm,4);
1459 dm[0]= 240.4*tanAlpha-space;
1460 dm[1]= rUp*tanAlpha-space;
1465 gMC->Gsposp("TESB",3,"TESR",0.,2.05,zBar,0,"ONLY",dm,4);
1467 // positioning of the empty spaces into the main wheel
1469 Float_t rCenter,xc,yc;
1470 Float_t rInner,rOuter; // center of the inner and outer chamber
1477 for(Int_t ns=0; ns<nInnerSector;ns++){
1479 phi1 = ns * innerOpenAngle + innerAngleShift;
1480 phi1 *= kRaddeg; // in degrees
1482 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1484 if (phi1 > 360.) phi1 -= 360.;
1489 phi3 = ns * innerOpenAngle + innerAngleShift;
1490 phi3 *= kRaddeg; // in degrees
1492 phi3 = (Float_t)TMath::Nint(phi3);
1494 if(phi3 > 360.) phi3 -= 360.;
1498 // "holes"->End plate
1500 xc = rCenter*TMath::Cos(phi3*kDegrad);
1501 yc = rCenter*TMath::Sin(phi3*kDegrad);
1503 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1505 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1507 // TSCE->TSWC (services wheel volumes)
1509 xc = 166.142*TMath::Cos(phi3*kDegrad);
1510 yc = 166.142*TMath::Sin(phi3*kDegrad);
1512 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1513 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1516 // readout chambers->TDGS (drift gas)
1518 xc = rInner*TMath::Cos(phi3*kDegrad);
1519 yc = rInner*TMath::Sin(phi3*kDegrad);
1521 gMC->Gspos("TIRC",ns+1,"TDGS",xc,yc,252.,idrotm[nRotMat],"ONLY");
1523 xc = rOuter*TMath::Cos(phi3*kDegrad);
1524 yc = rOuter*TMath::Sin(phi3*kDegrad);
1526 gMC->Gspos("TORC",ns+1,"TDGS",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1530 theta2 = 0.; // reflection
1532 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1534 xc = rInner*TMath::Cos(phi3*kDegrad);
1535 yc = rInner*TMath::Sin(phi3*kDegrad);
1537 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGS",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1539 xc = rOuter*TMath::Cos(phi3*kDegrad);
1540 yc = rOuter*TMath::Sin(phi3*kDegrad);
1542 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGS",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1550 // reflection matrix
1559 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1564 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1565 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[nRotMat],"ONLY");
1566 gMC->Gspos("TPEW",1,"TPC ",0.,0.,257.65,0,"ONLY");
1567 gMC->Gspos("TPEW",2,"TPC ",0.,0.,-257.65,0,"ONLY");
1571 //-------------------------------------------------------
1572 // Tpc High Voltage Membrane - NOMEX honeycomb
1573 //-------------------------------------------------------
1592 gMC->Gsvolu("THVM","PGON",idtmed[6],dm,10);
1594 gMC->Gspos("THVM",1,"TDGS",0.,0.,0.,0,"ONLY");
1596 //----------------------------------------------------------
1597 // TPc Support Rods - MAKROLON
1598 //----------------------------------------------------------
1604 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,3);
1606 for(Int_t nrod=1;nrod<18;nrod++){
1607 Float_t angle=innerOpenAngle*(Float_t)nrod;
1609 xc=82.4*TMath::Cos(angle);
1610 yc=82.4*TMath::Sin(angle);
1612 gMC->Gspos("TPSR",nrod,"TDGS",xc,yc,126.95,0,"ONLY");
1613 gMC->Gspos("TPSR",nrod+17,"TDGS",xc,yc,-126.95,0,"ONLY");
1615 xc=254.2*TMath::Cos(angle);
1616 yc=254.2*TMath::Sin(angle);
1618 gMC->Gspos("TPSR",nrod+34,"TDGS",xc,yc,126.95,0,"ONLY");
1619 gMC->Gspos("TPSR",nrod+51,"TDGS",xc,yc,-126.95,0,"ONLY");
1623 //----------------------------------------------------------
1624 // Tpc High Voltage rod - MAKROLON + Copper cable
1625 //----------------------------------------------------------
1627 // rod with cable (Left)
1633 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1641 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1649 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1651 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1652 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1654 // rod without cable
1660 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1664 gMC->Gspos("THVL",1,"TDGS",82.4,0.,-126.95,0,"ONLY");
1665 gMC->Gspos("THVL",2,"TDGS",254.2,0.,-126.95,0,"ONLY");
1667 gMC->Gspos("THVR",1,"TDGS",82.4,0.,126.95,0,"ONLY");
1668 gMC->Gspos("THVR",2,"TDGS",254.2,0.,126.95,0,"ONLY");
1672 gMC->Gspos("TDGS",1,"TPC ",0.,0.,0.,0,"ONLY");
1674 // services wheel cover -> wheel
1677 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1678 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1681 // put the wheel into the TPC
1683 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1684 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1686 gMC->Gsord("TPMW",6);
1687 gMC->Gsord("TSSW",6);
1688 gMC->Gsord("TSWC",6);
1690 // put the TPC into ALIC (main mother volume)
1692 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1695 } // end of function
1697 //_____________________________________________________________________________
1698 void AliTPCv3::DrawDetector()
1701 // Draw a shaded view of the Time Projection Chamber version 1
1705 // Set everything unseen
1706 gMC->Gsatt("*", "seen", -1);
1708 // Set ALIC mother transparent
1709 gMC->Gsatt("ALIC","SEEN",0);
1711 // Set the volumes visible
1714 gMC->Gsatt("TPC ","SEEN",0);
1715 gMC->Gsatt("TOIN","SEEN",1);
1716 gMC->Gsatt("TOIN","COLO",7);
1717 gMC->Gsatt("TPCR","SEEN",0);
1718 gMC->Gsatt("TOCV","SEEN",1);
1719 gMC->Gsatt("TOCV","COLO",4);
1720 gMC->Gsatt("TSA1","SEEN",0);
1721 gMC->Gsatt("TSA2","SEEN",0);
1722 gMC->Gsatt("TSA3","SEEN",0);
1723 gMC->Gsatt("TSA4","SEEN",0);
1724 gMC->Gsatt("TOFC","SEEN",1);
1725 gMC->Gsatt("TOFC","COLO",4);
1726 gMC->Gsatt("TSA5","SEEN",0);
1727 gMC->Gsatt("TSA6","SEEN",0);
1728 gMC->Gsatt("TSA7","SEEN",0);
1729 gMC->Gsatt("TIIN","COLO",7);
1730 gMC->Gsatt("TIIN","SEEN",1);
1731 gMC->Gsatt("TICL","SEEN",0);
1732 gMC->Gsatt("TSA9","SEEN",0);
1733 gMC->Gsatt("TS10","SEEN",0);
1734 gMC->Gsatt("TS11","SEEN",0);
1735 gMC->Gsatt("TS12","SEEN",0);
1736 gMC->Gsatt("TICR","SEEN",0);
1737 gMC->Gsatt("TS13","SEEN",0);
1738 gMC->Gsatt("TS14","SEEN",0);
1739 gMC->Gsatt("TS15","SEEN",0);
1740 gMC->Gsatt("TS16","SEEN",0);
1741 gMC->Gsatt("TIFC","SEEN",1);
1742 gMC->Gsatt("TIFC","COLO",4);
1743 gMC->Gsatt("TS17","SEEN",0);
1744 gMC->Gsatt("TS18","SEEN",0);
1745 gMC->Gsatt("TS19","SEEN",0);
1746 gMC->Gsatt("TS21","SEEN",0);
1747 gMC->Gsatt("TS22","SEEN",0);
1748 gMC->Gsatt("TS23","SEEN",0);
1749 gMC->Gsatt("TS24","SEEN",0);
1750 gMC->Gsatt("TDGS","SEEN",0);
1751 gMC->Gsatt("TIRC","SEEN",0);
1752 gMC->Gsatt("TIC1","SEEN",1);
1753 gMC->Gsatt("TIPP","SEEN",0);
1754 gMC->Gsatt("TIC3","SEEN",0);
1755 gMC->Gsatt("TRCE","SEEN",0);
1756 gMC->Gsatt("TPSC","SEEN",0);
1757 gMC->Gsatt("TPCC","SEEN",0);
1758 gMC->Gsatt("TORC","SEEN",0);
1759 gMC->Gsatt("TOPP","SEEN",0);
1760 gMC->Gsatt("TOC3","SEEN",0);
1761 gMC->Gsatt("TOC1","SEEN",1);
1762 gMC->Gsatt("TSSW","SEEN",1);
1763 gMC->Gsatt("TSWC","SEEN",1);
1764 gMC->Gsatt("TSCE","SEEN",1);
1765 gMC->Gsatt("TSSW","COLO",3);
1766 gMC->Gsatt("TSWC","COLO",3);
1767 gMC->Gsatt("TSCE","COLO",6);
1768 gMC->Gsatt("TWES","SEEN",0);
1769 gMC->Gsatt("TSWB","SEEN",0);
1770 gMC->Gsatt("TPEL","SEEN",0);
1771 gMC->Gsatt("TPMW","SEEN",1);
1772 gMC->Gsatt("TPEW","SEEN",1);
1773 gMC->Gsatt("TESR","SEEN",1);
1774 gMC->Gsatt("TPMW","COLO",12);
1775 gMC->Gsatt("TPEW","COLO",12);
1776 gMC->Gsatt("TWES","COLO",5);
1777 gMC->Gsatt("TIC1","COLO",5);
1778 gMC->Gsatt("TOC1","COLO",5);
1779 gMC->Gsatt("TESB","SEEN",0);
1780 gMC->Gsatt("TPLS","SEEN",0);
1781 gMC->Gsatt("TPUS","SEEN",0);
1782 gMC->Gsatt("TPSS","SEEN",0);
1783 gMC->Gsatt("THVM","SEEN",1);
1784 gMC->Gsatt("THVM","COLO",11);
1785 gMC->Gsatt("TPSR","SEEN",0);
1786 gMC->Gsatt("THVL","SEEN",0);
1787 gMC->Gsatt("THVC","SEEN",0);
1788 gMC->Gsatt("THVE","SEEN",0);
1789 gMC->Gsatt("THVR","SEEN",0);
1792 gMC->Gdopt("hide", "on");
1793 gMC->Gdopt("shad", "on");
1794 gMC->Gsatt("*", "fill", 7);
1795 gMC->SetClipBox(".");
1796 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1797 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1798 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1799 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1800 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1801 gMC->DefaultRange();
1802 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1803 gMC->Gdhead(1111, "Time Projection Chamber");
1804 gMC->Gdman(18, 4, "MAN");
1805 gMC->Gdopt("hide","off");
1808 //_____________________________________________________________________________
1809 void AliTPCv3::CreateMaterials()
1812 // Define materials for version 2 of the Time Projection Chamber
1817 AliTPC::CreateMaterials();
1820 //_____________________________________________________________________________
1821 void AliTPCv3::Init()
1824 // Initialises version 3 of the TPC after that it has been built
1826 Int_t *idtmed = fIdtmed->GetArray();
1830 fIdSens=gMC->VolId("TDGS"); // drift gas as a sensitive volume
1832 gMC->SetMaxNStep(30000); // max. number of steps increased
1834 gMC->Gstpar(idtmed[2],"LOSS",5);
1836 printf("*** TPC version 3 initialized ***\n");
1837 printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
1843 //_____________________________________________________________________________
1844 void AliTPCv3::StepManager()
1847 // Called for every step in the Time Projection Chamber
1851 // parameters used for the energy loss calculations
1853 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1854 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1855 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1858 const Float_t kbig = 1.e10;
1864 TClonesArray &lhits = *fHits;
1871 gMC->SetMaxStep(kbig);
1873 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1875 Float_t charge = gMC->TrackCharge();
1877 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1880 id=gMC->CurrentVolID(copy);
1882 // Check the sensitive volume
1884 if (id != fIdSens) return;
1887 // charged particle is in the sensitive volume
1890 if(gMC->TrackStep() > 0) {
1893 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1894 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1896 gMC->TrackPosition(pos);
1902 // check the selected side of the TPC
1905 if(fSide && fSide*hits[2]<=0.) return;
1907 hits[3]=(Float_t)nel;
1911 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1915 // Stemax calculation for the next step
1919 gMC->TrackMomentum(mom);
1920 Float_t ptot=mom.Rho();
1921 Float_t betaGamma = ptot/gMC->TrackMass();
1923 Int_t pid=gMC->TrackPid();
1924 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1926 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1930 pp=kprim*BetheBloch(betaGamma);
1931 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1935 gMC->Rndm(random,1); // good, old GRNDM from Geant3
1937 Double_t rnd = (Double_t)random[0];
1939 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1943 //_____________________________________________________________________________
1944 Float_t AliTPCv3::BetheBloch(Float_t bg)
1947 // Bethe-Bloch energy loss formula
1949 const Double_t kp1=0.76176e-1;
1950 const Double_t kp2=10.632;
1951 const Double_t kp3=0.13279e-4;
1952 const Double_t kp4=1.8631;
1953 const Double_t kp5=1.9479;
1955 Double_t dbg = (Double_t) bg;
1957 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
1959 Double_t aa = TMath::Power(beta,kp4);
1960 Double_t bb = TMath::Power(1./dbg,kp5);
1962 bb=TMath::Log(kp3+bb);
1964 return ((Float_t)((kp2-aa-bb)*kp1/aa));