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.27 2000/11/02 07:24:11 kowal2
19 Correction in the TPC geometry.
20 Changes due to the new hit structure.
22 Revision 1.26 2000/10/05 16:16:29 kowal2
23 Corrections of the hit recording algorithm.
25 Revision 1.25 2000/10/02 21:28:18 fca
26 Removal of useless dependecies via forward declarations
28 Revision 1.24 2000/08/28 10:02:30 kowal2
29 Corrected bug in the StepManager
31 Revision 1.23 2000/07/10 20:57:39 hristov
32 Update of TPC code and macros by M.Kowalski
34 Revision 1.22 2000/06/30 12:07:50 kowal2
35 Updated from the TPC-PreRelease branch
37 Revision 1.21.2.4 2000/06/26 07:39:42 kowal2
38 Changes to obey the coding rules
40 Revision 1.21.2.3 2000/06/25 08:38:41 kowal2
41 Splitted from AliTPCtracking
43 Revision 1.21.2.2 2000/06/16 12:58:13 kowal2
44 Changed parameter settings
46 Revision 1.21.2.1 2000/06/09 07:15:07 kowal2
48 Defaults loaded automatically (hard-wired)
49 Optional parameters can be set via macro called in the constructor
51 Revision 1.21 2000/05/15 10:00:30 kowal2
52 Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
54 Revision 1.20 2000/04/17 09:37:33 kowal2
55 removed obsolete AliTPCDigitsDisplay.C
57 Revision 1.19.8.2 2000/04/10 08:31:52 kowal2
59 Different geometry for different sectors
60 Updated readout chambers
61 Some modifications to StepManager by J.Belikov
63 Revision 1.19.8.1 2000/04/10 07:56:53 kowal2
64 Not used anymore - removed
66 Revision 1.19 1999/11/04 17:28:07 fca
67 Correct barrel part of HV Degrader
69 Revision 1.18 1999/10/14 16:52:08 fca
70 Only use PDG codes and not GEANT ones
72 Revision 1.17 1999/10/08 06:27:23 fca
73 Corrected bug in the HV degrader geometry, thanks to G.Tabary
75 Revision 1.16 1999/10/04 13:39:54 fca
76 Correct array index problem
78 Revision 1.15 1999/09/29 09:24:34 fca
79 Introduction of the Copyright and cvs Log
84 ///////////////////////////////////////////////////////////////////////////////
86 // Time Projection Chamber version 2 -- detailed TPC and slow simulation //
90 <img src="picts/AliTPCv2Class.gif">
95 ///////////////////////////////////////////////////////////////////////////////
100 #include "AliTPCv2.h"
101 #include "AliTPCDigitsArray.h"
104 #include "AliConst.h"
106 #include "AliTPCParam.h"
107 #include "AliTPCParamSR.h"
108 #include "AliTPCTrackHits.h"
113 //_____________________________________________________________________________
114 AliTPCv2::AliTPCv2(const char *name, const char *title) :
118 // Standard constructor for Time Projection Chamber version 2
124 SetBufferSize(128000);
126 SetGasMixt(2,20,10,-1,0.9,0.1,0.); // Ne-CO2 90-10
132 SetSecLows(1, 2, 3, 19, 20, 21);
133 SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
134 SetSens(1); // sensitive strips set
137 fTPCParam->Write(fTPCParam->GetTitle());
140 //_____________________________________________________________________________
141 void AliTPCv2::CreateGeometry()
144 // Create the geometry of Time Projection Chamber version 2
148 <img src="picts/AliTPC.gif">
153 <img src="picts/AliTPCv2Tree.gif">
158 Int_t *idtmed = fIdtmed->GetArray();
169 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
170 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
172 // ---------------------------------------------------
173 // sector specification check
174 // ---------------------------------------------------
178 for (i = 0; i < 6; ++i) {
179 if (fSecLows[i] >= 0 && fSecLows[i] < 2*nInnerSector) {
181 printf("*** SECTOR %d selected\n",fSecLows[i]);
186 printf("*** ALL LOWER SECTORS SELECTED ***\n");
191 printf("*** ERROR: AT LEAST ONE LOWER SECTOR MUST BE SPECIFIED ***\n");
192 printf("!!! PROGRAM STOPPED !!!\n");
198 for (i = 0; i < 12; ++i) {
199 if (fSecUps[i] > 2*nInnerSector-1 &&
200 fSecUps[i] < 2*(nInnerSector+nOuterSector)) {
201 printf("*** SECTOR %d selected\n",fSecUps[i]);
206 printf("*** ALL UPPER SECTORS SELECTED ***\n");
211 //--------------------------------------------------------------------
214 // Mother volume (Air) - all volumes will be positioned in it
294 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,39);
297 //-------------------------------------------------------------------
298 // Tpc Outer INsulator (CO2)
299 //-------------------------------------------------------------------
338 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
340 //---------------------------------------------------------------
341 // shreds (G10) - TPC Rings
342 //---------------------------------------------------------------
344 gMC->Gsvolu("TPCR","TUBE",idtmed[12],dm,0);
350 gMC->Gsposp("TPCR",1,"TOIN",0.,0.,-253.3,0,"ONLY",dm,3); // left bottom
358 gMC->Gsposp("TPCR",2,"TOIN",0.,0.,253.3,0,"ONLY",dm,3); // right
366 gMC->Gsposp("TPCR",3,"TOIN",0.,0.,-250.7,0,"ONLY",dm,3); // left top
368 //----------------------------------------------------------------
369 // Tpc Outer Contaiment Vessel
370 // mother volume - Al, daughters - composite (sandwich)
371 //----------------------------------------------------------------
407 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,18);
411 // Tpc SAndwich 1 - Al
417 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
419 // Tpc SAndwich 2 - Tedlar
424 gMC->Gsvolu("TSA2","TUBE",idtmed[9],dm,3);
426 // Tpc SAndwich 3 - Kevlar
431 gMC->Gsvolu("TSA3","TUBE",idtmed[5],dm,3);
433 // Tpc SAndwich 4 - NOMEX honeycomb
438 gMC->Gsvolu("TSA4","TUBE",idtmed[5],dm,3);
442 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
443 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
444 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
446 gMC->Gspos("TSA1",1,"TOCV",0.,0.,2.6,0,"ONLY");
450 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
452 //-------------------------------------------------------
453 // Tpc Outer Field Cage
454 // mother volume - Al, daughters - composite (sandwich)
455 //-------------------------------------------------------
495 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
499 // Tpc SAndwich 5 - Tedlar
505 gMC->Gsvolu("TSA5","TUBE",idtmed[9],dm,3);
507 // Tpc SAndwich 6 - Kevlar
512 gMC->Gsvolu("TSA6","TUBE",idtmed[5],dm,3);
515 // Tpc SAndwich 8 - NOMEX
520 gMC->Gsvolu("TSA7","TUBE",idtmed[6],dm,3);
524 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
525 gMC->Gspos("TSA6",1,"TSA5",0.,0.,0.,0,"ONLY");
527 gMC->Gspos("TSA5",1,"TOFC",0.,0.,0.,0,"ONLY");
531 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
535 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
537 //--------------------------------------------------------------------
538 // Tpc Inner INsulator (CO2)
539 //--------------------------------------------------------------------
554 Float_t tanL = (66.2-59.0)/(255.6-73.3); // tangent of the left cone part
557 dm[7]= 59.0+ (253.6-73.3)*tanL;
638 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,48);
641 //--------------------------------------------------------------------
642 // Tpc Inner Containment vessel, Left part
643 // mother volume - Al, daughter - composite (sandwich)
644 //--------------------------------------------------------------------
658 Float_t cosL = 1./TMath::Sqrt(1.+tanL*tanL);
659 Float_t sandThick = 2.14; // cone composite thickness
665 dm[7]= 59.0 + (253.6-73.3)*tanL;
672 dm[11]= dm[7]+sandThick/cosL;
677 dm[13]= 59.0+(75.6-73.3)*tanL;
678 dm[14]= dm[13]+sandThick/cosL;
704 gMC->Gsvolu("TICL","PCON",idtmed[4],dm,27);
708 // Tpc SAndwich 9 - Al
717 dm[4]= 59.0+(254.3-73.3)*tanL;
718 dm[5]= dm[4]+sandThick/cosL;
723 dm[7]= 59.0+(78.3-73.3)*tanL;
724 dm[8]= dm[7]+sandThick/cosL;
728 gMC->Gsvolu("TSA9","PCON",idtmed[4],dm,9);
730 // Tpc SAndwich 10 - Tedlar
740 gMC->Gsvolu("TS10","PCON",idtmed[9],dm,9);
742 // Tpc SAndwich 11 - Kevlar
752 gMC->Gsvolu("TS11","PCON",idtmed[5],dm,9);
754 // Tpc SAndwich 12 - NOMEX
764 gMC->Gsvolu("TS12","PCON",idtmed[6],dm,9);
768 gMC->Gspos("TS12",1,"TS11",0.,0.,0.,0,"ONLY");
769 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
770 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
774 gMC->Gspos("TSA9",1,"TICL",0.,0.,0.,0,"ONLY");
776 //--------------------------------------------------------------------
777 // Tpc Inner Containment vessel, Right part
778 // mother volume - Al, daughter - composite (sandwich)
779 //--------------------------------------------------------------------
805 Float_t tanR = (66.0-59.0)/(250.5-73.3); // to avoid accuracy problems
806 Float_t cosR = 1./TMath::Sqrt(1.+tanR*tanR); //as above
811 dm[13]= 59.0+(75.6-73.3)*tanR;
818 dm[17]= dm[16]+sandThick/cosR;
823 dm[19]= 59.0+(248.4-73.3)*tanR;
824 dm[20]= dm[19]+sandThick/cosR;
838 gMC->Gsvolu("TICR","PCON",idtmed[4],dm,27);
844 // Tpc SAndwich 13 - Al
853 dm[4]= 59.0+(78.3-73.3)*tanR;
854 dm[5]= dm[4]+sandThick/cosR;
859 dm[7]= 59.0+(249.1-73.3)*tanR;
860 dm[8]= dm[7]+sandThick/cosR;
864 gMC->Gsvolu("TS13","PCON",idtmed[4],dm,9);
866 // Tpc SAndwich 14 - Tedlar
876 gMC->Gsvolu("TS14","PCON",idtmed[9],dm,9);
878 // Tpc SAndwich 15 - Kevlar
888 gMC->Gsvolu("TS15","PCON",idtmed[5],dm,9);
890 // Tpc SAndwich 16 - NOMEX
900 gMC->Gsvolu("TS16","PCON",idtmed[6],dm,9);
904 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
905 gMC->Gspos("TS15",1,"TS14",0.,0.,0.,0,"ONLY");
906 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
910 gMC->Gspos("TS13",1,"TICR",0.,0.,0.,0,"ONLY");
912 //------------------------------------------------------
913 // Tpc Inner Field Cage
914 // mother volume - Al, daughters - composite (sandwich)
915 //------------------------------------------------------
957 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,21);
961 // Tpc Sandwich 17 - Tedlar
967 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
969 // Tpc Sandwich 18 - Kevlar
974 gMC->Gsvolu("TS18","TUBE",idtmed[5],dm,3);
977 // Tpc Sandwich 19 - NOMEX
982 gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3);
986 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
987 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
991 gMC->Gspos("TS17",1,"TIFC",0.,0.,0.,0,"ONLY");
999 gMC->Gsposp("TPCR",4,"TIIN",0.,0.,-253.3,0,"ONLY",dm,3);
1004 gMC->Gsposp("TPCR",5,"TIIN",0.,0.,250.7,0,"ONLY",dm,3);
1009 gMC->Gsposp("TPCR",6,"TIIN",0.,0.,253.3,0,"ONLY",dm,3);
1013 gMC->Gspos("TICL",1,"TIIN",0.,0.,0.,0,"ONLY");
1017 gMC->Gspos("TICR",1,"TIIN",0.,0.,0.,0,"ONLY");
1021 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
1023 // Tpc Sandwich 21 - Al (central barrel)
1029 gMC->Gsvolu("TS21","TUBE",idtmed[4],dm,3);
1031 // Tpc Sandwich 22 - Tedlar (central barrel)
1036 gMC->Gsvolu("TS22","TUBE",idtmed[9],dm,3);
1038 // Tpc Sandwich 23 - Kevlar (central barrel)
1043 gMC->Gsvolu("TS23","TUBE",idtmed[5],dm,3);
1045 // Tpc Sandwich 24 - NOMEX (central barrel)
1050 gMC->Gsvolu("TS24","TUBE",idtmed[6],dm,3);
1054 gMC->Gspos("TS24",1,"TS23",0.,0.,0.,0,"ONLY");
1055 gMC->Gspos("TS23",1,"TS22",0.,0.,0.,0,"ONLY");
1056 gMC->Gspos("TS22",1,"TS21",0.,0.,0.,0,"ONLY");
1058 gMC->Gspos("TS21",1,"TIIN",0.,0.,0.,0,"ONLY");
1060 // put everything into the TPC
1062 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
1065 //---------------------------------------------------------
1066 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
1067 // and its daughters (HV membrane, rods, readout chambers)
1068 //---------------------------------------------------------
1074 gMC->Gsvolu("TDGN","TUBE",idtmed[1],dm,3); // nonsensitive
1076 // sector opening angles
1078 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
1079 Float_t outerOpenAngle = fTPCParam->GetOuterAngle();
1081 // sector angle shift
1083 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
1085 // All above parameters are identical for inner and outer
1086 // sectors. The distinction is kept for the historical reasons
1087 // and eventually will disappear.
1089 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
1090 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
1093 //-------------------------------------------------------------------------
1094 // Tpc Inner Readout Chambers
1095 //-------------------------------------------------------------------------
1099 dm[2]= 1.6; // thickness
1102 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
1104 // this volume will be positioned in the empty space
1105 // of the end-cap to avoid overlaps
1112 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
1114 //------------------------------------------------
1115 // Tpc Inner readout chamber Pad Plane
1116 //------------------------------------------------
1123 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
1127 dm[0] -= 1.218511934;
1128 dm[1] -= 1.218511934;
1131 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
1133 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
1135 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
1137 //----------------------------------------------
1138 // Tpc Readout Chambers Empty spaces - for both
1139 // inner and outer sectors
1140 //----------------------------------------------
1142 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
1144 // Inner sector - 4 spaces
1155 space = rr*tanAlpha-dm[0];
1157 for(Int_t nsLow=0;nsLow<4;nsLow++){
1160 dm[1]= rr*tanAlpha - space;
1164 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1170 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1173 dm[0] = rr*tanAlpha - space;
1179 // dm[1] - this is the dm[1] from the previous TRCE
1183 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
1186 // TPc Space for Connectors
1193 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1201 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1203 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1210 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
1212 // inner part of the inner sector - 2 x 20 holes
1214 astep = 20.00096874/19.;
1216 alpha = 10.00048437-astep;
1228 for(ncon=0;ncon<20;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+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1242 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1253 // outer part of the inner sector - 2 x 25 holes
1255 astep = 20.00096874/24.;
1256 alpha = 10.00048437-astep;
1264 for(ncon=0;ncon<25;ncon++){
1270 phi3 = (alpha>0) ? 0. : 180.;
1271 theta3 = TMath::Abs(alpha);
1273 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1277 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1278 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1289 //--------------------------------------------------------------------------
1290 // TPC Outer Readout Chambers
1291 // this is NOT a final design
1292 //--------------------------------------------------------------------------
1296 dm[2]= 1.5; //thickness
1299 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1301 //------------------------------------------------
1302 // Tpc Outer readout chamber Pad Plane
1303 //------------------------------------------------
1307 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1309 dm[0] -= 1.218511934;
1310 dm[1] -= 1.218511934;
1313 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1315 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1317 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1327 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1334 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1341 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1345 //-----------------------------------------------
1346 // Tpc Services Support Wheel
1347 //-----------------------------------------------
1362 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1364 // Tpc Services Wheel Cover
1369 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1371 // Tpc Service wheel Cover Empty space
1378 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1380 // Tpc services Wheel Empty Spaces
1387 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1389 // Tpc Services Wheel Bars
1391 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1401 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1406 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1408 // TPc ELectronics - right now 30% X0 Si
1415 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1416 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1418 //--------------------------------------------------------------------------
1420 //--------------------------------------------------------------------------
1422 // TPc Main Wheel - Al
1428 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1430 // TPc Extra Wheel (to avoid overlapping) - Al
1436 gMC->Gsvolu("TPEW","TUBE",idtmed[4],dm,3);
1438 //--------------------------------------------------------------------------
1439 // Tpc Empty Space for the Readout chambers
1440 //--------------------------------------------------------------------------
1444 Float_t dR = 0.5*(rUp-rLow);
1446 space= 1.4/cosAlpha; // wheel ribs are 2.8 cm wide
1448 dm[0]= rLow*tanAlpha-space;
1449 dm[1]= rUp*tanAlpha-space;
1453 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1458 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1463 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1465 // Tpc Empty Space Bars - Al (daughters of TESR)
1469 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1473 dm[0]= rLow*tanAlpha-space;
1474 dm[1]= 88.7*tanAlpha-space;
1480 gMC->Gsposp("TESB",1,"TESR",0.,2.05,zBar,0,"ONLY",dm,4);
1484 dm[0]= 131.65*tanAlpha-space;
1485 dm[1]= 136.5*tanAlpha-space;
1488 zBar = -dR +131.65+dm[3]-rLow;
1490 gMC->Gsposp("TESB",2,"TESR",0.,2.05,zBar,0,"ONLY",dm,4);
1494 dm[0]= 240.4*tanAlpha-space;
1495 dm[1]= rUp*tanAlpha-space;
1500 gMC->Gsposp("TESB",3,"TESR",0.,2.05,zBar,0,"ONLY",dm,4);
1502 //------------------------------------------------------
1503 // TPc Lower "S" Sectors
1504 //------------------------------------------------------
1507 Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow();
1508 Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp();
1510 dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1511 dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1512 dm[2] = 0.5*(250. - 0.3);
1513 dm[3] = 0.5*(inSecUpEdge-inSecLowEdge);
1515 gMC->Gsvolu("TPLS", "TRD1", idtmed[2], dm, 4); // sensitive
1517 //----------------------------------------------------------
1518 // TPc Upper Sectors
1519 //----------------------------------------------------------
1521 Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow();
1522 Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp();
1524 dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1525 dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1526 dm[2] = 0.5*(250. - 0.3);
1527 dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge);
1529 gMC->Gsvolu("TPUS", "TRD1", idtmed[2], dm, 4); // sensitive
1534 gMC->Gsvolu("TPSS","TRD1",idtmed[2],dm,0); // sensitive
1536 Int_t nofStrips,nstr;
1538 Float_t stripThick = 0.01; // 100 microns
1544 // if all lower sectors selected define only 1 strip
1546 nofStrips=((fSecAL <0)||(fSecAL>=0 && fSens<0)) ? 1 : fTPCParam->GetNRowLow();
1547 deadSpace = fTPCParam->GetInnerWireMount();
1549 dm[2] = 0.5*(250. - 0.3);
1550 dm[3] = 0.5 * stripThick;
1553 for(nstr=0;nstr<nofStrips;nstr++){
1555 r1 = fTPCParam->GetPadRowRadiiLow(nstr);
1556 r2 = r1 + stripThick;
1557 dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1558 dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1559 zs = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge);
1563 gMC->Gsposp("TPSS", nstr+1, "TPLS", 0., 0., zs, 0, "ONLY", dm, 4);
1568 // strips only if several upper sectors selected end fSens > 0
1570 if(fSecAU >=0 && fSens >0){
1572 Int_t nsSave = nofStrips;
1576 nofStrips = fTPCParam->GetNRowUp();
1577 deadSpace = fTPCParam->GetOuterWireMount();
1579 dm[2] = 0.5*(250. - 0.3);
1580 dm[3] = 0.5 * stripThick;
1583 for(nstr=0;nstr<nofStrips;nstr++){
1585 r1 = fTPCParam->GetPadRowRadiiUp(nstr);
1586 r2 = r1 + stripThick;
1587 dm[0] = r1 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1588 dm[1] = r2 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1589 zs = -ouSecLowEdge -0.5*(ouSecUpEdge-ouSecLowEdge);
1593 gMC->Gsposp("TPSS", nstr+1+nsSave, "TPUS", 0., 0., zs, 0, "ONLY", dm, 4);
1598 //-------------------------------------------------------
1599 // positioning of the empty spaces into the main wheel
1600 // and readout chambers and sectors into the drift gas
1601 //-------------------------------------------------------
1603 Float_t rCenter,xc,yc;
1604 Float_t rInner,rOuter; // center of the inner and outer chamber
1611 for(Int_t ns=0; ns<nInnerSector;ns++){
1613 phi1 = ns * innerOpenAngle + innerAngleShift;
1614 phi1 *= kRaddeg; // in degrees
1616 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1618 if (phi1 > 360.) phi1 -= 360.;
1623 phi3 = ns * innerOpenAngle + innerAngleShift;
1624 phi3 *= kRaddeg; // in degrees
1626 phi3 = (Float_t)TMath::Nint(phi3);
1628 if(phi3 > 360.) phi3 -= 360.;
1632 // "holes"->End plate
1634 xc = rCenter*TMath::Cos(phi3*kDegrad);
1635 yc = rCenter*TMath::Sin(phi3*kDegrad);
1637 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1639 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1641 // TSCE->TSWC (services wheel volumes)
1643 xc = 166.142*TMath::Cos(phi3*kDegrad);
1644 yc = 166.142*TMath::Sin(phi3*kDegrad);
1646 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1647 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1649 // readout chambers->TDGN (drift gas)
1651 xc = rInner*TMath::Cos(phi3*kDegrad);
1652 yc = rInner*TMath::Sin(phi3*kDegrad);
1654 gMC->Gspos("TIRC",ns+1,"TDGN",xc,yc,252.,idrotm[nRotMat],"ONLY");
1656 // here lower sectors
1660 // all lower sectors are positioned
1662 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.15,idrotm[nRotMat],"ONLY");
1664 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.15,idrotm[nRotMat],"ONLY");
1668 // only selected sectors are positioned (up to 6 sectors)
1670 for(Int_t sel=0;sel<6;sel++){
1672 if(fSecLows[sel] == ns){
1673 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.15,idrotm[nRotMat],"ONLY");
1675 else if(fSecLows[sel] == ns+nInnerSector){
1677 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.15,idrotm[nRotMat],"ONLY");
1680 } // lower sectors finished
1682 xc = rOuter*TMath::Cos(phi3*kDegrad);
1683 yc = rOuter*TMath::Sin(phi3*kDegrad);
1685 gMC->Gspos("TORC",ns+1,"TDGN",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1687 // here upper sectors
1691 // all upper sectors
1693 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.15,idrotm[nRotMat],"ONLY");
1695 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.15,idrotm[nRotMat],"ONLY");
1699 // only selected sectors (up to 12)
1701 for(Int_t sel=0;sel<12;sel++){
1702 if(fSecUps[sel] == ns+2*nInnerSector){
1703 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.15,idrotm[nRotMat],"ONLY");
1705 else if(fSecUps[sel] == ns+2*nInnerSector+nOuterSector){
1707 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.15,idrotm[nRotMat],"ONLY");
1710 } // upper sectors finished
1714 theta2 = 0.; // reflection, needed for readout chambers!
1716 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1718 xc = rInner*TMath::Cos(phi3*kDegrad);
1719 yc = rInner*TMath::Sin(phi3*kDegrad);
1721 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGN",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1723 xc = rOuter*TMath::Cos(phi3*kDegrad);
1724 yc = rOuter*TMath::Sin(phi3*kDegrad);
1726 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGN",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1733 // reflection matrix
1742 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1747 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1748 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[nRotMat],"ONLY");
1749 gMC->Gspos("TPEW",1,"TPC ",0.,0.,257.65,0,"ONLY");
1750 gMC->Gspos("TPEW",2,"TPC ",0.,0.,-257.65,0,"ONLY");
1754 //-------------------------------------------------------
1755 // Tpc High Voltage Membrane - NOMEX honeycomb
1756 //-------------------------------------------------------
1775 gMC->Gsvolu("THVM","PGON",idtmed[6],dm,10);
1777 gMC->Gspos("THVM",1,"TDGN",0.,0.,0.,0,"ONLY");
1779 //----------------------------------------------------------
1780 // TPc Support Rods - MAKROLON
1781 //----------------------------------------------------------
1787 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,3);
1789 for(Int_t nrod=1;nrod<18;nrod++){
1790 Float_t angle=innerOpenAngle*(Float_t)nrod;
1792 xc=82.4*TMath::Cos(angle);
1793 yc=82.4*TMath::Sin(angle);
1795 gMC->Gspos("TPSR",nrod,"TDGN",xc,yc,126.95,0,"ONLY");
1796 gMC->Gspos("TPSR",nrod+17,"TDGN",xc,yc,-126.95,0,"ONLY");
1798 xc=254.2*TMath::Cos(angle);
1799 yc=254.2*TMath::Sin(angle);
1801 gMC->Gspos("TPSR",nrod+34,"TDGN",xc,yc,126.95,0,"ONLY");
1802 gMC->Gspos("TPSR",nrod+51,"TDGN",xc,yc,-126.95,0,"ONLY");
1806 //----------------------------------------------------------
1807 // Tpc High Voltage rod - MAKROLON + Copper cable
1808 //----------------------------------------------------------
1810 // rod with cable (Left)
1816 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1824 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1832 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1834 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1835 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1837 // rod without cable
1843 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1847 gMC->Gspos("THVL",1,"TDGN",82.4,0.,-126.95,0,"ONLY");
1848 gMC->Gspos("THVL",2,"TDGN",254.2,0.,-126.95,0,"ONLY");
1850 gMC->Gspos("THVR",1,"TDGN",82.4,0.,126.95,0,"ONLY");
1851 gMC->Gspos("THVR",2,"TDGN",254.2,0.,126.95,0,"ONLY");
1855 gMC->Gspos("TDGN",1,"TPC ",0.,0.,0.,0,"ONLY");
1857 // services wheel cover -> wheel
1860 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1861 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1864 // put the wheel into the TPC
1866 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1867 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1869 gMC->Gsord("TPMW",6);
1870 if(fSecAL >=0) gMC->Gsord("TPLS",3);
1871 if(fSecAU >=0 && fSens >0) gMC->Gsord("TPUS",3);
1872 gMC->Gsord("TDGN",6);
1873 gMC->Gsord("TSSW",6);
1874 gMC->Gsord("TSWC",6);
1876 // put the TPC into ALIC (main mother volume)
1878 gMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
1880 } // end of function
1882 //_____________________________________________________________________________
1883 void AliTPCv2::DrawDetector()
1886 // Draw a shaded view of the Time Projection Chamber version 1
1889 // Set everything unseen
1890 gMC->Gsatt("*", "seen", -1);
1892 // Set ALIC mother transparent
1893 gMC->Gsatt("ALIC","SEEN",0);
1895 // Set the volumes visible
1898 gMC->Gsatt("TPC ","SEEN",0);
1899 gMC->Gsatt("TOIN","SEEN",1);
1900 gMC->Gsatt("TOIN","COLO",7);
1901 gMC->Gsatt("TPCR","SEEN",0);
1902 gMC->Gsatt("TOCV","SEEN",1);
1903 gMC->Gsatt("TOCV","COLO",4);
1904 gMC->Gsatt("TSA1","SEEN",0);
1905 gMC->Gsatt("TSA2","SEEN",0);
1906 gMC->Gsatt("TSA3","SEEN",0);
1907 gMC->Gsatt("TSA4","SEEN",0);
1908 gMC->Gsatt("TOFC","SEEN",1);
1909 gMC->Gsatt("TOFC","COLO",4);
1910 gMC->Gsatt("TSA5","SEEN",0);
1911 gMC->Gsatt("TSA6","SEEN",0);
1912 gMC->Gsatt("TSA7","SEEN",0);
1913 gMC->Gsatt("TIIN","COLO",7);
1914 gMC->Gsatt("TIIN","SEEN",1);
1915 gMC->Gsatt("TICL","SEEN",0);
1916 gMC->Gsatt("TSA9","SEEN",0);
1917 gMC->Gsatt("TS10","SEEN",0);
1918 gMC->Gsatt("TS11","SEEN",0);
1919 gMC->Gsatt("TS12","SEEN",0);
1920 gMC->Gsatt("TICR","SEEN",0);
1921 gMC->Gsatt("TS13","SEEN",0);
1922 gMC->Gsatt("TS14","SEEN",0);
1923 gMC->Gsatt("TS15","SEEN",0);
1924 gMC->Gsatt("TS16","SEEN",0);
1925 gMC->Gsatt("TIFC","SEEN",1);
1926 gMC->Gsatt("TIFC","COLO",4);
1927 gMC->Gsatt("TS17","SEEN",0);
1928 gMC->Gsatt("TS18","SEEN",0);
1929 gMC->Gsatt("TS19","SEEN",0);
1930 gMC->Gsatt("TS21","SEEN",0);
1931 gMC->Gsatt("TS22","SEEN",0);
1932 gMC->Gsatt("TS23","SEEN",0);
1933 gMC->Gsatt("TS24","SEEN",0);
1934 gMC->Gsatt("TDGN","SEEN",0);
1935 gMC->Gsatt("TIRC","SEEN",0);
1936 gMC->Gsatt("TIC1","SEEN",1);
1937 gMC->Gsatt("TIPP","SEEN",0);
1938 gMC->Gsatt("TIC3","SEEN",0);
1939 gMC->Gsatt("TRCE","SEEN",0);
1940 gMC->Gsatt("TPSC","SEEN",0);
1941 gMC->Gsatt("TPCC","SEEN",0);
1942 gMC->Gsatt("TORC","SEEN",0);
1943 gMC->Gsatt("TOPP","SEEN",0);
1944 gMC->Gsatt("TOC3","SEEN",0);
1945 gMC->Gsatt("TOC1","SEEN",1);
1946 gMC->Gsatt("TSSW","SEEN",1);
1947 gMC->Gsatt("TSWC","SEEN",1);
1948 gMC->Gsatt("TSCE","SEEN",1);
1949 gMC->Gsatt("TSSW","COLO",3);
1950 gMC->Gsatt("TSWC","COLO",3);
1951 gMC->Gsatt("TSCE","COLO",6);
1952 gMC->Gsatt("TWES","SEEN",0);
1953 gMC->Gsatt("TSWB","SEEN",0);
1954 gMC->Gsatt("TPEL","SEEN",0);
1955 gMC->Gsatt("TPMW","SEEN",1);
1956 gMC->Gsatt("TPEW","SEEN",1);
1957 gMC->Gsatt("TESR","SEEN",1);
1958 gMC->Gsatt("TPMW","COLO",12);
1959 gMC->Gsatt("TPEW","COLO",12);
1960 gMC->Gsatt("TWES","COLO",5);
1961 gMC->Gsatt("TIC1","COLO",5);
1962 gMC->Gsatt("TOC1","COLO",5);
1963 gMC->Gsatt("TESB","SEEN",0);
1964 gMC->Gsatt("TPLS","SEEN",0);
1965 gMC->Gsatt("TPUS","SEEN",0);
1966 gMC->Gsatt("TPSS","SEEN",0);
1967 gMC->Gsatt("THVM","SEEN",1);
1968 gMC->Gsatt("THVM","COLO",11);
1969 gMC->Gsatt("TPSR","SEEN",0);
1970 gMC->Gsatt("THVL","SEEN",0);
1971 gMC->Gsatt("THVC","SEEN",0);
1972 gMC->Gsatt("THVE","SEEN",0);
1973 gMC->Gsatt("THVR","SEEN",0);
1976 gMC->Gdopt("hide", "on");
1977 gMC->Gdopt("shad", "on");
1978 gMC->Gsatt("*", "fill", 7);
1979 gMC->SetClipBox(".");
1980 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1981 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1982 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1983 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1984 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1985 gMC->DefaultRange();
1986 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1987 gMC->Gdhead(1111, "Time Projection Chamber");
1988 gMC->Gdman(18, 4, "MAN");
1989 gMC->Gdopt("hide","off");
1992 //_____________________________________________________________________________
1993 void AliTPCv2::CreateMaterials()
1996 // Define materials for version 2 of the Time Projection Chamber
1999 AliTPC::CreateMaterials();
2002 //_____________________________________________________________________________
2003 void AliTPCv2::Init()
2006 // Initialises version 2 of the TPC after that it has been built
2009 Int_t *idtmed = fIdtmed->GetArray();
2015 fIdSens=gMC->VolId("TPSS");
2017 fIdLSec=gMC->VolId("TPLS"); // lower sector
2018 fIdUSec=gMC->VolId("TPUS"); // upper sector
2020 gMC->SetMaxNStep(30000); // max. number of steps increased
2022 gMC->Gstpar(idtmed[2],"LOSS",5); // specific energy loss
2024 printf("*** TPC version 2 initialized ***\n");
2025 printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
2031 //_____________________________________________________________________________
2032 void AliTPCv2::StepManager()
2035 // Called for every step in the Time Projection Chamber
2039 // parameters used for the energy loss calculations
2041 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
2042 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
2043 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
2046 const Float_t kbig = 1.e10;
2053 vol[1]=0; // preset row number to 0
2057 gMC->SetMaxStep(kbig);
2059 if(!gMC->IsTrackAlive()) return; // particle has disappeared
2061 Float_t charge = gMC->TrackCharge();
2063 if(TMath::Abs(charge)<=0.) return; // take only charged particles
2065 // check the sensitive volume
2067 id = gMC->CurrentVolID(copy); // current volume Id
2070 vol[0] = copy-1; // lower sector number
2072 else if(id == fIdUSec){
2073 vol[0] = copy+fTPCParam->GetNInnerSector()-1; // upper sector number
2075 else if(id == fIdSens && gMC->IsTrackEntering()){
2077 // track is entering the sensitive strip
2079 vol[1]= copy-1; // row number (absolute)
2083 id = gMC->CurrentVolOffID(1,copy);
2089 vol[0] = copy-1; // sector number
2096 vol[0] = copy-1+fTPCParam->GetNInnerSector(); // sector number
2097 vol[1] -= fTPCParam->GetNRowLow(); // row number (starts also from 0)
2103 // because Jouri wants to have this
2105 gMC->TrackMomentum(p);
2109 hits[3]=0.; // this hit has no energy loss
2110 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2112 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
2116 gMC->TrackPosition(p);
2120 hits[3]=0.; // this hit has no energy loss
2121 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2123 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
2128 //-----------------------------------------------------------------
2129 // charged particle is in the sensitive volume
2130 //-----------------------------------------------------------------
2132 if(gMC->TrackStep() > 0) {
2134 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
2135 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
2137 gMC->TrackPosition(p);
2141 hits[3]=(Float_t)nel;
2145 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2147 gMC->TrackMomentum(p);
2148 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2149 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
2150 fTrackHits->SetHitPrecision(precision);
2152 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
2156 // Stemax calculation for the next step
2160 gMC->TrackMomentum(mom);
2161 Float_t ptot=mom.Rho();
2162 Float_t betaGamma = ptot/gMC->TrackMass();
2164 Int_t pid=gMC->TrackPid();
2165 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
2167 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
2171 pp=kprim*BetheBloch(betaGamma);
2172 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
2176 gMC->Rndm(random,1); // good, old GRNDM from Geant3
2178 Double_t rnd = (Double_t)random[0];
2180 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
2184 //_____________________________________________________________________________
2185 Float_t AliTPCv2::BetheBloch(Float_t bg)
2188 // Bethe-Bloch energy loss formula
2190 const Double_t kp1=0.76176e-1;
2191 const Double_t kp2=10.632;
2192 const Double_t kp3=0.13279e-4;
2193 const Double_t kp4=1.8631;
2194 const Double_t kp5=1.9479;
2196 Double_t dbg = (Double_t) bg;
2198 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
2200 Double_t aa = TMath::Power(beta,kp4);
2201 Double_t bb = TMath::Power(1./dbg,kp5);
2203 bb=TMath::Log(kp3+bb);
2205 return ((Float_t)((kp2-aa-bb)*kp1/aa));