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 1 -- detailed TPC and fast simulation //
25 <img src="picts/AliTPCv1Class.gif">
30 ///////////////////////////////////////////////////////////////////////////////
32 #include <Riostream.h>
35 #include <TGeometry.h>
36 #include <TInterpreter.h>
40 #include <TVirtualMC.h>
44 #include "AliTPCDigitsArray.h"
45 #include "AliTPCParam.h"
46 #include "AliTPCParamSR.h"
48 #include "TLorentzVector.h"
53 //_____________________________________________________________________________
61 //_____________________________________________________________________________
62 AliTPCv1::AliTPCv1(const char *name, const char *title)
63 :AliTPC(name, title) {
65 // Standard constructor for Time Projection Chamber
67 fIdSens=fIdLSec=fIdUSec=0;
69 SetGasMixt(2,20,10,-1,0.9,0.1,0.);
72 fTPCParam->Write(fTPCParam->GetTitle());
77 //_____________________________________________________________________________
78 void AliTPCv1::CreateGeometry()
80 //-------------------------------------------------------------
81 // Creates geometry for Time Projection Chamber version 1
82 // Detailed geometry -- Fast simulation - space points
83 // at the pad-rows centers
84 // Origin M.Kowalski, INP Cracow, Marek.Kowalski@ifj.edu.pl
85 //-----------------------------------------------------------
89 <img src="picts/AliTPC.gif">
94 <img src="picts/AliTPCv1Tree.gif">
99 Int_t *idtmed = fIdtmed->GetArray(); // TPC media
101 Int_t idrotm[120]; // rotation matrices
103 Int_t nRotMat = 0; // actual number of rotation matrices
106 // Mother volume TPC (Air) - all volumes will be positioned in it
161 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
165 //-------------------------------------------------------------------
166 // Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
167 //-------------------------------------------------------------------
209 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
211 //----------------------------------------------------------------
212 // Tpc Outer Contaiment Vessel
213 // mother volume - Al, daughters - composite (sandwich)
214 //----------------------------------------------------------------
256 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
258 // Daughter volumes - sandwich
260 // Tpc SAndwich 1 - Al
266 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
268 // Tpc SAndwich 2 - epoxy glue (I use Lexan)
273 gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
275 // Tpc SAndwich 3 - Tedlar
280 gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
283 // Tpc SAndwich 4 - fiber glass (G10)
288 gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);
290 // Tpc SAndwich 5 - NOMEX honeycomb
295 gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
297 // 5->4->3->2->1->TCOV
300 gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
301 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
302 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
303 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
305 gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
309 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
311 //-------------------------------------------------------
312 // Tpc Outer Field Cage
313 // mother volume - Al, daughters - composite (sandwich)
314 //-------------------------------------------------------
356 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
360 // Tpc SAndwich 6 - Tedlar
366 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
368 // Tpc SAndwich 7 - fiber glass
373 gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
376 // Tpc SAndwich 8 - NOMEX
381 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
385 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
386 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
387 gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
391 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
395 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
399 //--------------------------------------------------------------------
400 // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
401 // Inner containment vessel will be placed directly in the TPC
402 //--------------------------------------------------------------------
432 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
434 // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
440 gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
442 gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
444 //-----------------------------------------------------
445 // Tpc Inner Field Cage
446 // mother volume - Al, daughters - composite (sandwich)
447 //------------------------------------------------------
513 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
515 // daughter volumes - central part
517 // Tpc Sandwich 9 -Tedlar
523 gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3);
525 // Tpc Sandwich 10 - fiber glass (G10)
530 gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
532 // Tpc Sandwich 11 - NOMEX
537 gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
541 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
542 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
544 gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
546 // daughter volumes - outer parts (reinforced)
548 // Tpc Sandwich 12 -Tedlar
554 gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
556 // Tpc Sandwich 13 - fiber glass (G10)
561 gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
563 // Tpc Sandwich 14 - NOMEX
568 gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
572 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
573 gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY");
575 gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
576 gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY");
578 // place this inside the inner insulator
580 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
582 // and now in the TPC...
584 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
586 //---------------------------------------------------------
587 // Tpc Inner Containment vessel - Cones
588 //---------------------------------------------------------
642 gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
644 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
655 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
657 gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
658 gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
661 //---------------------------------------------------------
662 // Tpc Inner Containment vessel - Middle part -Al
663 //---------------------------------------------------------
705 gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
707 // Tpc Sandwich 15 - Al
713 gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
715 // Tpc Sandwich 16 - epoxy glue
720 gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
722 // Tpc Sandwich 17 - Tedlar
727 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
729 // Tpc Sandwich 18 - carbon fiber
734 gMC->Gsvolu("TS18","TUBE",idtmed[15],dm,3);
736 // Tpc Sandwich 19 - Nomex
741 gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3);
743 // 19->18->17->16->15-> TICM
745 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
746 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
747 gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
748 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
750 gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
753 // TPc inner cont. vessel Joints
759 gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
761 gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
762 gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
794 gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
796 gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
797 gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
801 // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
807 gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
809 gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
810 gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY");
814 gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
818 nRotMat++; // prepare for the next rotation matrix
820 //---------------------------------------------------------
821 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
822 // and its daughters (HV membrane, rods, readout chambers)
823 //---------------------------------------------------------
829 gMC->Gsvolu("TDGN","TUBE",idtmed[1],dm,3);
831 // sector opening angles
833 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
834 Float_t outerOpenAngle = fTPCParam->GetOuterAngle();
836 // sector angle shift
838 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
842 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
843 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
845 // All above parameters are identical for inner and outer
846 // sectors. The distinction is kept for the historical reasons
847 // and eventually will disappear.
849 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
850 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
853 //-------------------------------------------------------------------------
854 // Tpc Inner Readout Chambers
855 //-------------------------------------------------------------------------
859 dm[2]= 1.6; // thickness
862 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
864 // this volume will be positioned in the empty space
865 // of the end-cap to avoid overlaps
872 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
875 //------------------------------------------------
876 // Tpc Inner readout chamber Pad Plane
877 //------------------------------------------------
884 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
888 dm[0] -= 1.218511934;
889 dm[1] -= 1.218511934;
892 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
894 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
896 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
899 //----------------------------------------------
900 // Tpc Readout Chambers Empty spaces - for both
901 // inner and outer sectors
902 //----------------------------------------------
904 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
906 // Inner sector - 4 spaces
917 space = rr*tanAlpha-dm[0];
919 for(Int_t nsLow=0;nsLow<4;nsLow++){
922 dm[1]= rr*tanAlpha - space;
926 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
932 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
935 dm[0] = rr*tanAlpha - space;
941 // dm[1] - this is the dm[1] from the previous TRCE
945 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
948 // TPc Space for Connectors
955 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
963 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
965 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
973 // inner part of the inner sector - 2 x 20 holes
975 astep = 20.00096874/19.;
977 alpha = 10.00048437-astep;
989 for(ncon=0;ncon<20;ncon++){
995 phi3 = (alpha>0) ? 0. : 180.;
996 theta3 = TMath::Abs(alpha);
998 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1002 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1003 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1014 // outer part of the inner sector - 2 x 25 holes
1016 astep = 20.00096874/24.;
1017 alpha = 10.00048437-astep;
1025 for(ncon=0;ncon<25;ncon++){
1031 phi3 = (alpha>0) ? 0. : 180.;
1032 theta3 = TMath::Abs(alpha);
1034 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1038 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1039 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1050 //--------------------------------------------------------------------------
1051 // TPC Outer Readout Chambers
1052 // this is NOT a final design
1053 //--------------------------------------------------------------------------
1057 dm[2]= 1.5; //thickness
1060 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1062 //------------------------------------------------
1063 // Tpc Outer readout chamber Pad Plane
1064 //------------------------------------------------
1068 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1070 dm[0] -= 1.218511934;
1071 dm[1] -= 1.218511934;
1074 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1076 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1078 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1087 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1094 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1101 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1103 //-----------------------------------------------
1104 // Tpc Services Support Wheel
1105 //-----------------------------------------------
1120 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1122 // Tpc Services Wheel Cover
1127 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1129 // Tpc Service wheel Cover Empty space
1136 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1138 // Tpc services Wheel Empty Spaces
1145 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1147 // Tpc Services Wheel Bars
1149 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1159 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1164 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1166 // TPc ELectronics - right now 30% X0 Si
1173 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1174 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1176 //--------------------------------------------------------------------------
1178 //--------------------------------------------------------------------------
1180 // TPc Main Wheel - Al
1186 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1188 //--------------------------------------------------------------------------
1189 // Tpc Empty Space for the Readout chambers
1190 //--------------------------------------------------------------------------
1194 Float_t dR = 0.5*(rUp-rLow);
1196 space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1198 dm[0]= rLow*tanAlpha-space;
1199 dm[1]= rUp*tanAlpha-space;
1203 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1207 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1211 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1213 // Tpc Empty Space Bars - Al (daughters of TESR)
1217 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1221 dm[0]= rLow*tanAlpha-space;
1222 dm[1]= 88.7*tanAlpha-space;
1228 gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1232 dm[0]= 131.65*tanAlpha-space;
1233 dm[1]= 136.5*tanAlpha-space;
1236 zBar = -dR +131.65+dm[3]-rLow;
1238 gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1242 dm[0]= 240.4*tanAlpha-space;
1243 dm[1]= rUp*tanAlpha-space;
1248 gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1251 //------------------------------------------------------
1252 // TPc Lower "S" Sectors
1253 //------------------------------------------------------
1258 Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow();
1259 Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp();
1261 dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1262 dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1263 dm[2] = 0.5*(250. - 5.e-3);
1264 dm[3] = 0.5*(inSecUpEdge-inSecLowEdge);
1266 gMC->Gsvolu("TPLS", "TRD1", idtmed[1], dm, 4); // nonsensitive
1268 //----------------------------------------------------------
1269 // TPc Upper Sectors
1270 //----------------------------------------------------------
1272 Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow();
1273 Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp();
1275 dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1276 dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1277 dm[2] = 0.5*(250. - 5.e-3);
1278 dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge);
1280 gMC->Gsvolu("TPUS", "TRD1", idtmed[1], dm, 4); // nonsensitive
1282 //--------------------------------------------------------
1283 // TPc Sensitive Strips, the same for S and L sectors
1284 //--------------------------------------------------------
1286 gMC->Gsvolu("TPSS","TRD1",idtmed[2],dm,0); // sensitive
1288 Int_t nofStrips,nstr;
1290 Float_t stripThick = 0.01; // 100 microns
1294 nofStrips = fTPCParam->GetNRowLow();
1295 deadSpace = fTPCParam->GetInnerWireMount();
1297 dm[2] = 0.5*(250. - 5.e-3);
1298 dm[3] = 0.5 * stripThick;
1300 for(nstr=0;nstr<nofStrips;nstr++){
1302 r1 = fTPCParam->GetPadRowRadiiLow(nstr);
1303 r2 = r1 + stripThick;
1304 dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1305 dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1306 zs = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge);
1310 gMC->Gsposp("TPSS", nstr+1, "TPLS", 0., 0., zs, 0, "ONLY", dm, 4);
1314 Int_t nsSave = nofStrips;
1318 nofStrips = fTPCParam->GetNRowUp();
1319 deadSpace = fTPCParam->GetOuterWireMount();
1321 dm[2] = 0.5*(250. - 5.e-3);
1322 dm[3] = 0.5 * stripThick;
1324 for(nstr=0;nstr<nofStrips;nstr++){
1326 r1 = fTPCParam->GetPadRowRadiiUp(nstr);
1327 r2 = r1 + stripThick;
1328 dm[0] = r1 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1329 dm[1] = r2 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1330 zs = -ouSecLowEdge -0.5*(ouSecUpEdge-ouSecLowEdge);
1334 gMC->Gsposp("TPSS", nstr+1+nsSave, "TPUS", 0., 0., zs, 0, "ONLY", dm, 4);
1338 //-------------------------------------------------------
1339 // positioning of the empty spaces into the main wheel
1340 // and readout chambers and sectors into the drift gas
1341 //-------------------------------------------------------
1344 Float_t rCenter,xc,yc;
1345 Float_t rInner,rOuter; // center of the inner and outer chamber
1353 for(Int_t ns=0; ns<nInnerSector;ns++){
1355 phi1 = ns * innerOpenAngle + innerAngleShift;
1356 phi1 *= kRaddeg; // in degrees
1358 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1360 if (phi1 > 360.) phi1 -= 360.;
1365 phi3 = ns * innerOpenAngle + innerAngleShift;
1366 phi3 *= kRaddeg; // in degrees
1368 phi3 = (Float_t)TMath::Nint(phi3);
1370 if(phi3 > 360.) phi3 -= 360.;
1374 // "holes"->End plate
1376 xc = rCenter*TMath::Cos(phi3*kDegrad);
1377 yc = rCenter*TMath::Sin(phi3*kDegrad);
1379 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1381 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1383 // TSCE->TSWC (services wheel volumes)
1385 xc = 166.142*TMath::Cos(phi3*kDegrad);
1386 yc = 166.142*TMath::Sin(phi3*kDegrad);
1388 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1389 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1392 // readout chambers->TDGN (drift gas)
1394 xc = rInner*TMath::Cos(phi3*kDegrad);
1395 yc = rInner*TMath::Sin(phi3*kDegrad);
1397 gMC->Gspos("TIRC",ns+1,"TDGN",xc,yc,252.,idrotm[nRotMat],"ONLY");
1399 // here lower sectors
1401 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1402 gMC->Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1406 xc = rOuter*TMath::Cos(phi3*kDegrad);
1407 yc = rOuter*TMath::Sin(phi3*kDegrad);
1409 gMC->Gspos("TORC",ns+1,"TDGN",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1411 // here upper sectors
1413 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1414 gMC->Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1419 theta2 = 0.; // reflection
1421 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1423 xc = rInner*TMath::Cos(phi3*kDegrad);
1424 yc = rInner*TMath::Sin(phi3*kDegrad);
1426 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGN",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1428 xc = rOuter*TMath::Cos(phi3*kDegrad);
1429 yc = rOuter*TMath::Sin(phi3*kDegrad);
1431 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGN",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1438 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1439 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1441 //---------------------------------------------------------
1442 // Tpc High Voltage Membrane - 100 microns of mylar
1443 //---------------------------------------------------------
1449 gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1451 gMC->Gspos("THVM",1,"TDGN",0.,0.,0.,0,"ONLY");
1453 // Tpc High Voltage membrane Holders
1455 gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1465 gMC->Gsposp("THVH",1,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1473 gMC->Gsposp("THVH",2,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1475 //----------------------------------------------------------
1476 // TPc Support Rods - MAKROLON
1477 //----------------------------------------------------------
1482 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1485 for(Int_t nrod=0;nrod<18;nrod++){
1486 Float_t angle=innerOpenAngle*(Float_t)nrod;
1488 xc=81.5*TMath::Cos(angle);
1489 yc=81.5*TMath::Sin(angle);
1493 gMC->Gsposp("TPSR",nrod+1,"TDGN",xc,yc,126.9,0,"ONLY",dm,3);
1494 gMC->Gsposp("TPSR",nrod+19,"TDGN",xc,yc,-126.9,0,"ONLY",dm,3);
1498 xc=254.25*TMath::Cos(angle);
1499 yc=254.25*TMath::Sin(angle);
1501 // rod number 54 contans the HV cable
1504 gMC->Gsposp("TPSR",nrod+37,"TDGN",xc,yc,127.,0,"ONLY",dm,3);
1505 gMC->Gsposp("TPSR",nrod+54,"TDGN",xc,yc,-127.,0,"ONLY",dm,3);
1510 //----------------------------------------------------------
1511 // Tpc High Voltage Rod - MAKROLON + Copper cable
1512 //----------------------------------------------------------
1514 // rod with cable (Left)
1520 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1528 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1536 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1538 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1539 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1541 // rod without cable
1547 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1549 gMC->Gspos("THVL",1,"TDGN",xc,yc,-127.,0,"ONLY");
1550 gMC->Gspos("THVR",1,"TDGN",xc,yc,127.,0,"ONLY");
1552 gMC->Gspos("TDGN",1,"TPC ",0.,0.,0.,0,"ONLY");
1554 // services wheel cover -> wheel
1557 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1558 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1561 // put the wheel into the TPC
1563 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1564 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1568 gMC->Gsord("TPMW",6);
1569 gMC->Gsord("TSSW",6);
1570 gMC->Gsord("TSWC",6);
1571 gMC->Gsord("TPLS",3);
1572 gMC->Gsord("TPUS",3);
1573 gMC->Gsord("TDGN",6);
1576 // put the TPC into ALIC (main mother volume)
1578 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1582 } // end of function
1584 //_____________________________________________________________________________
1585 void AliTPCv1::DrawDetector()
1588 // Draw a shaded view of the Time Projection Chamber version 1
1591 // Set everything unseen
1592 gMC->Gsatt("*", "seen", -1);
1594 // Set ALIC mother transparent
1595 gMC->Gsatt("ALIC","SEEN",0);
1597 // Set the volumes visible
1598 gMC->Gsatt("TPC ","SEEN",0);
1599 gMC->Gsatt("TOIN","SEEN",1);
1600 gMC->Gsatt("TOIN","COLO",7);
1601 gMC->Gsatt("TOCV","SEEN",1);
1602 gMC->Gsatt("TOCV","COLO",4);
1603 gMC->Gsatt("TSA1","SEEN",0);
1604 gMC->Gsatt("TSA2","SEEN",0);
1605 gMC->Gsatt("TSA3","SEEN",0);
1606 gMC->Gsatt("TSA4","SEEN",0);
1607 gMC->Gsatt("TSA5","SEEN",0);
1608 gMC->Gsatt("TOFC","SEEN",1);
1609 gMC->Gsatt("TOFC","COLO",4);
1610 gMC->Gsatt("TSA6","SEEN",0);
1611 gMC->Gsatt("TSA7","SEEN",0);
1612 gMC->Gsatt("TSA8","SEEN",0);
1613 gMC->Gsatt("TIIN","SEEN",1);
1614 gMC->Gsatt("TIIN","COLO",7);
1615 gMC->Gsatt("TII1","SEEN",0);
1616 gMC->Gsatt("TIFC","SEEN",1);
1617 gMC->Gsatt("TIFC","COLO",4);
1618 gMC->Gsatt("TSA9","SEEN",0);
1619 gMC->Gsatt("TS10","SEEN",0);
1620 gMC->Gsatt("TS11","SEEN",0);
1621 gMC->Gsatt("TS12","SEEN",0);
1622 gMC->Gsatt("TS13","SEEN",0);
1623 gMC->Gsatt("TS14","SEEN",0);
1624 gMC->Gsatt("TICC","SEEN",0);
1625 gMC->Gsatt("TICM","SEEN",0);
1626 gMC->Gsatt("TS15","SEEN",0);
1627 gMC->Gsatt("TS16","SEEN",0);
1628 gMC->Gsatt("TS17","SEEN",0);
1629 gMC->Gsatt("TS18","SEEN",0);
1630 gMC->Gsatt("TS19","SEEN",0);
1631 gMC->Gsatt("TPJ1","SEEN",0);
1632 gMC->Gsatt("TPJ2","SEEN",0);
1633 gMC->Gsatt("TICS","SEEN",0);
1634 gMC->Gsatt("TDGN","SEEN",0);
1635 gMC->Gsatt("TIRC","SEEN",0);
1636 gMC->Gsatt("TIC1","SEEN",1);
1637 gMC->Gsatt("TIPP","SEEN",0);
1638 gMC->Gsatt("TIC3","SEEN",0);
1639 gMC->Gsatt("TRCE","SEEN",0);
1640 gMC->Gsatt("TPSC","SEEN",0);
1641 gMC->Gsatt("TPCC","SEEN",0);
1642 gMC->Gsatt("TORC","SEEN",0);
1643 gMC->Gsatt("TOPP","SEEN",0);
1644 gMC->Gsatt("TOC3","SEEN",0);
1645 gMC->Gsatt("TOC1","SEEN",1);
1646 gMC->Gsatt("TSSW","SEEN",1);
1647 gMC->Gsatt("TSWC","SEEN",1);
1648 gMC->Gsatt("TSSW","COLO",3);
1649 gMC->Gsatt("TSWC","COLO",3);
1650 gMC->Gsatt("TSCE","COLO",6);
1651 gMC->Gsatt("TSCE","SEEN",1);
1652 gMC->Gsatt("TWES","SEEN",0);
1653 gMC->Gsatt("TSWB","SEEN",0);
1654 gMC->Gsatt("TPEL","SEEN",0);
1655 gMC->Gsatt("TPMW","SEEN",1);
1656 gMC->Gsatt("TESR","SEEN",1);
1657 gMC->Gsatt("TPMW","COLO",12);
1658 gMC->Gsatt("TIC1","COLO",5);
1659 gMC->Gsatt("TOC1","COLO",5);
1660 gMC->Gsatt("TESB","SEEN",0);
1661 gMC->Gsatt("THVM","SEEN",1);
1662 gMC->Gsatt("THVM","COLO",11);
1663 gMC->Gsatt("THVH","SEEN",0);
1664 gMC->Gsatt("TPSR","SEEN",0);
1665 gMC->Gsatt("THVL","SEEN",0);
1666 gMC->Gsatt("THVC","SEEN",0);
1667 gMC->Gsatt("THVE","SEEN",0);
1668 gMC->Gsatt("THVR","SEEN",0);
1669 gMC->Gsatt("TPSS","SEEN",0);
1670 gMC->Gsatt("TPUS","SEEN",0);
1671 gMC->Gsatt("TPLS","SEEN",0);
1674 gMC->Gdopt("hide", "on");
1675 gMC->Gdopt("shad", "on");
1676 gMC->Gsatt("*", "fill", 7);
1677 gMC->SetClipBox(".");
1678 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1679 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1680 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1681 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1682 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1683 gMC->DefaultRange();
1684 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1685 gMC->Gdhead(1111, "Time Projection Chamber");
1686 gMC->Gdman(18, 4, "MAN");
1687 gMC->Gdopt("hide","off");
1690 //_____________________________________________________________________________
1691 void AliTPCv1::CreateMaterials()
1694 // Define materials for Time Projection Chamber
1696 AliTPC::CreateMaterials();
1699 //_____________________________________________________________________________
1700 void AliTPCv1::Init()
1703 // Initialises TPC detector after it has been created
1706 fIdSens=gMC->VolId("TPSS"); // sensitive strip
1707 fIdLSec=gMC->VolId("TPLS"); // lower sector
1708 fIdUSec=gMC->VolId("TPUS"); // upper sector
1710 printf("%s: *** TPC version 1 initialized***\n",ClassName());
1712 // printf("TPC version 1 initialized\n");
1715 //_____________________________________________________________________________
1716 void AliTPCv1::StepManager()
1719 // Called at every step in the Time Projection Chamber
1727 if(gMC->TrackCharge() && gMC->IsTrackEntering()) {
1730 // Only charged tracks entering the sensitive volume
1733 id = gMC->CurrentVolID(copy);
1737 // sensitive volume (strip)
1739 vol[1]= copy-1; // row number (absolute)
1743 id = gMC->CurrentVolOffID(1,copy);
1749 vol[0] = copy-1; // sector number
1756 vol[0] = copy-1+fTPCParam->GetNInnerSector(); // sector number
1757 vol[1] -= fTPCParam->GetNRowLow(); // row number
1763 // because Jouri wants to have this
1765 gMC->TrackMomentum(p);
1769 hits[3]=0.; // this hit has no energy loss
1770 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
1772 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
1774 gMC->TrackPosition(p);
1778 hits[3]=0.; // this hit has no energy loss
1779 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
1781 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
1785 gMC->TrackPosition(p);
1786 for(i=0;i<3;++i) hits[i]=p[i];
1787 hits[3]=1; //I'd like to have something positive here (I.Belikov)
1788 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
1790 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
1797 //_____________________________________________________________________________