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.22 2001/03/13 13:07:34 kowal2
19 Corrected bug in the TPC mother volume geometry.
22 Revision 1.21 2000/11/30 11:48:50 kowal2
23 TLorentzVector.h adde to satisfy the latest changes by Federico
25 Revision 1.20 2000/11/14 10:48:57 kowal2
26 Correct material used for TSA4. Thanks to J. Barbosa.
28 Revision 1.19 2000/11/06 17:24:10 kowal2
29 Corrected bug in the outer containment vessel and
30 the outer field cage geometry.
33 Revision 1.18 2000/11/02 16:55:24 kowal2
34 Corrected bug in the inner containment vessel geometry.
37 Revision 1.17 2000/11/02 07:24:11 kowal2
38 Correction in the TPC geometry.
39 Changes due to the new hit structure.
41 Revision 1.16 2000/10/02 21:28:18 fca
42 Removal of useless dependecies via forward declarations
44 Revision 1.15 2000/07/10 20:57:39 hristov
45 Update of TPC code and macros by M.Kowalski
47 Revision 1.14 2000/06/30 12:07:50 kowal2
48 Updated from the TPC-PreRelease branch
50 Revision 1.13.2.4 2000/06/26 07:39:42 kowal2
51 Changes to obey the coding rules
53 Revision 1.13.2.3 2000/06/25 08:38:41 kowal2
54 Splitted from AliTPCtracking
56 Revision 1.13.2.2 2000/06/16 12:58:13 kowal2
57 Changed parameter settings
59 Revision 1.13.2.1 2000/06/09 07:15:07 kowal2
61 Defaults loaded automatically (hard-wired)
62 Optional parameters can be set via macro called in the constructor
64 Revision 1.13 2000/05/15 10:00:30 kowal2
65 Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
67 Revision 1.12 2000/04/17 09:37:33 kowal2
68 removed obsolete AliTPCDigitsDisplay.C
70 Revision 1.11.8.2 2000/04/10 08:36:12 kowal2
72 Updated readout chambers
73 Some modifications to StepManager by M. Kowalski
75 Revision 1.11.8.1 2000/04/10 07:56:53 kowal2
76 Not used anymore - removed
78 Revision 1.11 1999/11/04 17:28:07 fca
79 Correct barrel part of HV Degrader
81 Revision 1.10 1999/10/14 16:52:08 fca
82 Only use PDG codes and not GEANT ones
84 Revision 1.9 1999/10/08 06:27:23 fca
85 Corrected bug in the HV degrader geometry, thanks to G.Tabary
87 Revision 1.8 1999/10/04 13:39:55 fca
88 Correct array index problem
90 Revision 1.7 1999/09/29 09:24:34 fca
91 Introduction of the Copyright and cvs Log
96 ///////////////////////////////////////////////////////////////////////////////
98 // Time Projection Chamber version 3 -- detailed TPC and slow simulation //
102 <img src="picts/AliTPCv3Class.gif">
107 ///////////////////////////////////////////////////////////////////////////////
111 #include "AliTPCv3.h"
114 #include "AliConst.h"
115 #include "AliTPCDigitsArray.h"
116 #include"AliTPCParam.h"
117 #include"AliTPCParamSR.h"
119 #include <TInterpreter.h>
120 #include "TLorentzVector.h"
121 #include "AliTPCTrackHits.h"
124 //_____________________________________________________________________________
126 AliTPCv3::AliTPCv3(){
132 //_____________________________________________________________________________
133 AliTPCv3::AliTPCv3(const char *name, const char *title) :
137 // Standard constructor for Time Projection Chamber version 3
140 SetBufferSize(128000);
143 SetGasMixt(2,20,10,-1,0.9,0.1,0.);
146 fTPCParam->Write(fTPCParam->GetTitle());
151 //_____________________________________________________________________________
152 void AliTPCv3::CreateGeometry()
155 // Creation of the TPC coarse geometry (version 3)
156 // The whole drift volume is sensitive
157 // Origin Marek Kowalski Cracow
161 <img src="picts/AliTPCgif">
166 <img src="picts/AliTPCv3Tree.gif">
171 Int_t *idtmed = fIdtmed->GetArray(); // TPC media
173 Int_t idrotm[120]; // rotation matrices
175 Int_t nRotMat = 0; // actual number of rotation matrices
179 // Mother volume (Air) - all volumes will be positioned in it
234 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
238 //-------------------------------------------------------------------
239 // Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
240 //-------------------------------------------------------------------
282 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
284 //----------------------------------------------------------------
285 // Tpc Outer Contaiment Vessel
286 // mother volume - Al, daughters - composite (sandwich)
287 //----------------------------------------------------------------
329 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
331 // Daughter volumes - sandwich
333 // Tpc SAndwich 1 - Al
339 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
341 // Tpc SAndwich 2 - epoxy glue (I use Lexan)
346 gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
348 // Tpc SAndwich 3 - Tedlar
353 gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
356 // Tpc SAndwich 4 - fiber glass (G10)
361 gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);
363 // Tpc SAndwich 5 - NOMEX honeycomb
368 gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
370 // 5->4->3->2->1->TCOV
373 gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
374 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
375 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
376 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
378 gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
382 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
384 //-------------------------------------------------------
385 // Tpc Outer Field Cage
386 // mother volume - Al, daughters - composite (sandwich)
387 //-------------------------------------------------------
429 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
433 // Tpc SAndwich 6 - Tedlar
439 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
441 // Tpc SAndwich 7 - fiber glass
446 gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
449 // Tpc SAndwich 8 - NOMEX
454 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
458 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
459 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
460 gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
464 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
468 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
472 //--------------------------------------------------------------------
473 // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
474 // Inner containment vessel will be placed directly in the TPC
475 //--------------------------------------------------------------------
505 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
507 // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
513 gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
515 gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
517 //-----------------------------------------------------
518 // Tpc Inner Field Cage
519 // mother volume - Al, daughters - composite (sandwich)
520 //------------------------------------------------------
586 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
588 // daughter volumes - central part
590 // Tpc Sandwich 9 -Tedlar
596 gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3);
598 // Tpc Sandwich 10 - fiber glass (G10)
603 gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
605 // Tpc Sandwich 11 - NOMEX
610 gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
614 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
615 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
617 gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
619 // daughter volumes - outer parts (reinforced)
621 // Tpc Sandwich 12 -Tedlar
627 gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
629 // Tpc Sandwich 13 - fiber glass (G10)
634 gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
636 // Tpc Sandwich 14 - NOMEX
641 gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
645 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
646 gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY");
648 gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
649 gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY");
651 // place this inside the inner insulator
653 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
655 // and now in the TPC...
657 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
659 //---------------------------------------------------------
660 // Tpc Inner Containment vessel - Cones
661 //---------------------------------------------------------
715 gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
717 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
728 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
730 gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
731 gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
734 //---------------------------------------------------------
735 // Tpc Inner Containment vessel - Middle part -Al
736 //---------------------------------------------------------
778 gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
780 // Tpc Sandwich 15 - Al
786 gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
788 // Tpc Sandwich 16 - epoxy glue
793 gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
795 // Tpc Sandwich 17 - Tedlar
800 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
802 // Tpc Sandwich 18 - fiber glass
807 gMC->Gsvolu("TS18","TUBE",idtmed[12],dm,3);
809 // Tpc Sandwich 19 - Nomex
814 gMC->Gsvolu("TS19","TUBE",idtmed[12],dm,3);
816 // 19->18->17->16->15-> TICM
818 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
819 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
820 gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
821 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
823 gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
826 // TPc inner cont. vessel Joints
832 gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
834 gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
835 gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
867 gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
869 gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
870 gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
874 // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
880 gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
882 gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
883 gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY");
887 gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
891 nRotMat++; // prepare for the next rotation matrix
893 //---------------------------------------------------------
894 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
895 // and its daughters (HV membrane, rods, readout chambers)
896 //---------------------------------------------------------
902 gMC->Gsvolu("TDGS","TUBE",idtmed[2],dm,3);
904 // sector opening angles
906 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
908 // sector angle shift
910 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
914 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
915 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
917 // All above parameters are identical for inner and outer
918 // sectors. The distinction is kept for the historical reasons
919 // and eventually will disappear.
921 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
922 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
925 //-------------------------------------------------------------------------
926 // Tpc Inner Readout Chambers
927 //-------------------------------------------------------------------------
931 dm[2]= 1.6; // thickness
934 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
936 // this volume will be positioned in the empty space
937 // of the end-cap to avoid overlaps
944 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
947 //------------------------------------------------
948 // Tpc Inner readout chamber Pad Plane
949 //------------------------------------------------
956 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
960 dm[0] -= 1.218511934;
961 dm[1] -= 1.218511934;
964 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
966 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
968 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
971 //----------------------------------------------
972 // Tpc Readout Chambers Empty spaces - for both
973 // inner and outer sectors
974 //----------------------------------------------
976 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
978 // Inner sector - 4 spaces
989 space = rr*tanAlpha-dm[0];
991 for(Int_t nsLow=0;nsLow<4;nsLow++){
994 dm[1]= rr*tanAlpha - space;
998 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1004 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1007 dm[0] = rr*tanAlpha - space;
1013 // dm[1] - this is the dm[1] from the previous TRCE
1017 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
1020 // TPc Space for Connectors
1027 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1035 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1037 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1045 // inner part of the inner sector - 2 x 20 holes
1047 astep = 20.00096874/19.;
1049 alpha = 10.00048437-astep;
1061 for(ncon=0;ncon<20;ncon++){
1067 phi3 = (alpha>0) ? 0. : 180.;
1068 theta3 = TMath::Abs(alpha);
1070 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1074 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1075 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1086 // outer part of the inner sector - 2 x 25 holes
1088 astep = 20.00096874/24.;
1089 alpha = 10.00048437-astep;
1097 for(ncon=0;ncon<25;ncon++){
1103 phi3 = (alpha>0) ? 0. : 180.;
1104 theta3 = TMath::Abs(alpha);
1106 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1110 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1111 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1122 //--------------------------------------------------------------------------
1123 // TPC Outer Readout Chambers
1124 // this is NOT a final design
1125 //--------------------------------------------------------------------------
1129 dm[2]= 1.5; //thickness
1132 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1134 //------------------------------------------------
1135 // Tpc Outer readout chamber Pad Plane
1136 //------------------------------------------------
1140 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1142 dm[0] -= 1.218511934;
1143 dm[1] -= 1.218511934;
1146 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1148 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1150 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1159 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1166 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1173 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1175 //-----------------------------------------------
1176 // Tpc Services Support Wheel
1177 //-----------------------------------------------
1192 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1194 // Tpc Services Wheel Cover
1199 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1201 // Tpc Service wheel Cover Empty space
1208 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1210 // Tpc services Wheel Empty Spaces
1217 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1219 // Tpc Services Wheel Bars
1221 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1231 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1236 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1238 // TPc ELectronics - right now 30% X0 Si
1245 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1246 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1248 //--------------------------------------------------------------------------
1250 //--------------------------------------------------------------------------
1252 // TPc Main Wheel - Al
1258 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1260 //--------------------------------------------------------------------------
1261 // Tpc Empty Space for the Readout chambers
1262 //--------------------------------------------------------------------------
1266 Float_t dR = 0.5*(rUp-rLow);
1268 space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1270 dm[0]= rLow*tanAlpha-space;
1271 dm[1]= rUp*tanAlpha-space;
1275 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1279 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1283 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1285 // Tpc Empty Space Bars - Al (daughters of TESR)
1289 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1293 dm[0]= rLow*tanAlpha-space;
1294 dm[1]= 88.7*tanAlpha-space;
1300 gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1304 dm[0]= 131.65*tanAlpha-space;
1305 dm[1]= 136.5*tanAlpha-space;
1308 zBar = -dR +131.65+dm[3]-rLow;
1310 gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1314 dm[0]= 240.4*tanAlpha-space;
1315 dm[1]= rUp*tanAlpha-space;
1320 gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1322 // positioning of the empty spaces into the main wheel
1324 Float_t rCenter,xc,yc;
1325 Float_t rInner,rOuter; // center of the inner and outer chamber
1333 for(Int_t ns=0; ns<nInnerSector;ns++){
1335 phi1 = ns * innerOpenAngle + innerAngleShift;
1336 phi1 *= kRaddeg; // in degrees
1338 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1340 if (phi1 > 360.) phi1 -= 360.;
1345 phi3 = ns * innerOpenAngle + innerAngleShift;
1346 phi3 *= kRaddeg; // in degrees
1348 phi3 = (Float_t)TMath::Nint(phi3);
1350 if(phi3 > 360.) phi3 -= 360.;
1354 // "holes"->End plate
1356 xc = rCenter*TMath::Cos(phi3*kDegrad);
1357 yc = rCenter*TMath::Sin(phi3*kDegrad);
1359 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1361 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1363 // TSCE->TSWC (services wheel volumes)
1365 xc = 166.142*TMath::Cos(phi3*kDegrad);
1366 yc = 166.142*TMath::Sin(phi3*kDegrad);
1368 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1369 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1372 // readout chambers->TDGS (drift gas)
1374 xc = rInner*TMath::Cos(phi3*kDegrad);
1375 yc = rInner*TMath::Sin(phi3*kDegrad);
1377 gMC->Gspos("TIRC",ns+1,"TDGS",xc,yc,252.,idrotm[nRotMat],"ONLY");
1379 xc = rOuter*TMath::Cos(phi3*kDegrad);
1380 yc = rOuter*TMath::Sin(phi3*kDegrad);
1382 gMC->Gspos("TORC",ns+1,"TDGS",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1386 theta2 = 0.; // reflection
1388 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1390 xc = rInner*TMath::Cos(phi3*kDegrad);
1391 yc = rInner*TMath::Sin(phi3*kDegrad);
1393 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGS",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1395 xc = rOuter*TMath::Cos(phi3*kDegrad);
1396 yc = rOuter*TMath::Sin(phi3*kDegrad);
1398 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGS",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1405 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1406 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1408 //---------------------------------------------------------
1409 // Tpc High Voltage Membrane - 100 microns of mylar
1410 //---------------------------------------------------------
1416 gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1418 gMC->Gspos("THVM",1,"TDGS",0.,0.,0.,0,"ONLY");
1420 // Tpc High Voltage membrane Holders
1422 gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1432 gMC->Gsposp("THVH",1,"TDGS",0.,0.,0.,0,"ONLY",dm,3);
1440 gMC->Gsposp("THVH",2,"TDGS",0.,0.,0.,0,"ONLY",dm,3);
1442 //----------------------------------------------------------
1443 // TPc Support Rods - MAKROLON
1444 //----------------------------------------------------------
1449 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1452 for(Int_t nrod=0;nrod<18;nrod++){
1453 Float_t angle=innerOpenAngle*(Float_t)nrod;
1455 xc=81.5*TMath::Cos(angle);
1456 yc=81.5*TMath::Sin(angle);
1460 gMC->Gsposp("TPSR",nrod+1,"TDGS",xc,yc,126.9,0,"ONLY",dm,3);
1461 gMC->Gsposp("TPSR",nrod+19,"TDGS",xc,yc,-126.9,0,"ONLY",dm,3);
1465 xc=254.25*TMath::Cos(angle);
1466 yc=254.25*TMath::Sin(angle);
1468 // rod number 54 contans the HV cable
1471 gMC->Gsposp("TPSR",nrod+37,"TDGS",xc,yc,127.,0,"ONLY",dm,3);
1472 gMC->Gsposp("TPSR",nrod+54,"TDGS",xc,yc,-127.,0,"ONLY",dm,3);
1477 //----------------------------------------------------------
1478 // Tpc High Voltage Rod - MAKROLON + Copper cable
1479 //----------------------------------------------------------
1481 // rod with cable (Left)
1487 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1495 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1503 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1505 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1506 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1508 // rod without cable
1514 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1516 gMC->Gspos("THVL",1,"TDGS",xc,yc,-127.,0,"ONLY");
1517 gMC->Gspos("THVR",1,"TDGS",xc,yc,127.,0,"ONLY");
1519 gMC->Gspos("TDGS",1,"TPC ",0.,0.,0.,0,"ONLY");
1521 // services wheel cover -> wheel
1524 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1525 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1528 // put the wheel into the TPC
1530 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1531 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1535 gMC->Gsord("TPMW",6);
1536 gMC->Gsord("TSSW",6);
1537 gMC->Gsord("TSWC",6);
1539 // put the TPC into ALIC (main mother volume)
1541 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1544 } // end of function
1546 //_____________________________________________________________________________
1547 void AliTPCv3::DrawDetector()
1550 // Draw a shaded view of the Time Projection Chamber version 3
1554 // Set everything unseen
1555 gMC->Gsatt("*", "seen", -1);
1557 // Set ALIC mother transparent
1558 gMC->Gsatt("ALIC","SEEN",0);
1560 // Set the volumes visible
1563 gMC->Gsatt("TPC ","SEEN",0);
1564 gMC->Gsatt("TOIN","SEEN",1);
1565 gMC->Gsatt("TOIN","COLO",7);
1566 gMC->Gsatt("TOCV","SEEN",1);
1567 gMC->Gsatt("TOCV","COLO",4);
1568 gMC->Gsatt("TSA1","SEEN",0);
1569 gMC->Gsatt("TSA2","SEEN",0);
1570 gMC->Gsatt("TSA3","SEEN",0);
1571 gMC->Gsatt("TSA4","SEEN",0);
1572 gMC->Gsatt("TSA5","SEEN",0);
1573 gMC->Gsatt("TOFC","SEEN",1);
1574 gMC->Gsatt("TOFC","COLO",4);
1575 gMC->Gsatt("TSA6","SEEN",0);
1576 gMC->Gsatt("TSA7","SEEN",0);
1577 gMC->Gsatt("TSA8","SEEN",0);
1578 gMC->Gsatt("TIIN","SEEN",1);
1579 gMC->Gsatt("TIIN","COLO",7);
1580 gMC->Gsatt("TII1","SEEN",0);
1581 gMC->Gsatt("TIFC","SEEN",1);
1582 gMC->Gsatt("TIFC","COLO",4);
1583 gMC->Gsatt("TSA9","SEEN",0);
1584 gMC->Gsatt("TS10","SEEN",0);
1585 gMC->Gsatt("TS11","SEEN",0);
1586 gMC->Gsatt("TS12","SEEN",0);
1587 gMC->Gsatt("TS13","SEEN",0);
1588 gMC->Gsatt("TS14","SEEN",0);
1589 gMC->Gsatt("TICC","SEEN",0);
1590 gMC->Gsatt("TICM","SEEN",0);
1591 gMC->Gsatt("TS15","SEEN",0);
1592 gMC->Gsatt("TS16","SEEN",0);
1593 gMC->Gsatt("TS17","SEEN",0);
1594 gMC->Gsatt("TS18","SEEN",0);
1595 gMC->Gsatt("TS19","SEEN",0);
1596 gMC->Gsatt("TPJ1","SEEN",0);
1597 gMC->Gsatt("TPJ2","SEEN",0);
1598 gMC->Gsatt("TICS","SEEN",0);
1599 gMC->Gsatt("TDGS","SEEN",0);
1600 gMC->Gsatt("TIRC","SEEN",0);
1601 gMC->Gsatt("TIC1","SEEN",1);
1602 gMC->Gsatt("TIPP","SEEN",0);
1603 gMC->Gsatt("TIC3","SEEN",0);
1604 gMC->Gsatt("TRCE","SEEN",0);
1605 gMC->Gsatt("TPSC","SEEN",0);
1606 gMC->Gsatt("TPCC","SEEN",0);
1607 gMC->Gsatt("TORC","SEEN",0);
1608 gMC->Gsatt("TOPP","SEEN",0);
1609 gMC->Gsatt("TOC3","SEEN",0);
1610 gMC->Gsatt("TOC1","SEEN",1);
1611 gMC->Gsatt("TSSW","SEEN",1);
1612 gMC->Gsatt("TSWC","SEEN",1);
1613 gMC->Gsatt("TSSW","COLO",3);
1614 gMC->Gsatt("TSWC","COLO",3);
1615 gMC->Gsatt("TSCE","COLO",6);
1616 gMC->Gsatt("TSCE","SEEN",1);
1617 gMC->Gsatt("TWES","SEEN",0);
1618 gMC->Gsatt("TSWB","SEEN",0);
1619 gMC->Gsatt("TPEL","SEEN",0);
1620 gMC->Gsatt("TPMW","SEEN",1);
1621 gMC->Gsatt("TESR","SEEN",1);
1622 gMC->Gsatt("TPMW","COLO",12);
1623 gMC->Gsatt("TIC1","COLO",5);
1624 gMC->Gsatt("TOC1","COLO",5);
1625 gMC->Gsatt("TESB","SEEN",0);
1626 gMC->Gsatt("THVM","SEEN",1);
1627 gMC->Gsatt("THVM","COLO",11);
1628 gMC->Gsatt("THVH","SEEN",0);
1629 gMC->Gsatt("TPSR","SEEN",0);
1630 gMC->Gsatt("THVL","SEEN",0);
1631 gMC->Gsatt("THVC","SEEN",0);
1632 gMC->Gsatt("THVE","SEEN",0);
1633 gMC->Gsatt("THVR","SEEN",0);
1636 gMC->Gdopt("hide", "on");
1637 gMC->Gdopt("shad", "on");
1638 gMC->Gsatt("*", "fill", 7);
1639 gMC->SetClipBox(".");
1640 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1641 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1642 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1643 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1644 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1645 gMC->DefaultRange();
1646 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1647 gMC->Gdhead(1111, "Time Projection Chamber");
1648 gMC->Gdman(18, 4, "MAN");
1649 gMC->Gdopt("hide","off");
1652 //_____________________________________________________________________________
1653 void AliTPCv3::CreateMaterials()
1656 // Define materials for version 2 of the Time Projection Chamber
1661 AliTPC::CreateMaterials();
1664 //_____________________________________________________________________________
1665 void AliTPCv3::Init()
1668 // Initialises version 3 of the TPC after that it has been built
1670 Int_t *idtmed = fIdtmed->GetArray();
1674 fIdSens=gMC->VolId("TDGS"); // drift gas as a sensitive volume
1676 gMC->SetMaxNStep(30000); // max. number of steps increased
1678 gMC->Gstpar(idtmed[2],"LOSS",5);
1680 printf("*** TPC version 3 initialized ***\n");
1681 printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
1687 //_____________________________________________________________________________
1688 void AliTPCv3::StepManager()
1691 // Called for every step in the Time Projection Chamber
1695 // parameters used for the energy loss calculations
1697 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1698 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1699 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1702 const Float_t kbig = 1.e10;
1714 gMC->SetMaxStep(kbig);
1716 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1718 Float_t charge = gMC->TrackCharge();
1720 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1723 id=gMC->CurrentVolID(copy);
1725 // Check the sensitive volume
1727 if (id != fIdSens) return;
1730 // charged particle is in the sensitive volume
1733 if(gMC->TrackStep() > 0) {
1736 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1737 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1739 gMC->TrackPosition(pos);
1745 // check the selected side of the TPC
1748 if(fSide && fSide*hits[2]<=0.) return;
1750 hits[3]=(Float_t)nel;
1754 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
1758 // Stemax calculation for the next step
1762 gMC->TrackMomentum(mom);
1763 Float_t ptot=mom.Rho();
1764 Float_t betaGamma = ptot/gMC->TrackMass();
1766 Int_t pid=gMC->TrackPid();
1767 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1769 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1773 pp=kprim*BetheBloch(betaGamma);
1774 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1778 gMC->Rndm(random,1); // good, old GRNDM from Geant3
1780 Double_t rnd = (Double_t)random[0];
1782 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1786 //_____________________________________________________________________________
1787 Float_t AliTPCv3::BetheBloch(Float_t bg)
1790 // Bethe-Bloch energy loss formula
1792 const Double_t kp1=0.76176e-1;
1793 const Double_t kp2=10.632;
1794 const Double_t kp3=0.13279e-4;
1795 const Double_t kp4=1.8631;
1796 const Double_t kp5=1.9479;
1798 Double_t dbg = (Double_t) bg;
1800 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
1802 Double_t aa = TMath::Power(beta,kp4);
1803 Double_t bb = TMath::Power(1./dbg,kp5);
1805 bb=TMath::Log(kp3+bb);
1807 return ((Float_t)((kp2-aa-bb)*kp1/aa));