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 **************************************************************************/
19 ///////////////////////////////////////////////////////////////////////////////
21 // Time Projection Chamber version 3 -- detailed TPC and slow simulation //
25 <img src="picts/AliTPCv3Class.gif">
30 ///////////////////////////////////////////////////////////////////////////////
34 #include <TInterpreter.h>
35 #include <TLorentzVector.h>
37 #include <TVirtualMC.h>
42 #include "AliTPCDigitsArray.h"
43 #include "AliTPCParam.h"
44 #include "AliTPCParamSR.h"
45 #include "AliTPCTrackHitsV2.h"
49 //_____________________________________________________________________________
57 //_____________________________________________________________________________
58 AliTPCv3::AliTPCv3(const char *name, const char *title) :
62 // Standard constructor for Time Projection Chamber version 3
65 SetBufferSize(128000);
68 SetGasMixt(2,20,10,-1,0.9,0.1,0.);
71 fTPCParam->Write(fTPCParam->GetTitle());
76 //_____________________________________________________________________________
77 void AliTPCv3::CreateGeometry()
80 // Creation of the TPC coarse geometry (version 3)
81 // The whole drift volume is sensitive
82 // Origin Marek Kowalski Cracow
86 <img src="picts/AliTPCgif">
91 <img src="picts/AliTPCv3Tree.gif">
96 Int_t *idtmed = fIdtmed->GetArray(); // TPC media
98 Int_t idrotm[120]; // rotation matrices
100 Int_t nRotMat = 0; // actual number of rotation matrices
104 // Mother volume (Air) - all volumes will be positioned in it
159 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
163 //-------------------------------------------------------------------
164 // Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
165 //-------------------------------------------------------------------
207 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
209 //----------------------------------------------------------------
210 // Tpc Outer Contaiment Vessel
211 // mother volume - Al, daughters - composite (sandwich)
212 //----------------------------------------------------------------
254 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
256 // Daughter volumes - sandwich
258 // Tpc SAndwich 1 - Al
264 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
266 // Tpc SAndwich 2 - epoxy glue (I use Lexan)
271 gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
273 // Tpc SAndwich 3 - Tedlar
278 gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
281 // Tpc SAndwich 4 - fiber glass (G10)
286 gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);
288 // Tpc SAndwich 5 - NOMEX honeycomb
293 gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
295 // 5->4->3->2->1->TCOV
298 gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
299 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
300 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
301 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
303 gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
307 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
309 //-------------------------------------------------------
310 // Tpc Outer Field Cage
311 // mother volume - Al, daughters - composite (sandwich)
312 //-------------------------------------------------------
354 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
358 // Tpc SAndwich 6 - Tedlar
364 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
366 // Tpc SAndwich 7 - fiber glass
371 gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
374 // Tpc SAndwich 8 - NOMEX
379 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
383 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
384 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
385 gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
389 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
393 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
397 //--------------------------------------------------------------------
398 // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
399 // Inner containment vessel will be placed directly in the TPC
400 //--------------------------------------------------------------------
430 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
432 // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
438 gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
440 gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
442 //-----------------------------------------------------
443 // Tpc Inner Field Cage
444 // mother volume - Al, daughters - composite (sandwich)
445 //------------------------------------------------------
511 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
513 // daughter volumes - central part
515 // Tpc Sandwich 9 -Tedlar
521 gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3);
523 // Tpc Sandwich 10 - fiber glass (G10)
528 gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
530 // Tpc Sandwich 11 - NOMEX
535 gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
539 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
540 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
542 gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
544 // daughter volumes - outer parts (reinforced)
546 // Tpc Sandwich 12 -Tedlar
552 gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
554 // Tpc Sandwich 13 - fiber glass (G10)
559 gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
561 // Tpc Sandwich 14 - NOMEX
566 gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
570 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
571 gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY");
573 gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
574 gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY");
576 // place this inside the inner insulator
578 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
580 // and now in the TPC...
582 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
584 //---------------------------------------------------------
585 // Tpc Inner Containment vessel - Cones
586 //---------------------------------------------------------
640 gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
642 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
653 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
655 gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
656 gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
659 //---------------------------------------------------------
660 // Tpc Inner Containment vessel - Middle part -Al
661 //---------------------------------------------------------
703 gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
705 // Tpc Sandwich 15 - Al
711 gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
713 // Tpc Sandwich 16 - epoxy glue
718 gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
720 // Tpc Sandwich 17 - Tedlar
725 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
727 // Tpc Sandwich 18 - carbon fiber
732 gMC->Gsvolu("TS18","TUBE",idtmed[15],dm,3);
734 // Tpc Sandwich 19 - Nomex
739 gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3);
741 // 19->18->17->16->15-> TICM
743 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
744 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
745 gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
746 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
748 gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
751 // TPc inner cont. vessel Joints
757 gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
759 gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
760 gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
792 gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
794 gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
795 gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
799 // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
805 gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
807 gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
808 gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY");
812 gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
816 nRotMat++; // prepare for the next rotation matrix
818 //---------------------------------------------------------
819 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
820 // and its daughters (HV membrane, rods, readout chambers)
821 //---------------------------------------------------------
827 gMC->Gsvolu("TDGS","TUBE",idtmed[2],dm,3);
829 // sector opening angles
831 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
833 // sector angle shift
835 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
839 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
840 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
842 // All above parameters are identical for inner and outer
843 // sectors. The distinction is kept for the historical reasons
844 // and eventually will disappear.
846 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
847 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
850 //-------------------------------------------------------------------------
851 // Tpc Inner Readout Chambers
852 //-------------------------------------------------------------------------
856 dm[2]= 1.6; // thickness
859 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
861 // this volume will be positioned in the empty space
862 // of the end-cap to avoid overlaps
869 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
872 //------------------------------------------------
873 // Tpc Inner readout chamber Pad Plane
874 //------------------------------------------------
881 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
885 dm[0] -= 1.218511934;
886 dm[1] -= 1.218511934;
889 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
891 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
893 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
896 //----------------------------------------------
897 // Tpc Readout Chambers Empty spaces - for both
898 // inner and outer sectors
899 //----------------------------------------------
901 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
903 // Inner sector - 4 spaces
914 space = rr*tanAlpha-dm[0];
916 for(Int_t nsLow=0;nsLow<4;nsLow++){
919 dm[1]= rr*tanAlpha - space;
923 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
929 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
932 dm[0] = rr*tanAlpha - space;
938 // dm[1] - this is the dm[1] from the previous TRCE
942 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
945 // TPc Space for Connectors
952 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
960 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
962 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
970 // inner part of the inner sector - 2 x 20 holes
972 astep = 20.00096874/19.;
974 alpha = 10.00048437-astep;
986 for(ncon=0;ncon<20;ncon++){
992 phi3 = (alpha>0) ? 0. : 180.;
993 theta3 = TMath::Abs(alpha);
995 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
999 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1000 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1011 // outer part of the inner sector - 2 x 25 holes
1013 astep = 20.00096874/24.;
1014 alpha = 10.00048437-astep;
1022 for(ncon=0;ncon<25;ncon++){
1028 phi3 = (alpha>0) ? 0. : 180.;
1029 theta3 = TMath::Abs(alpha);
1031 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1035 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1036 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1047 //--------------------------------------------------------------------------
1048 // TPC Outer Readout Chambers
1049 // this is NOT a final design
1050 //--------------------------------------------------------------------------
1054 dm[2]= 1.5; //thickness
1057 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1059 //------------------------------------------------
1060 // Tpc Outer readout chamber Pad Plane
1061 //------------------------------------------------
1065 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1067 dm[0] -= 1.218511934;
1068 dm[1] -= 1.218511934;
1071 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1073 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1075 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1084 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1091 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1098 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1100 //-----------------------------------------------
1101 // Tpc Services Support Wheel
1102 //-----------------------------------------------
1117 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1119 // Tpc Services Wheel Cover
1124 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1126 // Tpc Service wheel Cover Empty space
1133 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1135 // Tpc services Wheel Empty Spaces
1142 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1144 // Tpc Services Wheel Bars
1146 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1156 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1161 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1163 // TPc ELectronics - right now 30% X0 Si
1170 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1171 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1173 //--------------------------------------------------------------------------
1175 //--------------------------------------------------------------------------
1177 // TPc Main Wheel - Al
1183 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1185 //--------------------------------------------------------------------------
1186 // Tpc Empty Space for the Readout chambers
1187 //--------------------------------------------------------------------------
1191 Float_t dR = 0.5*(rUp-rLow);
1193 space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1195 dm[0]= rLow*tanAlpha-space;
1196 dm[1]= rUp*tanAlpha-space;
1200 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1204 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1208 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1210 // Tpc Empty Space Bars - Al (daughters of TESR)
1214 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1218 dm[0]= rLow*tanAlpha-space;
1219 dm[1]= 88.7*tanAlpha-space;
1225 gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1229 dm[0]= 131.65*tanAlpha-space;
1230 dm[1]= 136.5*tanAlpha-space;
1233 zBar = -dR +131.65+dm[3]-rLow;
1235 gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1239 dm[0]= 240.4*tanAlpha-space;
1240 dm[1]= rUp*tanAlpha-space;
1245 gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1247 // positioning of the empty spaces into the main wheel
1249 Float_t rCenter,xc,yc;
1250 Float_t rInner,rOuter; // center of the inner and outer chamber
1258 for(Int_t ns=0; ns<nInnerSector;ns++){
1260 phi1 = ns * innerOpenAngle + innerAngleShift;
1261 phi1 *= kRaddeg; // in degrees
1263 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1265 if (phi1 > 360.) phi1 -= 360.;
1270 phi3 = ns * innerOpenAngle + innerAngleShift;
1271 phi3 *= kRaddeg; // in degrees
1273 phi3 = (Float_t)TMath::Nint(phi3);
1275 if(phi3 > 360.) phi3 -= 360.;
1279 // "holes"->End plate
1281 xc = rCenter*TMath::Cos(phi3*kDegrad);
1282 yc = rCenter*TMath::Sin(phi3*kDegrad);
1284 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1286 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1288 // TSCE->TSWC (services wheel volumes)
1290 xc = 166.142*TMath::Cos(phi3*kDegrad);
1291 yc = 166.142*TMath::Sin(phi3*kDegrad);
1293 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1294 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1297 // readout chambers->TDGS (drift gas)
1299 xc = rInner*TMath::Cos(phi3*kDegrad);
1300 yc = rInner*TMath::Sin(phi3*kDegrad);
1302 gMC->Gspos("TIRC",ns+1,"TDGS",xc,yc,252.,idrotm[nRotMat],"ONLY");
1304 xc = rOuter*TMath::Cos(phi3*kDegrad);
1305 yc = rOuter*TMath::Sin(phi3*kDegrad);
1307 gMC->Gspos("TORC",ns+1,"TDGS",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1311 theta2 = 0.; // reflection
1313 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1315 xc = rInner*TMath::Cos(phi3*kDegrad);
1316 yc = rInner*TMath::Sin(phi3*kDegrad);
1318 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGS",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1320 xc = rOuter*TMath::Cos(phi3*kDegrad);
1321 yc = rOuter*TMath::Sin(phi3*kDegrad);
1323 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGS",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1330 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1331 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1333 //---------------------------------------------------------
1334 // Tpc High Voltage Membrane - 100 microns of mylar
1335 //---------------------------------------------------------
1341 gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1343 gMC->Gspos("THVM",1,"TDGS",0.,0.,0.,0,"ONLY");
1345 // Tpc High Voltage membrane Holders
1347 gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1357 gMC->Gsposp("THVH",1,"TDGS",0.,0.,0.,0,"ONLY",dm,3);
1365 gMC->Gsposp("THVH",2,"TDGS",0.,0.,0.,0,"ONLY",dm,3);
1367 //----------------------------------------------------------
1368 // TPc Support Rods - MAKROLON
1369 //----------------------------------------------------------
1374 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1377 for(Int_t nrod=0;nrod<18;nrod++){
1378 Float_t angle=innerOpenAngle*(Float_t)nrod;
1380 xc=81.5*TMath::Cos(angle);
1381 yc=81.5*TMath::Sin(angle);
1385 gMC->Gsposp("TPSR",nrod+1,"TDGS",xc,yc,126.9,0,"ONLY",dm,3);
1386 gMC->Gsposp("TPSR",nrod+19,"TDGS",xc,yc,-126.9,0,"ONLY",dm,3);
1390 xc=254.25*TMath::Cos(angle);
1391 yc=254.25*TMath::Sin(angle);
1393 // rod number 54 contans the HV cable
1396 gMC->Gsposp("TPSR",nrod+37,"TDGS",xc,yc,127.,0,"ONLY",dm,3);
1397 gMC->Gsposp("TPSR",nrod+54,"TDGS",xc,yc,-127.,0,"ONLY",dm,3);
1402 //----------------------------------------------------------
1403 // Tpc High Voltage Rod - MAKROLON + Copper cable
1404 //----------------------------------------------------------
1406 // rod with cable (Left)
1412 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1420 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1428 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1430 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1431 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1433 // rod without cable
1439 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1441 gMC->Gspos("THVL",1,"TDGS",xc,yc,-127.,0,"ONLY");
1442 gMC->Gspos("THVR",1,"TDGS",xc,yc,127.,0,"ONLY");
1444 gMC->Gspos("TDGS",1,"TPC ",0.,0.,0.,0,"ONLY");
1446 // services wheel cover -> wheel
1449 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1450 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1453 // put the wheel into the TPC
1455 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1456 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1460 gMC->Gsord("TPMW",6);
1461 gMC->Gsord("TSSW",6);
1462 gMC->Gsord("TSWC",6);
1464 // put the TPC into ALIC (main mother volume)
1466 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1469 } // end of function
1471 //_____________________________________________________________________________
1472 void AliTPCv3::DrawDetector()
1475 // Draw a shaded view of the Time Projection Chamber version 3
1479 // Set everything unseen
1480 gMC->Gsatt("*", "seen", -1);
1482 // Set ALIC mother transparent
1483 gMC->Gsatt("ALIC","SEEN",0);
1485 // Set the volumes visible
1488 gMC->Gsatt("TPC ","SEEN",0);
1489 gMC->Gsatt("TOIN","SEEN",1);
1490 gMC->Gsatt("TOIN","COLO",7);
1491 gMC->Gsatt("TOCV","SEEN",1);
1492 gMC->Gsatt("TOCV","COLO",4);
1493 gMC->Gsatt("TSA1","SEEN",0);
1494 gMC->Gsatt("TSA2","SEEN",0);
1495 gMC->Gsatt("TSA3","SEEN",0);
1496 gMC->Gsatt("TSA4","SEEN",0);
1497 gMC->Gsatt("TSA5","SEEN",0);
1498 gMC->Gsatt("TOFC","SEEN",1);
1499 gMC->Gsatt("TOFC","COLO",4);
1500 gMC->Gsatt("TSA6","SEEN",0);
1501 gMC->Gsatt("TSA7","SEEN",0);
1502 gMC->Gsatt("TSA8","SEEN",0);
1503 gMC->Gsatt("TIIN","SEEN",1);
1504 gMC->Gsatt("TIIN","COLO",7);
1505 gMC->Gsatt("TII1","SEEN",0);
1506 gMC->Gsatt("TIFC","SEEN",1);
1507 gMC->Gsatt("TIFC","COLO",4);
1508 gMC->Gsatt("TSA9","SEEN",0);
1509 gMC->Gsatt("TS10","SEEN",0);
1510 gMC->Gsatt("TS11","SEEN",0);
1511 gMC->Gsatt("TS12","SEEN",0);
1512 gMC->Gsatt("TS13","SEEN",0);
1513 gMC->Gsatt("TS14","SEEN",0);
1514 gMC->Gsatt("TICC","SEEN",0);
1515 gMC->Gsatt("TICM","SEEN",0);
1516 gMC->Gsatt("TS15","SEEN",0);
1517 gMC->Gsatt("TS16","SEEN",0);
1518 gMC->Gsatt("TS17","SEEN",0);
1519 gMC->Gsatt("TS18","SEEN",0);
1520 gMC->Gsatt("TS19","SEEN",0);
1521 gMC->Gsatt("TPJ1","SEEN",0);
1522 gMC->Gsatt("TPJ2","SEEN",0);
1523 gMC->Gsatt("TICS","SEEN",0);
1524 gMC->Gsatt("TDGS","SEEN",0);
1525 gMC->Gsatt("TIRC","SEEN",0);
1526 gMC->Gsatt("TIC1","SEEN",1);
1527 gMC->Gsatt("TIPP","SEEN",0);
1528 gMC->Gsatt("TIC3","SEEN",0);
1529 gMC->Gsatt("TRCE","SEEN",0);
1530 gMC->Gsatt("TPSC","SEEN",0);
1531 gMC->Gsatt("TPCC","SEEN",0);
1532 gMC->Gsatt("TORC","SEEN",0);
1533 gMC->Gsatt("TOPP","SEEN",0);
1534 gMC->Gsatt("TOC3","SEEN",0);
1535 gMC->Gsatt("TOC1","SEEN",1);
1536 gMC->Gsatt("TSSW","SEEN",1);
1537 gMC->Gsatt("TSWC","SEEN",1);
1538 gMC->Gsatt("TSSW","COLO",3);
1539 gMC->Gsatt("TSWC","COLO",3);
1540 gMC->Gsatt("TSCE","COLO",6);
1541 gMC->Gsatt("TSCE","SEEN",1);
1542 gMC->Gsatt("TWES","SEEN",0);
1543 gMC->Gsatt("TSWB","SEEN",0);
1544 gMC->Gsatt("TPEL","SEEN",0);
1545 gMC->Gsatt("TPMW","SEEN",1);
1546 gMC->Gsatt("TESR","SEEN",1);
1547 gMC->Gsatt("TPMW","COLO",12);
1548 gMC->Gsatt("TIC1","COLO",5);
1549 gMC->Gsatt("TOC1","COLO",5);
1550 gMC->Gsatt("TESB","SEEN",0);
1551 gMC->Gsatt("THVM","SEEN",1);
1552 gMC->Gsatt("THVM","COLO",11);
1553 gMC->Gsatt("THVH","SEEN",0);
1554 gMC->Gsatt("TPSR","SEEN",0);
1555 gMC->Gsatt("THVL","SEEN",0);
1556 gMC->Gsatt("THVC","SEEN",0);
1557 gMC->Gsatt("THVE","SEEN",0);
1558 gMC->Gsatt("THVR","SEEN",0);
1561 gMC->Gdopt("hide", "on");
1562 gMC->Gdopt("shad", "on");
1563 gMC->Gsatt("*", "fill", 7);
1564 gMC->SetClipBox(".");
1565 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1566 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1567 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1568 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1569 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1570 gMC->DefaultRange();
1571 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1572 gMC->Gdhead(1111, "Time Projection Chamber");
1573 gMC->Gdman(18, 4, "MAN");
1574 gMC->Gdopt("hide","off");
1577 //_____________________________________________________________________________
1578 void AliTPCv3::CreateMaterials()
1581 // Define materials for version 2 of the Time Projection Chamber
1586 AliTPC::CreateMaterials();
1589 //_____________________________________________________________________________
1590 void AliTPCv3::Init()
1593 // Initialises version 3 of the TPC after that it has been built
1595 Int_t *idtmed = fIdtmed->GetArray();
1599 fIdSens=gMC->VolId("TDGS"); // drift gas as a sensitive volume
1601 gMC->SetMaxNStep(30000); // max. number of steps increased
1603 gMC->Gstpar(idtmed[2],"LOSS",5);
1605 printf("%s: *** TPC version 3 initialized***\n",ClassName());
1607 printf("%s: Maximum number of steps = %d\n",ClassName(),gMC->GetMaxNStep());
1609 // printf("*** TPC version 3 initialized ***\n");
1610 // printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
1616 //_____________________________________________________________________________
1617 void AliTPCv3::StepManager()
1620 // Called for every step in the Time Projection Chamber
1624 // parameters used for the energy loss calculations
1626 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1627 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1628 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1631 const Float_t kbig = 1.e10;
1643 gMC->SetMaxStep(kbig);
1645 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1647 Float_t charge = gMC->TrackCharge();
1649 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1652 id=gMC->CurrentVolID(copy);
1654 // Check the sensitive volume
1656 if (id != fIdSens) return;
1659 // charged particle is in the sensitive volume
1662 if(gMC->TrackStep() > 0) {
1665 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1666 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1668 gMC->TrackPosition(pos);
1674 // check the selected side of the TPC
1677 if(fSide && fSide*hits[2]<=0.) return;
1679 hits[3]=(Float_t)nel;
1683 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
1687 // Stemax calculation for the next step
1691 gMC->TrackMomentum(mom);
1692 Float_t ptot=mom.Rho();
1693 Float_t betaGamma = ptot/gMC->TrackMass();
1695 Int_t pid=gMC->TrackPid();
1696 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1698 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1702 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3);
1703 pp=kprim*BetheBloch(betaGamma);
1704 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1707 Double_t rnd = gMC->GetRandom()->Rndm();
1709 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1713 //_____________________________________________________________________________
1714 Float_t AliTPCv3::BetheBloch(Float_t bg)
1717 // Bethe-Bloch energy loss formula
1719 const Double_t kp1=0.76176e-1;
1720 const Double_t kp2=10.632;
1721 const Double_t kp3=0.13279e-4;
1722 const Double_t kp4=1.8631;
1723 const Double_t kp5=1.9479;
1725 Double_t dbg = (Double_t) bg;
1727 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
1729 Double_t aa = TMath::Power(beta,kp4);
1730 Double_t bb = TMath::Power(1./dbg,kp5);
1732 bb=TMath::Log(kp3+bb);
1734 return ((Float_t)((kp2-aa-bb)*kp1/aa));