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.26 2001/04/27 15:23:07 kowal2
19 Correct materian in the central part of the inner containment vessel
21 Revision 1.25 2001/04/26 06:15:12 kowal2
22 Corrected bug in the inner containment vessel (cones)
24 Revision 1.24 2001/04/24 11:22:01 kowal2
25 Protection against too small betagamma
27 Revision 1.23 2001/04/24 11:17:33 kowal2
30 Revision 1.22 2001/03/13 13:07:34 kowal2
31 Corrected bug in the TPC mother volume geometry.
34 Revision 1.21 2000/11/30 11:48:50 kowal2
35 TLorentzVector.h adde to satisfy the latest changes by Federico
37 Revision 1.20 2000/11/14 10:48:57 kowal2
38 Correct material used for TSA4. Thanks to J. Barbosa.
40 Revision 1.19 2000/11/06 17:24:10 kowal2
41 Corrected bug in the outer containment vessel and
42 the outer field cage geometry.
45 Revision 1.18 2000/11/02 16:55:24 kowal2
46 Corrected bug in the inner containment vessel geometry.
49 Revision 1.17 2000/11/02 07:24:11 kowal2
50 Correction in the TPC geometry.
51 Changes due to the new hit structure.
53 Revision 1.16 2000/10/02 21:28:18 fca
54 Removal of useless dependecies via forward declarations
56 Revision 1.15 2000/07/10 20:57:39 hristov
57 Update of TPC code and macros by M.Kowalski
59 Revision 1.14 2000/06/30 12:07:50 kowal2
60 Updated from the TPC-PreRelease branch
62 Revision 1.13.2.4 2000/06/26 07:39:42 kowal2
63 Changes to obey the coding rules
65 Revision 1.13.2.3 2000/06/25 08:38:41 kowal2
66 Splitted from AliTPCtracking
68 Revision 1.13.2.2 2000/06/16 12:58:13 kowal2
69 Changed parameter settings
71 Revision 1.13.2.1 2000/06/09 07:15:07 kowal2
73 Defaults loaded automatically (hard-wired)
74 Optional parameters can be set via macro called in the constructor
76 Revision 1.13 2000/05/15 10:00:30 kowal2
77 Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
79 Revision 1.12 2000/04/17 09:37:33 kowal2
80 removed obsolete AliTPCDigitsDisplay.C
82 Revision 1.11.8.2 2000/04/10 08:36:12 kowal2
84 Updated readout chambers
85 Some modifications to StepManager by M. Kowalski
87 Revision 1.11.8.1 2000/04/10 07:56:53 kowal2
88 Not used anymore - removed
90 Revision 1.11 1999/11/04 17:28:07 fca
91 Correct barrel part of HV Degrader
93 Revision 1.10 1999/10/14 16:52:08 fca
94 Only use PDG codes and not GEANT ones
96 Revision 1.9 1999/10/08 06:27:23 fca
97 Corrected bug in the HV degrader geometry, thanks to G.Tabary
99 Revision 1.8 1999/10/04 13:39:55 fca
100 Correct array index problem
102 Revision 1.7 1999/09/29 09:24:34 fca
103 Introduction of the Copyright and cvs Log
108 ///////////////////////////////////////////////////////////////////////////////
110 // Time Projection Chamber version 3 -- detailed TPC and slow simulation //
114 <img src="picts/AliTPCv3Class.gif">
119 ///////////////////////////////////////////////////////////////////////////////
123 #include "AliTPCv3.h"
126 #include "AliConst.h"
127 #include "AliTPCDigitsArray.h"
128 #include"AliTPCParam.h"
129 #include"AliTPCParamSR.h"
131 #include <TInterpreter.h>
132 #include "TLorentzVector.h"
133 #include "AliTPCTrackHits.h"
136 //_____________________________________________________________________________
138 AliTPCv3::AliTPCv3(){
144 //_____________________________________________________________________________
145 AliTPCv3::AliTPCv3(const char *name, const char *title) :
149 // Standard constructor for Time Projection Chamber version 3
152 SetBufferSize(128000);
155 SetGasMixt(2,20,10,-1,0.9,0.1,0.);
158 fTPCParam->Write(fTPCParam->GetTitle());
163 //_____________________________________________________________________________
164 void AliTPCv3::CreateGeometry()
167 // Creation of the TPC coarse geometry (version 3)
168 // The whole drift volume is sensitive
169 // Origin Marek Kowalski Cracow
173 <img src="picts/AliTPCgif">
178 <img src="picts/AliTPCv3Tree.gif">
183 Int_t *idtmed = fIdtmed->GetArray(); // TPC media
185 Int_t idrotm[120]; // rotation matrices
187 Int_t nRotMat = 0; // actual number of rotation matrices
191 // Mother volume (Air) - all volumes will be positioned in it
246 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
250 //-------------------------------------------------------------------
251 // Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
252 //-------------------------------------------------------------------
294 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
296 //----------------------------------------------------------------
297 // Tpc Outer Contaiment Vessel
298 // mother volume - Al, daughters - composite (sandwich)
299 //----------------------------------------------------------------
341 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
343 // Daughter volumes - sandwich
345 // Tpc SAndwich 1 - Al
351 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
353 // Tpc SAndwich 2 - epoxy glue (I use Lexan)
358 gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
360 // Tpc SAndwich 3 - Tedlar
365 gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
368 // Tpc SAndwich 4 - fiber glass (G10)
373 gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);
375 // Tpc SAndwich 5 - NOMEX honeycomb
380 gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
382 // 5->4->3->2->1->TCOV
385 gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
386 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
387 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
388 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
390 gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
394 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
396 //-------------------------------------------------------
397 // Tpc Outer Field Cage
398 // mother volume - Al, daughters - composite (sandwich)
399 //-------------------------------------------------------
441 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
445 // Tpc SAndwich 6 - Tedlar
451 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
453 // Tpc SAndwich 7 - fiber glass
458 gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
461 // Tpc SAndwich 8 - NOMEX
466 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
470 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
471 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
472 gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
476 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
480 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
484 //--------------------------------------------------------------------
485 // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
486 // Inner containment vessel will be placed directly in the TPC
487 //--------------------------------------------------------------------
517 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
519 // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
525 gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
527 gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
529 //-----------------------------------------------------
530 // Tpc Inner Field Cage
531 // mother volume - Al, daughters - composite (sandwich)
532 //------------------------------------------------------
598 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
600 // daughter volumes - central part
602 // Tpc Sandwich 9 -Tedlar
608 gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3);
610 // Tpc Sandwich 10 - fiber glass (G10)
615 gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
617 // Tpc Sandwich 11 - NOMEX
622 gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
626 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
627 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
629 gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
631 // daughter volumes - outer parts (reinforced)
633 // Tpc Sandwich 12 -Tedlar
639 gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
641 // Tpc Sandwich 13 - fiber glass (G10)
646 gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
648 // Tpc Sandwich 14 - NOMEX
653 gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
657 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
658 gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY");
660 gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
661 gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY");
663 // place this inside the inner insulator
665 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
667 // and now in the TPC...
669 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
671 //---------------------------------------------------------
672 // Tpc Inner Containment vessel - Cones
673 //---------------------------------------------------------
727 gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
729 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
740 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
742 gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
743 gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
746 //---------------------------------------------------------
747 // Tpc Inner Containment vessel - Middle part -Al
748 //---------------------------------------------------------
790 gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
792 // Tpc Sandwich 15 - Al
798 gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
800 // Tpc Sandwich 16 - epoxy glue
805 gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
807 // Tpc Sandwich 17 - Tedlar
812 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
814 // Tpc Sandwich 18 - carbon fiber
819 gMC->Gsvolu("TS18","TUBE",idtmed[15],dm,3);
821 // Tpc Sandwich 19 - Nomex
826 gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3);
828 // 19->18->17->16->15-> TICM
830 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
831 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
832 gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
833 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
835 gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
838 // TPc inner cont. vessel Joints
844 gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
846 gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
847 gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
879 gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
881 gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
882 gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
886 // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
892 gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
894 gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
895 gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY");
899 gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
903 nRotMat++; // prepare for the next rotation matrix
905 //---------------------------------------------------------
906 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
907 // and its daughters (HV membrane, rods, readout chambers)
908 //---------------------------------------------------------
914 gMC->Gsvolu("TDGS","TUBE",idtmed[2],dm,3);
916 // sector opening angles
918 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
920 // sector angle shift
922 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
926 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
927 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
929 // All above parameters are identical for inner and outer
930 // sectors. The distinction is kept for the historical reasons
931 // and eventually will disappear.
933 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
934 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
937 //-------------------------------------------------------------------------
938 // Tpc Inner Readout Chambers
939 //-------------------------------------------------------------------------
943 dm[2]= 1.6; // thickness
946 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
948 // this volume will be positioned in the empty space
949 // of the end-cap to avoid overlaps
956 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
959 //------------------------------------------------
960 // Tpc Inner readout chamber Pad Plane
961 //------------------------------------------------
968 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
972 dm[0] -= 1.218511934;
973 dm[1] -= 1.218511934;
976 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
978 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
980 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
983 //----------------------------------------------
984 // Tpc Readout Chambers Empty spaces - for both
985 // inner and outer sectors
986 //----------------------------------------------
988 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
990 // Inner sector - 4 spaces
1001 space = rr*tanAlpha-dm[0];
1003 for(Int_t nsLow=0;nsLow<4;nsLow++){
1006 dm[1]= rr*tanAlpha - space;
1010 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1016 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1019 dm[0] = rr*tanAlpha - space;
1025 // dm[1] - this is the dm[1] from the previous TRCE
1029 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
1032 // TPc Space for Connectors
1039 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1047 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1049 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1057 // inner part of the inner sector - 2 x 20 holes
1059 astep = 20.00096874/19.;
1061 alpha = 10.00048437-astep;
1073 for(ncon=0;ncon<20;ncon++){
1079 phi3 = (alpha>0) ? 0. : 180.;
1080 theta3 = TMath::Abs(alpha);
1082 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1086 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1087 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1098 // outer part of the inner sector - 2 x 25 holes
1100 astep = 20.00096874/24.;
1101 alpha = 10.00048437-astep;
1109 for(ncon=0;ncon<25;ncon++){
1115 phi3 = (alpha>0) ? 0. : 180.;
1116 theta3 = TMath::Abs(alpha);
1118 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1122 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1123 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1134 //--------------------------------------------------------------------------
1135 // TPC Outer Readout Chambers
1136 // this is NOT a final design
1137 //--------------------------------------------------------------------------
1141 dm[2]= 1.5; //thickness
1144 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1146 //------------------------------------------------
1147 // Tpc Outer readout chamber Pad Plane
1148 //------------------------------------------------
1152 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1154 dm[0] -= 1.218511934;
1155 dm[1] -= 1.218511934;
1158 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1160 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1162 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1171 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1178 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1185 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1187 //-----------------------------------------------
1188 // Tpc Services Support Wheel
1189 //-----------------------------------------------
1204 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1206 // Tpc Services Wheel Cover
1211 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1213 // Tpc Service wheel Cover Empty space
1220 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1222 // Tpc services Wheel Empty Spaces
1229 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1231 // Tpc Services Wheel Bars
1233 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1243 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1248 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1250 // TPc ELectronics - right now 30% X0 Si
1257 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1258 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1260 //--------------------------------------------------------------------------
1262 //--------------------------------------------------------------------------
1264 // TPc Main Wheel - Al
1270 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1272 //--------------------------------------------------------------------------
1273 // Tpc Empty Space for the Readout chambers
1274 //--------------------------------------------------------------------------
1278 Float_t dR = 0.5*(rUp-rLow);
1280 space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1282 dm[0]= rLow*tanAlpha-space;
1283 dm[1]= rUp*tanAlpha-space;
1287 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1291 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1295 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1297 // Tpc Empty Space Bars - Al (daughters of TESR)
1301 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1305 dm[0]= rLow*tanAlpha-space;
1306 dm[1]= 88.7*tanAlpha-space;
1312 gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1316 dm[0]= 131.65*tanAlpha-space;
1317 dm[1]= 136.5*tanAlpha-space;
1320 zBar = -dR +131.65+dm[3]-rLow;
1322 gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1326 dm[0]= 240.4*tanAlpha-space;
1327 dm[1]= rUp*tanAlpha-space;
1332 gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1334 // positioning of the empty spaces into the main wheel
1336 Float_t rCenter,xc,yc;
1337 Float_t rInner,rOuter; // center of the inner and outer chamber
1345 for(Int_t ns=0; ns<nInnerSector;ns++){
1347 phi1 = ns * innerOpenAngle + innerAngleShift;
1348 phi1 *= kRaddeg; // in degrees
1350 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1352 if (phi1 > 360.) phi1 -= 360.;
1357 phi3 = ns * innerOpenAngle + innerAngleShift;
1358 phi3 *= kRaddeg; // in degrees
1360 phi3 = (Float_t)TMath::Nint(phi3);
1362 if(phi3 > 360.) phi3 -= 360.;
1366 // "holes"->End plate
1368 xc = rCenter*TMath::Cos(phi3*kDegrad);
1369 yc = rCenter*TMath::Sin(phi3*kDegrad);
1371 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1373 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1375 // TSCE->TSWC (services wheel volumes)
1377 xc = 166.142*TMath::Cos(phi3*kDegrad);
1378 yc = 166.142*TMath::Sin(phi3*kDegrad);
1380 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1381 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1384 // readout chambers->TDGS (drift gas)
1386 xc = rInner*TMath::Cos(phi3*kDegrad);
1387 yc = rInner*TMath::Sin(phi3*kDegrad);
1389 gMC->Gspos("TIRC",ns+1,"TDGS",xc,yc,252.,idrotm[nRotMat],"ONLY");
1391 xc = rOuter*TMath::Cos(phi3*kDegrad);
1392 yc = rOuter*TMath::Sin(phi3*kDegrad);
1394 gMC->Gspos("TORC",ns+1,"TDGS",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1398 theta2 = 0.; // reflection
1400 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1402 xc = rInner*TMath::Cos(phi3*kDegrad);
1403 yc = rInner*TMath::Sin(phi3*kDegrad);
1405 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGS",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1407 xc = rOuter*TMath::Cos(phi3*kDegrad);
1408 yc = rOuter*TMath::Sin(phi3*kDegrad);
1410 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGS",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1417 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1418 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1420 //---------------------------------------------------------
1421 // Tpc High Voltage Membrane - 100 microns of mylar
1422 //---------------------------------------------------------
1428 gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1430 gMC->Gspos("THVM",1,"TDGS",0.,0.,0.,0,"ONLY");
1432 // Tpc High Voltage membrane Holders
1434 gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1444 gMC->Gsposp("THVH",1,"TDGS",0.,0.,0.,0,"ONLY",dm,3);
1452 gMC->Gsposp("THVH",2,"TDGS",0.,0.,0.,0,"ONLY",dm,3);
1454 //----------------------------------------------------------
1455 // TPc Support Rods - MAKROLON
1456 //----------------------------------------------------------
1461 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1464 for(Int_t nrod=0;nrod<18;nrod++){
1465 Float_t angle=innerOpenAngle*(Float_t)nrod;
1467 xc=81.5*TMath::Cos(angle);
1468 yc=81.5*TMath::Sin(angle);
1472 gMC->Gsposp("TPSR",nrod+1,"TDGS",xc,yc,126.9,0,"ONLY",dm,3);
1473 gMC->Gsposp("TPSR",nrod+19,"TDGS",xc,yc,-126.9,0,"ONLY",dm,3);
1477 xc=254.25*TMath::Cos(angle);
1478 yc=254.25*TMath::Sin(angle);
1480 // rod number 54 contans the HV cable
1483 gMC->Gsposp("TPSR",nrod+37,"TDGS",xc,yc,127.,0,"ONLY",dm,3);
1484 gMC->Gsposp("TPSR",nrod+54,"TDGS",xc,yc,-127.,0,"ONLY",dm,3);
1489 //----------------------------------------------------------
1490 // Tpc High Voltage Rod - MAKROLON + Copper cable
1491 //----------------------------------------------------------
1493 // rod with cable (Left)
1499 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1507 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1515 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1517 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1518 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1520 // rod without cable
1526 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1528 gMC->Gspos("THVL",1,"TDGS",xc,yc,-127.,0,"ONLY");
1529 gMC->Gspos("THVR",1,"TDGS",xc,yc,127.,0,"ONLY");
1531 gMC->Gspos("TDGS",1,"TPC ",0.,0.,0.,0,"ONLY");
1533 // services wheel cover -> wheel
1536 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1537 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1540 // put the wheel into the TPC
1542 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1543 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1547 gMC->Gsord("TPMW",6);
1548 gMC->Gsord("TSSW",6);
1549 gMC->Gsord("TSWC",6);
1551 // put the TPC into ALIC (main mother volume)
1553 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1556 } // end of function
1558 //_____________________________________________________________________________
1559 void AliTPCv3::DrawDetector()
1562 // Draw a shaded view of the Time Projection Chamber version 3
1566 // Set everything unseen
1567 gMC->Gsatt("*", "seen", -1);
1569 // Set ALIC mother transparent
1570 gMC->Gsatt("ALIC","SEEN",0);
1572 // Set the volumes visible
1575 gMC->Gsatt("TPC ","SEEN",0);
1576 gMC->Gsatt("TOIN","SEEN",1);
1577 gMC->Gsatt("TOIN","COLO",7);
1578 gMC->Gsatt("TOCV","SEEN",1);
1579 gMC->Gsatt("TOCV","COLO",4);
1580 gMC->Gsatt("TSA1","SEEN",0);
1581 gMC->Gsatt("TSA2","SEEN",0);
1582 gMC->Gsatt("TSA3","SEEN",0);
1583 gMC->Gsatt("TSA4","SEEN",0);
1584 gMC->Gsatt("TSA5","SEEN",0);
1585 gMC->Gsatt("TOFC","SEEN",1);
1586 gMC->Gsatt("TOFC","COLO",4);
1587 gMC->Gsatt("TSA6","SEEN",0);
1588 gMC->Gsatt("TSA7","SEEN",0);
1589 gMC->Gsatt("TSA8","SEEN",0);
1590 gMC->Gsatt("TIIN","SEEN",1);
1591 gMC->Gsatt("TIIN","COLO",7);
1592 gMC->Gsatt("TII1","SEEN",0);
1593 gMC->Gsatt("TIFC","SEEN",1);
1594 gMC->Gsatt("TIFC","COLO",4);
1595 gMC->Gsatt("TSA9","SEEN",0);
1596 gMC->Gsatt("TS10","SEEN",0);
1597 gMC->Gsatt("TS11","SEEN",0);
1598 gMC->Gsatt("TS12","SEEN",0);
1599 gMC->Gsatt("TS13","SEEN",0);
1600 gMC->Gsatt("TS14","SEEN",0);
1601 gMC->Gsatt("TICC","SEEN",0);
1602 gMC->Gsatt("TICM","SEEN",0);
1603 gMC->Gsatt("TS15","SEEN",0);
1604 gMC->Gsatt("TS16","SEEN",0);
1605 gMC->Gsatt("TS17","SEEN",0);
1606 gMC->Gsatt("TS18","SEEN",0);
1607 gMC->Gsatt("TS19","SEEN",0);
1608 gMC->Gsatt("TPJ1","SEEN",0);
1609 gMC->Gsatt("TPJ2","SEEN",0);
1610 gMC->Gsatt("TICS","SEEN",0);
1611 gMC->Gsatt("TDGS","SEEN",0);
1612 gMC->Gsatt("TIRC","SEEN",0);
1613 gMC->Gsatt("TIC1","SEEN",1);
1614 gMC->Gsatt("TIPP","SEEN",0);
1615 gMC->Gsatt("TIC3","SEEN",0);
1616 gMC->Gsatt("TRCE","SEEN",0);
1617 gMC->Gsatt("TPSC","SEEN",0);
1618 gMC->Gsatt("TPCC","SEEN",0);
1619 gMC->Gsatt("TORC","SEEN",0);
1620 gMC->Gsatt("TOPP","SEEN",0);
1621 gMC->Gsatt("TOC3","SEEN",0);
1622 gMC->Gsatt("TOC1","SEEN",1);
1623 gMC->Gsatt("TSSW","SEEN",1);
1624 gMC->Gsatt("TSWC","SEEN",1);
1625 gMC->Gsatt("TSSW","COLO",3);
1626 gMC->Gsatt("TSWC","COLO",3);
1627 gMC->Gsatt("TSCE","COLO",6);
1628 gMC->Gsatt("TSCE","SEEN",1);
1629 gMC->Gsatt("TWES","SEEN",0);
1630 gMC->Gsatt("TSWB","SEEN",0);
1631 gMC->Gsatt("TPEL","SEEN",0);
1632 gMC->Gsatt("TPMW","SEEN",1);
1633 gMC->Gsatt("TESR","SEEN",1);
1634 gMC->Gsatt("TPMW","COLO",12);
1635 gMC->Gsatt("TIC1","COLO",5);
1636 gMC->Gsatt("TOC1","COLO",5);
1637 gMC->Gsatt("TESB","SEEN",0);
1638 gMC->Gsatt("THVM","SEEN",1);
1639 gMC->Gsatt("THVM","COLO",11);
1640 gMC->Gsatt("THVH","SEEN",0);
1641 gMC->Gsatt("TPSR","SEEN",0);
1642 gMC->Gsatt("THVL","SEEN",0);
1643 gMC->Gsatt("THVC","SEEN",0);
1644 gMC->Gsatt("THVE","SEEN",0);
1645 gMC->Gsatt("THVR","SEEN",0);
1648 gMC->Gdopt("hide", "on");
1649 gMC->Gdopt("shad", "on");
1650 gMC->Gsatt("*", "fill", 7);
1651 gMC->SetClipBox(".");
1652 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1653 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1654 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1655 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1656 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1657 gMC->DefaultRange();
1658 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1659 gMC->Gdhead(1111, "Time Projection Chamber");
1660 gMC->Gdman(18, 4, "MAN");
1661 gMC->Gdopt("hide","off");
1664 //_____________________________________________________________________________
1665 void AliTPCv3::CreateMaterials()
1668 // Define materials for version 2 of the Time Projection Chamber
1673 AliTPC::CreateMaterials();
1676 //_____________________________________________________________________________
1677 void AliTPCv3::Init()
1680 // Initialises version 3 of the TPC after that it has been built
1682 Int_t *idtmed = fIdtmed->GetArray();
1686 fIdSens=gMC->VolId("TDGS"); // drift gas as a sensitive volume
1688 gMC->SetMaxNStep(30000); // max. number of steps increased
1690 gMC->Gstpar(idtmed[2],"LOSS",5);
1692 printf("*** TPC version 3 initialized ***\n");
1693 printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
1699 //_____________________________________________________________________________
1700 void AliTPCv3::StepManager()
1703 // Called for every step in the Time Projection Chamber
1707 // parameters used for the energy loss calculations
1709 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1710 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1711 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1714 const Float_t kbig = 1.e10;
1726 gMC->SetMaxStep(kbig);
1728 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1730 Float_t charge = gMC->TrackCharge();
1732 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1735 id=gMC->CurrentVolID(copy);
1737 // Check the sensitive volume
1739 if (id != fIdSens) return;
1742 // charged particle is in the sensitive volume
1745 if(gMC->TrackStep() > 0) {
1748 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1749 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1751 gMC->TrackPosition(pos);
1757 // check the selected side of the TPC
1760 if(fSide && fSide*hits[2]<=0.) return;
1762 hits[3]=(Float_t)nel;
1766 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
1770 // Stemax calculation for the next step
1774 gMC->TrackMomentum(mom);
1775 Float_t ptot=mom.Rho();
1776 Float_t betaGamma = ptot/gMC->TrackMass();
1778 Int_t pid=gMC->TrackPid();
1779 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1781 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1785 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3);
1786 pp=kprim*BetheBloch(betaGamma);
1787 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1791 gMC->Rndm(random,1); // good, old GRNDM from Geant3
1793 Double_t rnd = (Double_t)random[0];
1795 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1799 //_____________________________________________________________________________
1800 Float_t AliTPCv3::BetheBloch(Float_t bg)
1803 // Bethe-Bloch energy loss formula
1805 const Double_t kp1=0.76176e-1;
1806 const Double_t kp2=10.632;
1807 const Double_t kp3=0.13279e-4;
1808 const Double_t kp4=1.8631;
1809 const Double_t kp5=1.9479;
1811 Double_t dbg = (Double_t) bg;
1813 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
1815 Double_t aa = TMath::Power(beta,kp4);
1816 Double_t bb = TMath::Power(1./dbg,kp5);
1818 bb=TMath::Log(kp3+bb);
1820 return ((Float_t)((kp2-aa-bb)*kp1/aa));