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.35 2001/04/24 11:17:33 kowal2
21 Revision 1.34 2001/04/23 10:20:18 hristov
22 Constant casted to avoid ambiguity
24 Revision 1.33 2001/04/20 08:16:47 kowal2
25 Protection against too small betaGamma. Thanks to Ivana and Yves.
27 Revision 1.32 2001/03/13 13:07:34 kowal2
28 Corrected bug in the TPC mother volume geometry.
31 Revision 1.31 2000/11/30 11:48:50 kowal2
32 TLorentzVector.h adde to satisfy the latest changes by Federico
34 Revision 1.30 2000/11/14 10:48:57 kowal2
35 Correct material used for TSA4. Thanks to J. Barbosa.
37 Revision 1.29 2000/11/06 17:24:10 kowal2
38 Corrected bug in the outer containment vessel and
39 the outer field cage geometry.
42 Revision 1.28 2000/11/02 16:55:24 kowal2
43 Corrected bug in the inner containment vessel geometry.
46 Revision 1.27 2000/11/02 07:24:11 kowal2
47 Correction in the TPC geometry.
48 Changes due to the new hit structure.
50 Revision 1.26 2000/10/05 16:16:29 kowal2
51 Corrections of the hit recording algorithm.
53 Revision 1.25 2000/10/02 21:28:18 fca
54 Removal of useless dependecies via forward declarations
56 Revision 1.24 2000/08/28 10:02:30 kowal2
57 Corrected bug in the StepManager
59 Revision 1.23 2000/07/10 20:57:39 hristov
60 Update of TPC code and macros by M.Kowalski
62 Revision 1.22 2000/06/30 12:07:50 kowal2
63 Updated from the TPC-PreRelease branch
65 Revision 1.21.2.4 2000/06/26 07:39:42 kowal2
66 Changes to obey the coding rules
68 Revision 1.21.2.3 2000/06/25 08:38:41 kowal2
69 Splitted from AliTPCtracking
71 Revision 1.21.2.2 2000/06/16 12:58:13 kowal2
72 Changed parameter settings
74 Revision 1.21.2.1 2000/06/09 07:15:07 kowal2
76 Defaults loaded automatically (hard-wired)
77 Optional parameters can be set via macro called in the constructor
79 Revision 1.21 2000/05/15 10:00:30 kowal2
80 Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
82 Revision 1.20 2000/04/17 09:37:33 kowal2
83 removed obsolete AliTPCDigitsDisplay.C
85 Revision 1.19.8.2 2000/04/10 08:31:52 kowal2
87 Different geometry for different sectors
88 Updated readout chambers
89 Some modifications to StepManager by J.Belikov
91 Revision 1.19.8.1 2000/04/10 07:56:53 kowal2
92 Not used anymore - removed
94 Revision 1.19 1999/11/04 17:28:07 fca
95 Correct barrel part of HV Degrader
97 Revision 1.18 1999/10/14 16:52:08 fca
98 Only use PDG codes and not GEANT ones
100 Revision 1.17 1999/10/08 06:27:23 fca
101 Corrected bug in the HV degrader geometry, thanks to G.Tabary
103 Revision 1.16 1999/10/04 13:39:54 fca
104 Correct array index problem
106 Revision 1.15 1999/09/29 09:24:34 fca
107 Introduction of the Copyright and cvs Log
112 ///////////////////////////////////////////////////////////////////////////////
114 // Time Projection Chamber version 2 -- detailed TPC and slow simulation //
118 <img src="picts/AliTPCv2Class.gif">
123 ///////////////////////////////////////////////////////////////////////////////
128 #include "AliTPCv2.h"
129 #include "AliTPCDigitsArray.h"
132 #include "AliConst.h"
134 #include "AliTPCParam.h"
135 #include "AliTPCParamSR.h"
136 #include "AliTPCTrackHits.h"
137 #include "TLorentzVector.h"
142 //_____________________________________________________________________________
143 AliTPCv2::AliTPCv2(const char *name, const char *title) :
147 // Standard constructor for Time Projection Chamber version 2
153 SetBufferSize(128000);
155 SetGasMixt(2,20,10,-1,0.9,0.1,0.); // Ne-CO2 90-10
161 SetSecLows(1, 2, 3, 19, 20, 21);
162 SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
163 SetSens(1); // sensitive strips set
166 fTPCParam->Write(fTPCParam->GetTitle());
169 //_____________________________________________________________________________
170 void AliTPCv2::CreateGeometry()
173 // Create the geometry of Time Projection Chamber version 2
177 <img src="picts/AliTPC.gif">
182 <img src="picts/AliTPCv2Tree.gif">
187 Int_t *idtmed = fIdtmed->GetArray();
198 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
199 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
201 // ---------------------------------------------------
202 // sector specification check
203 // ---------------------------------------------------
207 for (i = 0; i < 6; ++i) {
208 if (fSecLows[i] >= 0 && fSecLows[i] < 2*nInnerSector) {
210 printf("*** SECTOR %d selected\n",fSecLows[i]);
215 printf("*** ALL LOWER SECTORS SELECTED ***\n");
220 printf("*** ERROR: AT LEAST ONE LOWER SECTOR MUST BE SPECIFIED ***\n");
221 printf("!!! PROGRAM STOPPED !!!\n");
227 for (i = 0; i < 12; ++i) {
228 if (fSecUps[i] > 2*nInnerSector-1 &&
229 fSecUps[i] < 2*(nInnerSector+nOuterSector)) {
230 printf("*** SECTOR %d selected\n",fSecUps[i]);
235 printf("*** ALL UPPER SECTORS SELECTED ***\n");
240 //--------------------------------------------------------------------
243 // Mother volume TPC (Air) - all volumes will be positioned in it
298 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
302 //-------------------------------------------------------------------
303 // Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
304 //-------------------------------------------------------------------
346 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
348 //----------------------------------------------------------------
349 // Tpc Outer Contaiment Vessel
350 // mother volume - Al, daughters - composite (sandwich)
351 //----------------------------------------------------------------
393 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
395 // Daughter volumes - sandwich
397 // Tpc SAndwich 1 - Al
403 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
405 // Tpc SAndwich 2 - epoxy glue (I use Lexan)
410 gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
412 // Tpc SAndwich 3 - Tedlar
417 gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
420 // Tpc SAndwich 4 - fiber glass (G10)
425 gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);
427 // Tpc SAndwich 5 - NOMEX honeycomb
432 gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
434 // 5->4->3->2->1->TCOV
437 gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
438 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
439 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
440 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
442 gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
446 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
448 //-------------------------------------------------------
449 // Tpc Outer Field Cage
450 // mother volume - Al, daughters - composite (sandwich)
451 //-------------------------------------------------------
493 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
497 // Tpc SAndwich 6 - Tedlar
503 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
505 // Tpc SAndwich 7 - fiber glass
510 gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
513 // Tpc SAndwich 8 - NOMEX
518 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
522 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
523 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
524 gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
528 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
532 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
536 //--------------------------------------------------------------------
537 // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
538 // Inner containment vessel will be placed directly in the TPC
539 //--------------------------------------------------------------------
569 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
571 // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
577 gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
579 gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
581 //-----------------------------------------------------
582 // Tpc Inner Field Cage
583 // mother volume - Al, daughters - composite (sandwich)
584 //------------------------------------------------------
650 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
652 // daughter volumes - central part
654 // Tpc Sandwich 9 -Tedlar
660 gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3);
662 // Tpc Sandwich 10 - fiber glass (G10)
667 gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
669 // Tpc Sandwich 11 - NOMEX
674 gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
678 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
679 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
681 gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
683 // daughter volumes - outer parts (reinforced)
685 // Tpc Sandwich 12 -Tedlar
691 gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
693 // Tpc Sandwich 13 - fiber glass (G10)
698 gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
700 // Tpc Sandwich 14 - NOMEX
705 gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
709 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
710 gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY");
712 gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
713 gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY");
715 // place this inside the inner insulator
717 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
719 // and now in the TPC...
721 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
723 //---------------------------------------------------------
724 // Tpc Inner Containment vessel - Cones
725 //---------------------------------------------------------
779 gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
781 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
792 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
794 gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
795 gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
798 //---------------------------------------------------------
799 // Tpc Inner Containment vessel - Middle part -Al
800 //---------------------------------------------------------
842 gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
844 // Tpc Sandwich 15 - Al
850 gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
852 // Tpc Sandwich 16 - epoxy glue
857 gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
859 // Tpc Sandwich 17 - Tedlar
864 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
866 // Tpc Sandwich 18 - fiber glass
871 gMC->Gsvolu("TS18","TUBE",idtmed[12],dm,3);
873 // Tpc Sandwich 19 - Nomex
878 gMC->Gsvolu("TS19","TUBE",idtmed[12],dm,3);
880 // 19->18->17->16->15-> TICM
882 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
883 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
884 gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
885 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
887 gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
890 // TPc inner cont. vessel Joints
896 gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
898 gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
899 gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
931 gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
933 gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
934 gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
938 // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
944 gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
946 gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
947 gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY");
951 gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
955 nRotMat++; // prepare for the next rotation matrix
957 //---------------------------------------------------------
958 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
959 // and its daughters (HV membrane, rods, readout chambers)
960 //---------------------------------------------------------
966 gMC->Gsvolu("TDGN","TUBE",idtmed[1],dm,3);
968 // sector opening angles
970 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
971 Float_t outerOpenAngle = fTPCParam->GetOuterAngle();
973 // sector angle shift
975 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
978 // All above parameters are identical for inner and outer
979 // sectors. The distinction is kept for the historical reasons
980 // and eventually will disappear.
982 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
983 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
986 //-------------------------------------------------------------------------
987 // Tpc Inner Readout Chambers
988 //-------------------------------------------------------------------------
992 dm[2]= 1.6; // thickness
995 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
997 // this volume will be positioned in the empty space
998 // of the end-cap to avoid overlaps
1005 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
1008 //------------------------------------------------
1009 // Tpc Inner readout chamber Pad Plane
1010 //------------------------------------------------
1017 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
1021 dm[0] -= 1.218511934;
1022 dm[1] -= 1.218511934;
1025 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
1027 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
1029 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
1032 //----------------------------------------------
1033 // Tpc Readout Chambers Empty spaces - for both
1034 // inner and outer sectors
1035 //----------------------------------------------
1037 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
1039 // Inner sector - 4 spaces
1050 space = rr*tanAlpha-dm[0];
1052 for(Int_t nsLow=0;nsLow<4;nsLow++){
1055 dm[1]= rr*tanAlpha - space;
1059 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1065 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1068 dm[0] = rr*tanAlpha - space;
1074 // dm[1] - this is the dm[1] from the previous TRCE
1078 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
1081 // TPc Space for Connectors
1088 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1096 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1098 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1106 // inner part of the inner sector - 2 x 20 holes
1108 astep = 20.00096874/19.;
1110 alpha = 10.00048437-astep;
1122 for(ncon=0;ncon<20;ncon++){
1128 phi3 = (alpha>0) ? 0. : 180.;
1129 theta3 = TMath::Abs(alpha);
1131 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1135 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1136 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1147 // outer part of the inner sector - 2 x 25 holes
1149 astep = 20.00096874/24.;
1150 alpha = 10.00048437-astep;
1158 for(ncon=0;ncon<25;ncon++){
1164 phi3 = (alpha>0) ? 0. : 180.;
1165 theta3 = TMath::Abs(alpha);
1167 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1171 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1172 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1183 //--------------------------------------------------------------------------
1184 // TPC Outer Readout Chambers
1185 // this is NOT a final design
1186 //--------------------------------------------------------------------------
1190 dm[2]= 1.5; //thickness
1193 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1195 //------------------------------------------------
1196 // Tpc Outer readout chamber Pad Plane
1197 //------------------------------------------------
1201 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1203 dm[0] -= 1.218511934;
1204 dm[1] -= 1.218511934;
1207 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1209 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1211 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1220 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1227 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1234 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1236 //-----------------------------------------------
1237 // Tpc Services Support Wheel
1238 //-----------------------------------------------
1253 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1255 // Tpc Services Wheel Cover
1260 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1262 // Tpc Service wheel Cover Empty space
1269 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1271 // Tpc services Wheel Empty Spaces
1278 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1280 // Tpc Services Wheel Bars
1282 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1292 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1297 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1299 // TPc ELectronics - right now 30% X0 Si
1306 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1307 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1309 //--------------------------------------------------------------------------
1311 //--------------------------------------------------------------------------
1313 // TPc Main Wheel - Al
1319 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1321 //--------------------------------------------------------------------------
1322 // Tpc Empty Space for the Readout chambers
1323 //--------------------------------------------------------------------------
1327 Float_t dR = 0.5*(rUp-rLow);
1329 space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1331 dm[0]= rLow*tanAlpha-space;
1332 dm[1]= rUp*tanAlpha-space;
1336 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1340 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1344 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1346 // Tpc Empty Space Bars - Al (daughters of TESR)
1350 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1354 dm[0]= rLow*tanAlpha-space;
1355 dm[1]= 88.7*tanAlpha-space;
1361 gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1365 dm[0]= 131.65*tanAlpha-space;
1366 dm[1]= 136.5*tanAlpha-space;
1369 zBar = -dR +131.65+dm[3]-rLow;
1371 gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1375 dm[0]= 240.4*tanAlpha-space;
1376 dm[1]= rUp*tanAlpha-space;
1381 gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1383 //------------------------------------------------------
1384 // TPc Lower "S" Sectors
1385 //------------------------------------------------------
1388 Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow();
1389 Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp();
1391 dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1392 dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1393 dm[2] = 0.5*(250. - 5.e-3);
1394 dm[3] = 0.5*(inSecUpEdge-inSecLowEdge);
1396 gMC->Gsvolu("TPLS", "TRD1", idtmed[2], dm, 4); // sensitive
1399 //----------------------------------------------------------
1400 // TPc Upper Sectors
1401 //----------------------------------------------------------
1403 Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow();
1404 Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp();
1406 dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1407 dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1408 dm[2] = 0.5*(250. - 5.e-3);
1409 dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge);
1411 gMC->Gsvolu("TPUS", "TRD1", idtmed[2], dm, 4); // sensitive
1417 gMC->Gsvolu("TPSS","TRD1",idtmed[2],dm,0); // sensitive
1419 Int_t nofStrips,nstr;
1421 Float_t stripThick = 0.01; // 100 microns
1427 // if all lower sectors selected define only 1 strip
1429 nofStrips=((fSecAL <0)||(fSecAL>=0 && fSens<0)) ? 1 : fTPCParam->GetNRowLow();
1430 deadSpace = fTPCParam->GetInnerWireMount();
1432 dm[2] = 0.5*(250. - 5.e-3);
1433 dm[3] = 0.5 * stripThick;
1435 for(nstr=0;nstr<nofStrips;nstr++){
1437 r1 = fTPCParam->GetPadRowRadiiLow(nstr);
1438 r2 = r1 + stripThick;
1439 dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1440 dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1441 zs = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge);
1445 gMC->Gsposp("TPSS", nstr+1, "TPLS", 0., 0., zs, 0, "ONLY", dm, 4);
1450 // strips only if several upper sectors selected end fSens > 0
1452 if(fSecAU >=0 && fSens >0){
1454 Int_t nsSave = nofStrips;
1458 nofStrips = fTPCParam->GetNRowUp();
1459 deadSpace = fTPCParam->GetOuterWireMount();
1461 dm[2] = 0.5*(250. - 5.e-3);
1462 dm[3] = 0.5 * stripThick;
1465 for(nstr=0;nstr<nofStrips;nstr++){
1467 r1 = fTPCParam->GetPadRowRadiiUp(nstr);
1468 r2 = r1 + stripThick;
1469 dm[0] = r1 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1470 dm[1] = r2 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1471 zs = -ouSecLowEdge -0.5*(ouSecUpEdge-ouSecLowEdge);
1475 gMC->Gsposp("TPSS", nstr+1+nsSave, "TPUS", 0., 0., zs, 0, "ONLY", dm, 4);
1481 //-------------------------------------------------------
1482 // positioning of the empty spaces into the main wheel
1483 // and readout chambers and sectors into the drift gas
1484 //-------------------------------------------------------
1486 Float_t rCenter,xc,yc;
1487 Float_t rInner,rOuter; // center of the inner and outer chamber
1495 for(Int_t ns=0; ns<nInnerSector;ns++){
1497 phi1 = ns * innerOpenAngle + innerAngleShift;
1498 phi1 *= kRaddeg; // in degrees
1500 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1502 if (phi1 > 360.) phi1 -= 360.;
1507 phi3 = ns * innerOpenAngle + innerAngleShift;
1508 phi3 *= kRaddeg; // in degrees
1510 phi3 = (Float_t)TMath::Nint(phi3);
1512 if(phi3 > 360.) phi3 -= 360.;
1516 // "holes"->End plate
1518 xc = rCenter*TMath::Cos(phi3*kDegrad);
1519 yc = rCenter*TMath::Sin(phi3*kDegrad);
1521 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1523 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1525 // TSCE->TSWC (services wheel volumes)
1527 xc = 166.142*TMath::Cos(phi3*kDegrad);
1528 yc = 166.142*TMath::Sin(phi3*kDegrad);
1530 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1531 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1534 // readout chambers->TDGN (drift gas)
1536 xc = rInner*TMath::Cos(phi3*kDegrad);
1537 yc = rInner*TMath::Sin(phi3*kDegrad);
1539 gMC->Gspos("TIRC",ns+1,"TDGN",xc,yc,252.,idrotm[nRotMat],"ONLY");
1541 // here lower sectors
1545 // all lower sectors are positioned
1547 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1549 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1553 // only selected sectors are positioned (up to 6 sectors)
1555 for(Int_t sel=0;sel<6;sel++){
1557 if(fSecLows[sel] == ns){
1558 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1560 else if(fSecLows[sel] == ns+nInnerSector){
1562 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1565 } // lower sectors finished
1568 xc = rOuter*TMath::Cos(phi3*kDegrad);
1569 yc = rOuter*TMath::Sin(phi3*kDegrad);
1571 gMC->Gspos("TORC",ns+1,"TDGN",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1573 // here upper sectors
1577 // all upper sectors
1579 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1581 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1585 // only selected sectors (up to 12)
1587 for(Int_t sel=0;sel<12;sel++){
1588 if(fSecUps[sel] == ns+2*nInnerSector){
1589 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1591 else if(fSecUps[sel] == ns+2*nInnerSector+nOuterSector){
1593 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1596 } // upper sectors finished
1601 theta2 = 0.; // reflection
1603 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1605 xc = rInner*TMath::Cos(phi3*kDegrad);
1606 yc = rInner*TMath::Sin(phi3*kDegrad);
1608 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGN",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1610 xc = rOuter*TMath::Cos(phi3*kDegrad);
1611 yc = rOuter*TMath::Sin(phi3*kDegrad);
1613 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGN",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1620 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1621 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1623 //---------------------------------------------------------
1624 // Tpc High Voltage Membrane - 100 microns of mylar
1625 //---------------------------------------------------------
1631 gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1633 gMC->Gspos("THVM",1,"TDGN",0.,0.,0.,0,"ONLY");
1635 // Tpc High Voltage membrane Holders
1637 gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1647 gMC->Gsposp("THVH",1,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1655 gMC->Gsposp("THVH",2,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1657 //----------------------------------------------------------
1658 // TPc Support Rods - MAKROLON
1659 //----------------------------------------------------------
1664 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1667 for(Int_t nrod=0;nrod<18;nrod++){
1668 Float_t angle=innerOpenAngle*(Float_t)nrod;
1670 xc=81.5*TMath::Cos(angle);
1671 yc=81.5*TMath::Sin(angle);
1675 gMC->Gsposp("TPSR",nrod+1,"TDGN",xc,yc,126.9,0,"ONLY",dm,3);
1676 gMC->Gsposp("TPSR",nrod+19,"TDGN",xc,yc,-126.9,0,"ONLY",dm,3);
1680 xc=254.25*TMath::Cos(angle);
1681 yc=254.25*TMath::Sin(angle);
1683 // rod number 54 contans the HV cable
1686 gMC->Gsposp("TPSR",nrod+37,"TDGN",xc,yc,127.,0,"ONLY",dm,3);
1687 gMC->Gsposp("TPSR",nrod+54,"TDGN",xc,yc,-127.,0,"ONLY",dm,3);
1692 //----------------------------------------------------------
1693 // Tpc High Voltage Rod - MAKROLON + Copper cable
1694 //----------------------------------------------------------
1696 // rod with cable (Left)
1702 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1710 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1718 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1720 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1721 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1723 // rod without cable
1729 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1731 gMC->Gspos("THVL",1,"TDGN",xc,yc,-127.,0,"ONLY");
1732 gMC->Gspos("THVR",1,"TDGN",xc,yc,127.,0,"ONLY");
1734 gMC->Gspos("TDGN",1,"TPC ",0.,0.,0.,0,"ONLY");
1736 // services wheel cover -> wheel
1739 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1740 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1743 // put the wheel into the TPC
1745 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1746 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1750 gMC->Gsord("TPMW",6);
1751 gMC->Gsord("TSSW",6);
1752 gMC->Gsord("TSWC",6);
1753 if(fSecAL >=0) gMC->Gsord("TPLS",3);
1754 if(fSecAU >=0 && fSens >0) gMC->Gsord("TPUS",3);
1755 gMC->Gsord("TDGN",6);
1757 // put the TPC into ALIC (main mother volume)
1759 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1763 } // end of function
1765 //_____________________________________________________________________________
1766 void AliTPCv2::DrawDetector()
1769 // Draw a shaded view of the Time Projection Chamber version 1
1772 // Set everything unseen
1773 gMC->Gsatt("*", "seen", -1);
1775 // Set ALIC mother transparent
1776 gMC->Gsatt("ALIC","SEEN",0);
1778 // Set the volumes visible
1781 gMC->Gsatt("TPC ","SEEN",0);
1782 gMC->Gsatt("TOIN","SEEN",1);
1783 gMC->Gsatt("TOIN","COLO",7);
1784 gMC->Gsatt("TOCV","SEEN",1);
1785 gMC->Gsatt("TOCV","COLO",4);
1786 gMC->Gsatt("TSA1","SEEN",0);
1787 gMC->Gsatt("TSA2","SEEN",0);
1788 gMC->Gsatt("TSA3","SEEN",0);
1789 gMC->Gsatt("TSA4","SEEN",0);
1790 gMC->Gsatt("TSA5","SEEN",0);
1791 gMC->Gsatt("TOFC","SEEN",1);
1792 gMC->Gsatt("TOFC","COLO",4);
1793 gMC->Gsatt("TSA6","SEEN",0);
1794 gMC->Gsatt("TSA7","SEEN",0);
1795 gMC->Gsatt("TSA8","SEEN",0);
1796 gMC->Gsatt("TIIN","SEEN",1);
1797 gMC->Gsatt("TIIN","COLO",7);
1798 gMC->Gsatt("TII1","SEEN",0);
1799 gMC->Gsatt("TIFC","SEEN",1);
1800 gMC->Gsatt("TIFC","COLO",4);
1801 gMC->Gsatt("TSA9","SEEN",0);
1802 gMC->Gsatt("TS10","SEEN",0);
1803 gMC->Gsatt("TS11","SEEN",0);
1804 gMC->Gsatt("TS12","SEEN",0);
1805 gMC->Gsatt("TS13","SEEN",0);
1806 gMC->Gsatt("TS14","SEEN",0);
1807 gMC->Gsatt("TICC","SEEN",0);
1808 gMC->Gsatt("TICM","SEEN",0);
1809 gMC->Gsatt("TS15","SEEN",0);
1810 gMC->Gsatt("TS16","SEEN",0);
1811 gMC->Gsatt("TS17","SEEN",0);
1812 gMC->Gsatt("TS18","SEEN",0);
1813 gMC->Gsatt("TS19","SEEN",0);
1814 gMC->Gsatt("TPJ1","SEEN",0);
1815 gMC->Gsatt("TPJ2","SEEN",0);
1816 gMC->Gsatt("TICS","SEEN",0);
1817 gMC->Gsatt("TDGN","SEEN",0);
1818 gMC->Gsatt("TIRC","SEEN",0);
1819 gMC->Gsatt("TIC1","SEEN",1);
1820 gMC->Gsatt("TIPP","SEEN",0);
1821 gMC->Gsatt("TIC3","SEEN",0);
1822 gMC->Gsatt("TRCE","SEEN",0);
1823 gMC->Gsatt("TPSC","SEEN",0);
1824 gMC->Gsatt("TPCC","SEEN",0);
1825 gMC->Gsatt("TORC","SEEN",0);
1826 gMC->Gsatt("TOPP","SEEN",0);
1827 gMC->Gsatt("TOC3","SEEN",0);
1828 gMC->Gsatt("TOC1","SEEN",1);
1829 gMC->Gsatt("TSSW","SEEN",1);
1830 gMC->Gsatt("TSWC","SEEN",1);
1831 gMC->Gsatt("TSSW","COLO",3);
1832 gMC->Gsatt("TSWC","COLO",3);
1833 gMC->Gsatt("TSCE","COLO",6);
1834 gMC->Gsatt("TSCE","SEEN",1);
1835 gMC->Gsatt("TWES","SEEN",0);
1836 gMC->Gsatt("TSWB","SEEN",0);
1837 gMC->Gsatt("TPEL","SEEN",0);
1838 gMC->Gsatt("TPMW","SEEN",1);
1839 gMC->Gsatt("TESR","SEEN",1);
1840 gMC->Gsatt("TPMW","COLO",12);
1841 gMC->Gsatt("TIC1","COLO",5);
1842 gMC->Gsatt("TOC1","COLO",5);
1843 gMC->Gsatt("TESB","SEEN",0);
1844 gMC->Gsatt("THVM","SEEN",1);
1845 gMC->Gsatt("THVM","COLO",11);
1846 gMC->Gsatt("THVH","SEEN",0);
1847 gMC->Gsatt("TPSR","SEEN",0);
1848 gMC->Gsatt("THVL","SEEN",0);
1849 gMC->Gsatt("THVC","SEEN",0);
1850 gMC->Gsatt("THVE","SEEN",0);
1851 gMC->Gsatt("THVR","SEEN",0);
1852 gMC->Gsatt("TPSS","SEEN",0);
1853 gMC->Gsatt("TPUS","SEEN",0);
1854 gMC->Gsatt("TPLS","SEEN",0);
1857 gMC->Gdopt("hide", "on");
1858 gMC->Gdopt("shad", "on");
1859 gMC->Gsatt("*", "fill", 7);
1860 gMC->SetClipBox(".");
1861 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1862 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1863 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1864 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1865 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1866 gMC->DefaultRange();
1867 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1868 gMC->Gdhead(1111, "Time Projection Chamber");
1869 gMC->Gdman(18, 4, "MAN");
1870 gMC->Gdopt("hide","off");
1873 //_____________________________________________________________________________
1874 void AliTPCv2::CreateMaterials()
1877 // Define materials for version 2 of the Time Projection Chamber
1880 AliTPC::CreateMaterials();
1883 //_____________________________________________________________________________
1884 void AliTPCv2::Init()
1887 // Initialises version 2 of the TPC after that it has been built
1890 Int_t *idtmed = fIdtmed->GetArray();
1896 fIdSens=gMC->VolId("TPSS");
1898 fIdLSec=gMC->VolId("TPLS"); // lower sector
1899 fIdUSec=gMC->VolId("TPUS"); // upper sector
1901 gMC->SetMaxNStep(30000); // max. number of steps increased
1903 gMC->Gstpar(idtmed[2],"LOSS",5); // specific energy loss
1905 printf("*** TPC version 2 initialized ***\n");
1906 printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
1912 //_____________________________________________________________________________
1913 void AliTPCv2::StepManager()
1916 // Called for every step in the Time Projection Chamber
1920 // parameters used for the energy loss calculations
1922 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1923 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1924 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1927 const Float_t kbig = 1.e10;
1934 vol[1]=0; // preset row number to 0
1938 gMC->SetMaxStep(kbig);
1940 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1942 Float_t charge = gMC->TrackCharge();
1944 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1946 // check the sensitive volume
1948 id = gMC->CurrentVolID(copy); // current volume Id
1951 vol[0] = copy-1; // lower sector number
1953 else if(id == fIdUSec){
1954 vol[0] = copy+fTPCParam->GetNInnerSector()-1; // upper sector number
1956 else if(id == fIdSens && gMC->IsTrackEntering()){
1958 // track is entering the sensitive strip
1960 vol[1]= copy-1; // row number (absolute)
1964 id = gMC->CurrentVolOffID(1,copy);
1970 vol[0] = copy-1; // sector number
1977 vol[0] = copy-1+fTPCParam->GetNInnerSector(); // sector number
1978 vol[1] -= fTPCParam->GetNRowLow(); // row number (starts also from 0)
1984 // because Jouri wants to have this
1986 gMC->TrackMomentum(p);
1990 hits[3]=0.; // this hit has no energy loss
1991 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1993 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
1997 gMC->TrackPosition(p);
2001 hits[3]=0.; // this hit has no energy loss
2002 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2004 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
2009 //-----------------------------------------------------------------
2010 // charged particle is in the sensitive volume
2011 //-----------------------------------------------------------------
2013 if(gMC->TrackStep() > 0) {
2015 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
2016 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
2018 gMC->TrackPosition(p);
2022 hits[3]=(Float_t)nel;
2026 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2028 gMC->TrackMomentum(p);
2029 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2030 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
2031 fTrackHits->SetHitPrecision(precision);
2033 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
2037 // Stemax calculation for the next step
2041 gMC->TrackMomentum(mom);
2042 Float_t ptot=mom.Rho();
2043 Float_t betaGamma = ptot/gMC->TrackMass();
2045 Int_t pid=gMC->TrackPid();
2046 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
2048 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
2053 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
2054 pp=kprim*BetheBloch(betaGamma);
2056 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
2060 gMC->Rndm(random,1); // good, old GRNDM from Geant3
2062 Double_t rnd = (Double_t)random[0];
2064 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
2068 //_____________________________________________________________________________
2069 Float_t AliTPCv2::BetheBloch(Float_t bg)
2072 // Bethe-Bloch energy loss formula
2074 const Double_t kp1=0.76176e-1;
2075 const Double_t kp2=10.632;
2076 const Double_t kp3=0.13279e-4;
2077 const Double_t kp4=1.8631;
2078 const Double_t kp5=1.9479;
2080 Double_t dbg = (Double_t) bg;
2082 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
2084 Double_t aa = TMath::Power(beta,kp4);
2085 Double_t bb = TMath::Power(1./dbg,kp5);
2087 bb=TMath::Log(kp3+bb);
2089 return ((Float_t)((kp2-aa-bb)*kp1/aa));