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.44 2002/11/21 22:43:32 alibrary
19 Removing AliMC and AliMCProcess
21 Revision 1.43 2002/10/14 14:57:43 hristov
22 Merging the VirtualMC branch to the main development branch (HEAD)
24 Revision 1.40.6.2 2002/07/24 10:09:01 alibrary
27 Revision 1.42 2002/06/12 14:56:56 kowal2
28 Added track length to the reference hits
30 Revision 1.41 2002/05/27 14:33:15 hristov
31 The new class AliTrackReference used (M.Ivanov)
33 Revision 1.40 2002/01/21 17:12:00 kowal2
34 New track hits structure using root containers
36 Revision 1.39 2001/05/16 14:57:25 alibrary
37 New files for folders and Stack
39 Revision 1.38 2001/05/08 16:03:06 kowal2
40 Geometry update according to the latest technical spec.
42 Revision 1.37 2001/04/27 15:23:07 kowal2
43 Correct materian in the central part of the inner containment vessel
45 Revision 1.36 2001/04/26 06:15:12 kowal2
46 Corrected bug in the inner containment vessel (cones)
48 Revision 1.35 2001/04/24 11:17:33 kowal2
51 Revision 1.34 2001/04/23 10:20:18 hristov
52 Constant casted to avoid ambiguity
54 Revision 1.33 2001/04/20 08:16:47 kowal2
55 Protection against too small betaGamma. Thanks to Ivana and Yves.
57 Revision 1.32 2001/03/13 13:07:34 kowal2
58 Corrected bug in the TPC mother volume geometry.
61 Revision 1.31 2000/11/30 11:48:50 kowal2
62 TLorentzVector.h adde to satisfy the latest changes by Federico
64 Revision 1.30 2000/11/14 10:48:57 kowal2
65 Correct material used for TSA4. Thanks to J. Barbosa.
67 Revision 1.29 2000/11/06 17:24:10 kowal2
68 Corrected bug in the outer containment vessel and
69 the outer field cage geometry.
72 Revision 1.28 2000/11/02 16:55:24 kowal2
73 Corrected bug in the inner containment vessel geometry.
76 Revision 1.27 2000/11/02 07:24:11 kowal2
77 Correction in the TPC geometry.
78 Changes due to the new hit structure.
80 Revision 1.26 2000/10/05 16:16:29 kowal2
81 Corrections of the hit recording algorithm.
83 Revision 1.25 2000/10/02 21:28:18 fca
84 Removal of useless dependecies via forward declarations
86 Revision 1.24 2000/08/28 10:02:30 kowal2
87 Corrected bug in the StepManager
89 Revision 1.23 2000/07/10 20:57:39 hristov
90 Update of TPC code and macros by M.Kowalski
92 Revision 1.22 2000/06/30 12:07:50 kowal2
93 Updated from the TPC-PreRelease branch
95 Revision 1.21.2.4 2000/06/26 07:39:42 kowal2
96 Changes to obey the coding rules
98 Revision 1.21.2.3 2000/06/25 08:38:41 kowal2
99 Splitted from AliTPCtracking
101 Revision 1.21.2.2 2000/06/16 12:58:13 kowal2
102 Changed parameter settings
104 Revision 1.21.2.1 2000/06/09 07:15:07 kowal2
106 Defaults loaded automatically (hard-wired)
107 Optional parameters can be set via macro called in the constructor
109 Revision 1.21 2000/05/15 10:00:30 kowal2
110 Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
112 Revision 1.20 2000/04/17 09:37:33 kowal2
113 removed obsolete AliTPCDigitsDisplay.C
115 Revision 1.19.8.2 2000/04/10 08:31:52 kowal2
117 Different geometry for different sectors
118 Updated readout chambers
119 Some modifications to StepManager by J.Belikov
121 Revision 1.19.8.1 2000/04/10 07:56:53 kowal2
122 Not used anymore - removed
124 Revision 1.19 1999/11/04 17:28:07 fca
125 Correct barrel part of HV Degrader
127 Revision 1.18 1999/10/14 16:52:08 fca
128 Only use PDG codes and not GEANT ones
130 Revision 1.17 1999/10/08 06:27:23 fca
131 Corrected bug in the HV degrader geometry, thanks to G.Tabary
133 Revision 1.16 1999/10/04 13:39:54 fca
134 Correct array index problem
136 Revision 1.15 1999/09/29 09:24:34 fca
137 Introduction of the Copyright and cvs Log
142 ///////////////////////////////////////////////////////////////////////////////
144 // Time Projection Chamber version 2 -- detailed TPC and slow simulation //
148 <img src="picts/AliTPCv2Class.gif">
153 ///////////////////////////////////////////////////////////////////////////////
158 #include <TPDGCode.h>
160 #include "AliConst.h"
162 #include "AliTPCDigitsArray.h"
163 #include "AliTPCParam.h"
164 #include "AliTPCParamSR.h"
165 #include "AliTPCTrackHitsV2.h"
166 #include "AliTPCv2.h"
167 #include "TLorentzVector.h"
171 //_____________________________________________________________________________
172 AliTPCv2::AliTPCv2(const char *name, const char *title) :
176 // Standard constructor for Time Projection Chamber version 2
182 SetBufferSize(128000);
184 SetGasMixt(2,20,10,-1,0.9,0.1,0.); // Ne-CO2 90-10
190 SetSecLows(1, 2, 3, 19, 20, 21);
191 SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
192 SetSens(1); // sensitive strips set
195 fTPCParam->Write(fTPCParam->GetTitle());
198 //_____________________________________________________________________________
199 void AliTPCv2::CreateGeometry()
202 // Create the geometry of Time Projection Chamber version 2
206 <img src="picts/AliTPC.gif">
211 <img src="picts/AliTPCv2Tree.gif">
216 Int_t *idtmed = fIdtmed->GetArray();
227 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
228 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
230 // ---------------------------------------------------
231 // sector specification check
232 // ---------------------------------------------------
236 for (i = 0; i < 6; ++i) {
237 if (fSecLows[i] >= 0 && fSecLows[i] < 2*nInnerSector) {
239 printf("%s: *** SECTOR %d selected\n",ClassName(),fSecLows[i]);
244 printf("%s: *** ALL LOWER SECTORS SELECTED ***\n",ClassName());
249 printf("%s: *** ERROR: AT LEAST ONE LOWER SECTOR MUST BE SPECIFIED ***\n",ClassName());
250 printf("%s: !!! PROGRAM STOPPED !!!\n",ClassName());
256 for (i = 0; i < 12; ++i) {
257 if (fSecUps[i] > 2*nInnerSector-1 &&
258 fSecUps[i] < 2*(nInnerSector+nOuterSector)) {
259 printf("%s: *** SECTOR %d selected\n",ClassName(),fSecUps[i]);
264 printf("%s: *** ALL UPPER SECTORS SELECTED ***\n",ClassName());
269 //--------------------------------------------------------------------
272 // Mother volume TPC (Air) - all volumes will be positioned in it
327 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
331 //-------------------------------------------------------------------
332 // Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
333 //-------------------------------------------------------------------
375 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
377 //----------------------------------------------------------------
378 // Tpc Outer Contaiment Vessel
379 // mother volume - Al, daughters - composite (sandwich)
380 //----------------------------------------------------------------
422 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
424 // Daughter volumes - sandwich
426 // Tpc SAndwich 1 - Al
432 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
434 // Tpc SAndwich 2 - epoxy glue (I use Lexan)
439 gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
441 // Tpc SAndwich 3 - Tedlar
446 gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
449 // Tpc SAndwich 4 - fiber glass (G10)
454 gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);
456 // Tpc SAndwich 5 - NOMEX honeycomb
461 gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
463 // 5->4->3->2->1->TCOV
466 gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
467 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
468 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
469 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
471 gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
475 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
477 //-------------------------------------------------------
478 // Tpc Outer Field Cage
479 // mother volume - Al, daughters - composite (sandwich)
480 //-------------------------------------------------------
522 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
526 // Tpc SAndwich 6 - Tedlar
532 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
534 // Tpc SAndwich 7 - fiber glass
539 gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
542 // Tpc SAndwich 8 - NOMEX
547 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
551 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
552 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
553 gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
557 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
561 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
565 //--------------------------------------------------------------------
566 // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
567 // Inner containment vessel will be placed directly in the TPC
568 //--------------------------------------------------------------------
598 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
600 // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
606 gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
608 gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
610 //-----------------------------------------------------
611 // Tpc Inner Field Cage
612 // mother volume - Al, daughters - composite (sandwich)
613 //------------------------------------------------------
679 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
681 // daughter volumes - central part
683 // Tpc Sandwich 9 -Tedlar
689 gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3);
691 // Tpc Sandwich 10 - fiber glass (G10)
696 gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
698 // Tpc Sandwich 11 - NOMEX
703 gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
707 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
708 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
710 gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
712 // daughter volumes - outer parts (reinforced)
714 // Tpc Sandwich 12 -Tedlar
720 gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
722 // Tpc Sandwich 13 - fiber glass (G10)
727 gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
729 // Tpc Sandwich 14 - NOMEX
734 gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
738 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
739 gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY");
741 gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
742 gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY");
744 // place this inside the inner insulator
746 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
748 // and now in the TPC...
750 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
752 //---------------------------------------------------------
753 // Tpc Inner Containment vessel - Cones
754 //---------------------------------------------------------
808 gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
810 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
821 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
823 gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
824 gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
827 //---------------------------------------------------------
828 // Tpc Inner Containment vessel - Middle part -Al
829 //---------------------------------------------------------
871 gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
873 // Tpc Sandwich 15 - Al
879 gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
881 // Tpc Sandwich 16 - epoxy glue
886 gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
888 // Tpc Sandwich 17 - Tedlar
893 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
895 // Tpc Sandwich 18 - carbon fiber
900 gMC->Gsvolu("TS18","TUBE",idtmed[15],dm,3);
902 // Tpc Sandwich 19 - Nomex
907 gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3);
909 // 19->18->17->16->15-> TICM
911 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
912 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
913 gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
914 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
916 gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
919 // TPc inner cont. vessel Joints
925 gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
927 gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
928 gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
960 gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
962 gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
963 gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
967 // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
973 gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
975 gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
976 gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY");
980 gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
984 nRotMat++; // prepare for the next rotation matrix
986 //---------------------------------------------------------
987 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
988 // and its daughters (HV membrane, rods, readout chambers)
989 //---------------------------------------------------------
995 gMC->Gsvolu("TDGN","TUBE",idtmed[1],dm,3);
997 // sector opening angles
999 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
1000 Float_t outerOpenAngle = fTPCParam->GetOuterAngle();
1002 // sector angle shift
1004 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
1007 // All above parameters are identical for inner and outer
1008 // sectors. The distinction is kept for the historical reasons
1009 // and eventually will disappear.
1011 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
1012 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
1015 //-------------------------------------------------------------------------
1016 // Tpc Inner Readout Chambers
1017 //-------------------------------------------------------------------------
1021 dm[2]= 1.6; // thickness
1024 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
1026 // this volume will be positioned in the empty space
1027 // of the end-cap to avoid overlaps
1034 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
1037 //------------------------------------------------
1038 // Tpc Inner readout chamber Pad Plane
1039 //------------------------------------------------
1046 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
1050 dm[0] -= 1.218511934;
1051 dm[1] -= 1.218511934;
1054 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
1056 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
1058 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
1061 //----------------------------------------------
1062 // Tpc Readout Chambers Empty spaces - for both
1063 // inner and outer sectors
1064 //----------------------------------------------
1066 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
1068 // Inner sector - 4 spaces
1079 space = rr*tanAlpha-dm[0];
1081 for(Int_t nsLow=0;nsLow<4;nsLow++){
1084 dm[1]= rr*tanAlpha - space;
1088 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1094 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1097 dm[0] = rr*tanAlpha - space;
1103 // dm[1] - this is the dm[1] from the previous TRCE
1107 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
1110 // TPc Space for Connectors
1117 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1125 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1127 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1135 // inner part of the inner sector - 2 x 20 holes
1137 astep = 20.00096874/19.;
1139 alpha = 10.00048437-astep;
1151 for(ncon=0;ncon<20;ncon++){
1157 phi3 = (alpha>0) ? 0. : 180.;
1158 theta3 = TMath::Abs(alpha);
1160 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1164 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1165 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1176 // outer part of the inner sector - 2 x 25 holes
1178 astep = 20.00096874/24.;
1179 alpha = 10.00048437-astep;
1187 for(ncon=0;ncon<25;ncon++){
1193 phi3 = (alpha>0) ? 0. : 180.;
1194 theta3 = TMath::Abs(alpha);
1196 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1200 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1201 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1212 //--------------------------------------------------------------------------
1213 // TPC Outer Readout Chambers
1214 // this is NOT a final design
1215 //--------------------------------------------------------------------------
1219 dm[2]= 1.5; //thickness
1222 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1224 //------------------------------------------------
1225 // Tpc Outer readout chamber Pad Plane
1226 //------------------------------------------------
1230 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1232 dm[0] -= 1.218511934;
1233 dm[1] -= 1.218511934;
1236 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1238 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1240 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1249 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1256 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1263 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1265 //-----------------------------------------------
1266 // Tpc Services Support Wheel
1267 //-----------------------------------------------
1282 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1284 // Tpc Services Wheel Cover
1289 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1291 // Tpc Service wheel Cover Empty space
1298 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1300 // Tpc services Wheel Empty Spaces
1307 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1309 // Tpc Services Wheel Bars
1311 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1321 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1326 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1328 // TPc ELectronics - right now 30% X0 Si
1335 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1336 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1338 //--------------------------------------------------------------------------
1340 //--------------------------------------------------------------------------
1342 // TPc Main Wheel - Al
1348 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1350 //--------------------------------------------------------------------------
1351 // Tpc Empty Space for the Readout chambers
1352 //--------------------------------------------------------------------------
1356 Float_t dR = 0.5*(rUp-rLow);
1358 space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1360 dm[0]= rLow*tanAlpha-space;
1361 dm[1]= rUp*tanAlpha-space;
1365 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1369 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1373 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1375 // Tpc Empty Space Bars - Al (daughters of TESR)
1379 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1383 dm[0]= rLow*tanAlpha-space;
1384 dm[1]= 88.7*tanAlpha-space;
1390 gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1394 dm[0]= 131.65*tanAlpha-space;
1395 dm[1]= 136.5*tanAlpha-space;
1398 zBar = -dR +131.65+dm[3]-rLow;
1400 gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1404 dm[0]= 240.4*tanAlpha-space;
1405 dm[1]= rUp*tanAlpha-space;
1410 gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1412 //------------------------------------------------------
1413 // TPc Lower "S" Sectors
1414 //------------------------------------------------------
1417 Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow();
1418 Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp();
1420 dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1421 dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1422 dm[2] = 0.5*(250. - 5.e-3);
1423 dm[3] = 0.5*(inSecUpEdge-inSecLowEdge);
1425 gMC->Gsvolu("TPLS", "TRD1", idtmed[2], dm, 4); // sensitive
1428 //----------------------------------------------------------
1429 // TPc Upper Sectors
1430 //----------------------------------------------------------
1432 Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow();
1433 Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp();
1435 dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1436 dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1437 dm[2] = 0.5*(250. - 5.e-3);
1438 dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge);
1440 gMC->Gsvolu("TPUS", "TRD1", idtmed[2], dm, 4); // sensitive
1446 gMC->Gsvolu("TPSS","TRD1",idtmed[2],dm,0); // sensitive
1448 Int_t nofStrips,nstr;
1450 Float_t stripThick = 0.01; // 100 microns
1456 // if all lower sectors selected define only 1 strip
1458 nofStrips=((fSecAL <0)||(fSecAL>=0 && fSens<0)) ? 1 : fTPCParam->GetNRowLow();
1459 deadSpace = fTPCParam->GetInnerWireMount();
1461 dm[2] = 0.5*(250. - 5.e-3);
1462 dm[3] = 0.5 * stripThick;
1464 for(nstr=0;nstr<nofStrips;nstr++){
1466 r1 = fTPCParam->GetPadRowRadiiLow(nstr);
1467 r2 = r1 + stripThick;
1468 dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1469 dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1470 zs = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge);
1474 gMC->Gsposp("TPSS", nstr+1, "TPLS", 0., 0., zs, 0, "ONLY", dm, 4);
1479 // strips only if several upper sectors selected end fSens > 0
1481 if(fSecAU >=0 && fSens >0){
1483 Int_t nsSave = nofStrips;
1487 nofStrips = fTPCParam->GetNRowUp();
1488 deadSpace = fTPCParam->GetOuterWireMount();
1490 dm[2] = 0.5*(250. - 5.e-3);
1491 dm[3] = 0.5 * stripThick;
1494 for(nstr=0;nstr<nofStrips;nstr++){
1496 r1 = fTPCParam->GetPadRowRadiiUp(nstr);
1497 r2 = r1 + stripThick;
1498 dm[0] = r1 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1499 dm[1] = r2 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1500 zs = -ouSecLowEdge -0.5*(ouSecUpEdge-ouSecLowEdge);
1504 gMC->Gsposp("TPSS", nstr+1+nsSave, "TPUS", 0., 0., zs, 0, "ONLY", dm, 4);
1510 //-------------------------------------------------------
1511 // positioning of the empty spaces into the main wheel
1512 // and readout chambers and sectors into the drift gas
1513 //-------------------------------------------------------
1515 Float_t rCenter,xc,yc;
1516 Float_t rInner,rOuter; // center of the inner and outer chamber
1524 for(Int_t ns=0; ns<nInnerSector;ns++){
1526 phi1 = ns * innerOpenAngle + innerAngleShift;
1527 phi1 *= kRaddeg; // in degrees
1529 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1531 if (phi1 > 360.) phi1 -= 360.;
1536 phi3 = ns * innerOpenAngle + innerAngleShift;
1537 phi3 *= kRaddeg; // in degrees
1539 phi3 = (Float_t)TMath::Nint(phi3);
1541 if(phi3 > 360.) phi3 -= 360.;
1545 // "holes"->End plate
1547 xc = rCenter*TMath::Cos(phi3*kDegrad);
1548 yc = rCenter*TMath::Sin(phi3*kDegrad);
1550 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1552 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1554 // TSCE->TSWC (services wheel volumes)
1556 xc = 166.142*TMath::Cos(phi3*kDegrad);
1557 yc = 166.142*TMath::Sin(phi3*kDegrad);
1559 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1560 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1563 // readout chambers->TDGN (drift gas)
1565 xc = rInner*TMath::Cos(phi3*kDegrad);
1566 yc = rInner*TMath::Sin(phi3*kDegrad);
1568 gMC->Gspos("TIRC",ns+1,"TDGN",xc,yc,252.,idrotm[nRotMat],"ONLY");
1570 // here lower sectors
1574 // all lower sectors are positioned
1576 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1578 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1582 // only selected sectors are positioned (up to 6 sectors)
1584 for(Int_t sel=0;sel<6;sel++){
1586 if(fSecLows[sel] == ns){
1587 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1589 else if(fSecLows[sel] == ns+nInnerSector){
1591 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1594 } // lower sectors finished
1597 xc = rOuter*TMath::Cos(phi3*kDegrad);
1598 yc = rOuter*TMath::Sin(phi3*kDegrad);
1600 gMC->Gspos("TORC",ns+1,"TDGN",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1602 // here upper sectors
1606 // all upper sectors
1608 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1610 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1614 // only selected sectors (up to 12)
1616 for(Int_t sel=0;sel<12;sel++){
1617 if(fSecUps[sel] == ns+2*nInnerSector){
1618 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1620 else if(fSecUps[sel] == ns+2*nInnerSector+nOuterSector){
1622 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1625 } // upper sectors finished
1630 theta2 = 0.; // reflection
1632 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1634 xc = rInner*TMath::Cos(phi3*kDegrad);
1635 yc = rInner*TMath::Sin(phi3*kDegrad);
1637 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGN",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1639 xc = rOuter*TMath::Cos(phi3*kDegrad);
1640 yc = rOuter*TMath::Sin(phi3*kDegrad);
1642 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGN",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1649 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1650 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1652 //---------------------------------------------------------
1653 // Tpc High Voltage Membrane - 100 microns of mylar
1654 //---------------------------------------------------------
1660 gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1662 gMC->Gspos("THVM",1,"TDGN",0.,0.,0.,0,"ONLY");
1664 // Tpc High Voltage membrane Holders
1666 gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1676 gMC->Gsposp("THVH",1,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1684 gMC->Gsposp("THVH",2,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1686 //----------------------------------------------------------
1687 // TPc Support Rods - MAKROLON
1688 //----------------------------------------------------------
1693 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1696 for(Int_t nrod=0;nrod<18;nrod++){
1697 Float_t angle=innerOpenAngle*(Float_t)nrod;
1699 xc=81.5*TMath::Cos(angle);
1700 yc=81.5*TMath::Sin(angle);
1704 gMC->Gsposp("TPSR",nrod+1,"TDGN",xc,yc,126.9,0,"ONLY",dm,3);
1705 gMC->Gsposp("TPSR",nrod+19,"TDGN",xc,yc,-126.9,0,"ONLY",dm,3);
1709 xc=254.25*TMath::Cos(angle);
1710 yc=254.25*TMath::Sin(angle);
1712 // rod number 54 contans the HV cable
1715 gMC->Gsposp("TPSR",nrod+37,"TDGN",xc,yc,127.,0,"ONLY",dm,3);
1716 gMC->Gsposp("TPSR",nrod+54,"TDGN",xc,yc,-127.,0,"ONLY",dm,3);
1721 //----------------------------------------------------------
1722 // Tpc High Voltage Rod - MAKROLON + Copper cable
1723 //----------------------------------------------------------
1725 // rod with cable (Left)
1731 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1739 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1747 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1749 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1750 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1752 // rod without cable
1758 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1760 gMC->Gspos("THVL",1,"TDGN",xc,yc,-127.,0,"ONLY");
1761 gMC->Gspos("THVR",1,"TDGN",xc,yc,127.,0,"ONLY");
1763 gMC->Gspos("TDGN",1,"TPC ",0.,0.,0.,0,"ONLY");
1765 // services wheel cover -> wheel
1768 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1769 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1772 // put the wheel into the TPC
1774 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1775 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1779 gMC->Gsord("TPMW",6);
1780 gMC->Gsord("TSSW",6);
1781 gMC->Gsord("TSWC",6);
1782 if(fSecAL >=0) gMC->Gsord("TPLS",3);
1783 if(fSecAU >=0 && fSens >0) gMC->Gsord("TPUS",3);
1784 gMC->Gsord("TDGN",6);
1786 // put the TPC into ALIC (main mother volume)
1788 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1792 } // end of function
1794 //_____________________________________________________________________________
1795 void AliTPCv2::DrawDetector()
1798 // Draw a shaded view of the Time Projection Chamber version 1
1801 // Set everything unseen
1802 gMC->Gsatt("*", "seen", -1);
1804 // Set ALIC mother transparent
1805 gMC->Gsatt("ALIC","SEEN",0);
1807 // Set the volumes visible
1810 gMC->Gsatt("TPC ","SEEN",0);
1811 gMC->Gsatt("TOIN","SEEN",1);
1812 gMC->Gsatt("TOIN","COLO",7);
1813 gMC->Gsatt("TOCV","SEEN",1);
1814 gMC->Gsatt("TOCV","COLO",4);
1815 gMC->Gsatt("TSA1","SEEN",0);
1816 gMC->Gsatt("TSA2","SEEN",0);
1817 gMC->Gsatt("TSA3","SEEN",0);
1818 gMC->Gsatt("TSA4","SEEN",0);
1819 gMC->Gsatt("TSA5","SEEN",0);
1820 gMC->Gsatt("TOFC","SEEN",1);
1821 gMC->Gsatt("TOFC","COLO",4);
1822 gMC->Gsatt("TSA6","SEEN",0);
1823 gMC->Gsatt("TSA7","SEEN",0);
1824 gMC->Gsatt("TSA8","SEEN",0);
1825 gMC->Gsatt("TIIN","SEEN",1);
1826 gMC->Gsatt("TIIN","COLO",7);
1827 gMC->Gsatt("TII1","SEEN",0);
1828 gMC->Gsatt("TIFC","SEEN",1);
1829 gMC->Gsatt("TIFC","COLO",4);
1830 gMC->Gsatt("TSA9","SEEN",0);
1831 gMC->Gsatt("TS10","SEEN",0);
1832 gMC->Gsatt("TS11","SEEN",0);
1833 gMC->Gsatt("TS12","SEEN",0);
1834 gMC->Gsatt("TS13","SEEN",0);
1835 gMC->Gsatt("TS14","SEEN",0);
1836 gMC->Gsatt("TICC","SEEN",0);
1837 gMC->Gsatt("TICM","SEEN",0);
1838 gMC->Gsatt("TS15","SEEN",0);
1839 gMC->Gsatt("TS16","SEEN",0);
1840 gMC->Gsatt("TS17","SEEN",0);
1841 gMC->Gsatt("TS18","SEEN",0);
1842 gMC->Gsatt("TS19","SEEN",0);
1843 gMC->Gsatt("TPJ1","SEEN",0);
1844 gMC->Gsatt("TPJ2","SEEN",0);
1845 gMC->Gsatt("TICS","SEEN",0);
1846 gMC->Gsatt("TDGN","SEEN",0);
1847 gMC->Gsatt("TIRC","SEEN",0);
1848 gMC->Gsatt("TIC1","SEEN",1);
1849 gMC->Gsatt("TIPP","SEEN",0);
1850 gMC->Gsatt("TIC3","SEEN",0);
1851 gMC->Gsatt("TRCE","SEEN",0);
1852 gMC->Gsatt("TPSC","SEEN",0);
1853 gMC->Gsatt("TPCC","SEEN",0);
1854 gMC->Gsatt("TORC","SEEN",0);
1855 gMC->Gsatt("TOPP","SEEN",0);
1856 gMC->Gsatt("TOC3","SEEN",0);
1857 gMC->Gsatt("TOC1","SEEN",1);
1858 gMC->Gsatt("TSSW","SEEN",1);
1859 gMC->Gsatt("TSWC","SEEN",1);
1860 gMC->Gsatt("TSSW","COLO",3);
1861 gMC->Gsatt("TSWC","COLO",3);
1862 gMC->Gsatt("TSCE","COLO",6);
1863 gMC->Gsatt("TSCE","SEEN",1);
1864 gMC->Gsatt("TWES","SEEN",0);
1865 gMC->Gsatt("TSWB","SEEN",0);
1866 gMC->Gsatt("TPEL","SEEN",0);
1867 gMC->Gsatt("TPMW","SEEN",1);
1868 gMC->Gsatt("TESR","SEEN",1);
1869 gMC->Gsatt("TPMW","COLO",12);
1870 gMC->Gsatt("TIC1","COLO",5);
1871 gMC->Gsatt("TOC1","COLO",5);
1872 gMC->Gsatt("TESB","SEEN",0);
1873 gMC->Gsatt("THVM","SEEN",1);
1874 gMC->Gsatt("THVM","COLO",11);
1875 gMC->Gsatt("THVH","SEEN",0);
1876 gMC->Gsatt("TPSR","SEEN",0);
1877 gMC->Gsatt("THVL","SEEN",0);
1878 gMC->Gsatt("THVC","SEEN",0);
1879 gMC->Gsatt("THVE","SEEN",0);
1880 gMC->Gsatt("THVR","SEEN",0);
1881 gMC->Gsatt("TPSS","SEEN",0);
1882 gMC->Gsatt("TPUS","SEEN",0);
1883 gMC->Gsatt("TPLS","SEEN",0);
1886 gMC->Gdopt("hide", "on");
1887 gMC->Gdopt("shad", "on");
1888 gMC->Gsatt("*", "fill", 7);
1889 gMC->SetClipBox(".");
1890 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1891 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1892 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1893 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1894 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1895 gMC->DefaultRange();
1896 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1897 gMC->Gdhead(1111, "Time Projection Chamber");
1898 gMC->Gdman(18, 4, "MAN");
1899 gMC->Gdopt("hide","off");
1902 //_____________________________________________________________________________
1903 void AliTPCv2::CreateMaterials()
1906 // Define materials for version 2 of the Time Projection Chamber
1909 AliTPC::CreateMaterials();
1912 //_____________________________________________________________________________
1913 void AliTPCv2::Init()
1916 // Initialises version 2 of the TPC after that it has been built
1919 Int_t *idtmed = fIdtmed->GetArray();
1925 fIdSens=gMC->VolId("TPSS");
1927 fIdLSec=gMC->VolId("TPLS"); // lower sector
1928 fIdUSec=gMC->VolId("TPUS"); // upper sector
1930 gMC->SetMaxNStep(30000); // max. number of steps increased
1932 gMC->Gstpar(idtmed[2],"LOSS",5); // specific energy loss
1934 printf("%s: *** TPC version 2 initialized ***\n",ClassName());
1935 printf("%s: Maximum number of steps = %d\n",ClassName(),gMC->GetMaxNStep());
1941 //_____________________________________________________________________________
1942 void AliTPCv2::StepManager()
1945 // Called for every step in the Time Projection Chamber
1949 // parameters used for the energy loss calculations
1951 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1952 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1953 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1956 const Float_t kbig = 1.e10;
1963 vol[1]=0; // preset row number to 0
1967 gMC->SetMaxStep(kbig);
1969 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1971 Float_t charge = gMC->TrackCharge();
1973 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1975 // check the sensitive volume
1977 id = gMC->CurrentVolID(copy); // current volume Id
1979 if (gMC->IsTrackEntering() && ( (id == fIdLSec) || (id == fIdUSec))){
1980 // printf("track %d entering volume %d\n",gAlice->CurrentTrack(),id);
1983 gMC->TrackMomentum(p);
1984 gMC->TrackPosition(x);
1985 AddTrackReference(gAlice->CurrentTrack(),p,x,gMC->TrackLength());
1988 if (gMC->IsTrackExiting() && ( (id == fIdLSec) || (id == fIdUSec))){
1989 // printf("track %d exiting volume %d\n",gAlice->CurrentTrack(),id);
1992 gMC->TrackMomentum(p);
1993 gMC->TrackPosition(x);
1994 AddTrackReference(gAlice->CurrentTrack(),p,x,gMC->TrackLength());
1999 vol[0] = copy-1; // lower sector number
2001 else if(id == fIdUSec){
2002 vol[0] = copy+fTPCParam->GetNInnerSector()-1; // upper sector number
2004 else if(id == fIdSens && gMC->IsTrackEntering()){
2006 // track is entering the sensitive strip
2008 vol[1]= copy-1; // row number (absolute)
2012 id = gMC->CurrentVolOffID(1,copy);
2018 vol[0] = copy-1; // sector number
2025 vol[0] = copy-1+fTPCParam->GetNInnerSector(); // sector number
2026 vol[1] -= fTPCParam->GetNRowLow(); // row number (starts also from 0)
2032 // because Jouri wants to have this
2034 gMC->TrackMomentum(p);
2038 hits[3]=0.; // this hit has no energy loss
2039 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2041 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
2045 gMC->TrackPosition(p);
2049 hits[3]=0.; // this hit has no energy loss
2050 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2052 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
2057 //-----------------------------------------------------------------
2058 // charged particle is in the sensitive volume
2059 //-----------------------------------------------------------------
2061 if(gMC->TrackStep() > 0) {
2063 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
2064 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
2066 gMC->TrackPosition(p);
2070 hits[3]=(Float_t)nel;
2074 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
2076 gMC->TrackMomentum(p);
2077 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
2078 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
2079 fTrackHits->SetHitPrecision(precision);
2081 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
2085 // Stemax calculation for the next step
2089 gMC->TrackMomentum(mom);
2090 Float_t ptot=mom.Rho();
2091 Float_t betaGamma = ptot/gMC->TrackMass();
2093 Int_t pid=gMC->TrackPid();
2094 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
2096 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
2101 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
2102 pp=kprim*BetheBloch(betaGamma);
2104 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
2107 Double_t rnd = gMC->GetRandom()->Rndm();
2109 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
2113 //_____________________________________________________________________________
2114 Float_t AliTPCv2::BetheBloch(Float_t bg)
2117 // Bethe-Bloch energy loss formula
2119 const Double_t kp1=0.76176e-1;
2120 const Double_t kp2=10.632;
2121 const Double_t kp3=0.13279e-4;
2122 const Double_t kp4=1.8631;
2123 const Double_t kp5=1.9479;
2125 Double_t dbg = (Double_t) bg;
2127 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
2129 Double_t aa = TMath::Power(beta,kp4);
2130 Double_t bb = TMath::Power(1./dbg,kp5);
2132 bb=TMath::Log(kp3+bb);
2134 return ((Float_t)((kp2-aa-bb)*kp1/aa));