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.25 2001/03/13 13:07:34 kowal2
19 Corrected bug in the TPC mother volume geometry.
22 Revision 1.24 2000/11/30 11:48:50 kowal2
23 TLorentzVector.h adde to satisfy the latest changes by Federico
25 Revision 1.23 2000/11/14 10:48:57 kowal2
26 Correct material used for TSA4. Thanks to J. Barbosa.
28 Revision 1.22 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.21 2000/11/02 16:55:24 kowal2
34 Corrected bug in the inner containment vessel geometry.
37 Revision 1.20 2000/11/02 07:24:11 kowal2
38 Correction in the TPC geometry.
39 Changes due to the new hit structure.
41 Revision 1.19 2000/07/10 20:57:39 hristov
42 Update of TPC code and macros by M.Kowalski
44 Revision 1.18 2000/06/30 12:07:50 kowal2
45 Updated from the TPC-PreRelease branch
47 Revision 1.17.2.4 2000/06/26 07:39:42 kowal2
48 Changes to obey the coding rules
50 Revision 1.17.2.3 2000/06/25 08:38:41 kowal2
51 Splitted from AliTPCtracking
53 Revision 1.17.2.2 2000/06/16 12:58:13 kowal2
54 Changed parameter settings
56 Revision 1.17.2.1 2000/06/09 07:15:07 kowal2
58 Defaults loaded automatically (hard-wired)
59 Optional parameters can be set via macro called in the constructor
61 Revision 1.17 2000/05/15 10:00:30 kowal2
62 Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
64 Revision 1.16 2000/04/17 09:37:33 kowal2
65 removed obsolete AliTPCDigitsDisplay.C
67 Revision 1.15.8.2 2000/04/10 08:29:48 kowal2
69 Different pad geometry for different sectors
70 Updated readouch chambers geometry
72 Revision 1.15.8.1 2000/04/10 07:56:53 kowal2
73 Not used anymore - removed
75 Revision 1.15 1999/11/04 17:28:07 fca
76 Correct barrel part of HV Degrader
78 Revision 1.14 1999/10/08 06:27:23 fca
79 Corrected bug in the HV degrader geometry, thanks to G.Tabary
81 Revision 1.13 1999/10/04 13:39:54 fca
82 Correct array index problem
84 Revision 1.12 1999/09/29 09:24:34 fca
85 Introduction of the Copyright and cvs Log
90 ///////////////////////////////////////////////////////////////////////////////
92 // Time Projection Chamber version 1 -- detailed TPC and fast simulation //
96 <img src="picts/AliTPCv1Class.gif">
101 ///////////////////////////////////////////////////////////////////////////////
104 #include <TGeometry.h>
108 #include "AliTPCv1.h"
110 #include <iostream.h>
112 #include "TLorentzVector.h"
115 #include "AliConst.h"
117 #include "AliTPCParam.h"
118 #include "AliTPCParamSR.h"
119 #include "AliTPCDigitsArray.h"
120 #include <TInterpreter.h>
124 //_____________________________________________________________________________
126 AliTPCv1::AliTPCv1(){
132 //_____________________________________________________________________________
133 AliTPCv1::AliTPCv1(const char *name, const char *title)
134 :AliTPC(name, title) {
136 // Standard constructor for Time Projection Chamber
138 fIdSens=fIdLSec=fIdUSec=0;
140 SetGasMixt(2,20,10,-1,0.9,0.1,0.);
143 fTPCParam->Write(fTPCParam->GetTitle());
148 //_____________________________________________________________________________
149 void AliTPCv1::CreateGeometry()
151 //-------------------------------------------------------------
152 // Creates geometry for Time Projection Chamber version 1
153 // Detailed geometry -- Fast simulation - space points
154 // at the pad-rows centers
155 // Origin M.Kowalski, INP Cracow, Marek.Kowalski@ifj.edu.pl
156 //-----------------------------------------------------------
160 <img src="picts/AliTPC.gif">
165 <img src="picts/AliTPCv1Tree.gif">
170 Int_t *idtmed = fIdtmed->GetArray(); // TPC media
172 Int_t idrotm[120]; // rotation matrices
174 Int_t nRotMat = 0; // actual number of rotation matrices
177 // Mother volume TPC (Air) - all volumes will be positioned in it
232 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
236 //-------------------------------------------------------------------
237 // Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
238 //-------------------------------------------------------------------
280 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
282 //----------------------------------------------------------------
283 // Tpc Outer Contaiment Vessel
284 // mother volume - Al, daughters - composite (sandwich)
285 //----------------------------------------------------------------
327 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
329 // Daughter volumes - sandwich
331 // Tpc SAndwich 1 - Al
337 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
339 // Tpc SAndwich 2 - epoxy glue (I use Lexan)
344 gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
346 // Tpc SAndwich 3 - Tedlar
351 gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
354 // Tpc SAndwich 4 - fiber glass (G10)
359 gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);
361 // Tpc SAndwich 5 - NOMEX honeycomb
366 gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
368 // 5->4->3->2->1->TCOV
371 gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
372 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
373 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
374 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
376 gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
380 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
382 //-------------------------------------------------------
383 // Tpc Outer Field Cage
384 // mother volume - Al, daughters - composite (sandwich)
385 //-------------------------------------------------------
427 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
431 // Tpc SAndwich 6 - Tedlar
437 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
439 // Tpc SAndwich 7 - fiber glass
444 gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
447 // Tpc SAndwich 8 - NOMEX
452 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
456 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
457 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
458 gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
462 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
466 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
470 //--------------------------------------------------------------------
471 // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
472 // Inner containment vessel will be placed directly in the TPC
473 //--------------------------------------------------------------------
503 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
505 // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
511 gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
513 gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
515 //-----------------------------------------------------
516 // Tpc Inner Field Cage
517 // mother volume - Al, daughters - composite (sandwich)
518 //------------------------------------------------------
584 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
586 // daughter volumes - central part
588 // Tpc Sandwich 9 -Tedlar
594 gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3);
596 // Tpc Sandwich 10 - fiber glass (G10)
601 gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
603 // Tpc Sandwich 11 - NOMEX
608 gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
612 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
613 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
615 gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
617 // daughter volumes - outer parts (reinforced)
619 // Tpc Sandwich 12 -Tedlar
625 gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
627 // Tpc Sandwich 13 - fiber glass (G10)
632 gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
634 // Tpc Sandwich 14 - NOMEX
639 gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
643 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
644 gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY");
646 gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
647 gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY");
649 // place this inside the inner insulator
651 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
653 // and now in the TPC...
655 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
657 //---------------------------------------------------------
658 // Tpc Inner Containment vessel - Cones
659 //---------------------------------------------------------
713 gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
715 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
726 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
728 gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
729 gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
732 //---------------------------------------------------------
733 // Tpc Inner Containment vessel - Middle part -Al
734 //---------------------------------------------------------
776 gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
778 // Tpc Sandwich 15 - Al
784 gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
786 // Tpc Sandwich 16 - epoxy glue
791 gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
793 // Tpc Sandwich 17 - Tedlar
798 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
800 // Tpc Sandwich 18 - fiber glass
805 gMC->Gsvolu("TS18","TUBE",idtmed[12],dm,3);
807 // Tpc Sandwich 19 - Nomex
812 gMC->Gsvolu("TS19","TUBE",idtmed[12],dm,3);
814 // 19->18->17->16->15-> TICM
816 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
817 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
818 gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
819 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
821 gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
824 // TPc inner cont. vessel Joints
830 gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
832 gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
833 gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
865 gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
867 gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
868 gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
872 // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
878 gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
880 gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
881 gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY");
885 gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
889 nRotMat++; // prepare for the next rotation matrix
891 //---------------------------------------------------------
892 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
893 // and its daughters (HV membrane, rods, readout chambers)
894 //---------------------------------------------------------
900 gMC->Gsvolu("TDGN","TUBE",idtmed[1],dm,3);
902 // sector opening angles
904 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
905 Float_t outerOpenAngle = fTPCParam->GetOuterAngle();
907 // sector angle shift
909 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
913 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
914 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
916 // All above parameters are identical for inner and outer
917 // sectors. The distinction is kept for the historical reasons
918 // and eventually will disappear.
920 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
921 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
924 //-------------------------------------------------------------------------
925 // Tpc Inner Readout Chambers
926 //-------------------------------------------------------------------------
930 dm[2]= 1.6; // thickness
933 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
935 // this volume will be positioned in the empty space
936 // of the end-cap to avoid overlaps
943 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
946 //------------------------------------------------
947 // Tpc Inner readout chamber Pad Plane
948 //------------------------------------------------
955 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
959 dm[0] -= 1.218511934;
960 dm[1] -= 1.218511934;
963 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
965 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
967 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
970 //----------------------------------------------
971 // Tpc Readout Chambers Empty spaces - for both
972 // inner and outer sectors
973 //----------------------------------------------
975 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
977 // Inner sector - 4 spaces
988 space = rr*tanAlpha-dm[0];
990 for(Int_t nsLow=0;nsLow<4;nsLow++){
993 dm[1]= rr*tanAlpha - space;
997 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1003 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1006 dm[0] = rr*tanAlpha - space;
1012 // dm[1] - this is the dm[1] from the previous TRCE
1016 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
1019 // TPc Space for Connectors
1026 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1034 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1036 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1044 // inner part of the inner sector - 2 x 20 holes
1046 astep = 20.00096874/19.;
1048 alpha = 10.00048437-astep;
1060 for(ncon=0;ncon<20;ncon++){
1066 phi3 = (alpha>0) ? 0. : 180.;
1067 theta3 = TMath::Abs(alpha);
1069 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1073 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1074 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1085 // outer part of the inner sector - 2 x 25 holes
1087 astep = 20.00096874/24.;
1088 alpha = 10.00048437-astep;
1096 for(ncon=0;ncon<25;ncon++){
1102 phi3 = (alpha>0) ? 0. : 180.;
1103 theta3 = TMath::Abs(alpha);
1105 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1109 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1110 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1121 //--------------------------------------------------------------------------
1122 // TPC Outer Readout Chambers
1123 // this is NOT a final design
1124 //--------------------------------------------------------------------------
1128 dm[2]= 1.5; //thickness
1131 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1133 //------------------------------------------------
1134 // Tpc Outer readout chamber Pad Plane
1135 //------------------------------------------------
1139 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1141 dm[0] -= 1.218511934;
1142 dm[1] -= 1.218511934;
1145 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1147 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1149 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1158 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1165 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1172 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1174 //-----------------------------------------------
1175 // Tpc Services Support Wheel
1176 //-----------------------------------------------
1191 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1193 // Tpc Services Wheel Cover
1198 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1200 // Tpc Service wheel Cover Empty space
1207 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1209 // Tpc services Wheel Empty Spaces
1216 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1218 // Tpc Services Wheel Bars
1220 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1230 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1235 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1237 // TPc ELectronics - right now 30% X0 Si
1244 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1245 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1247 //--------------------------------------------------------------------------
1249 //--------------------------------------------------------------------------
1251 // TPc Main Wheel - Al
1257 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1259 //--------------------------------------------------------------------------
1260 // Tpc Empty Space for the Readout chambers
1261 //--------------------------------------------------------------------------
1265 Float_t dR = 0.5*(rUp-rLow);
1267 space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1269 dm[0]= rLow*tanAlpha-space;
1270 dm[1]= rUp*tanAlpha-space;
1274 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1278 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1282 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1284 // Tpc Empty Space Bars - Al (daughters of TESR)
1288 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1292 dm[0]= rLow*tanAlpha-space;
1293 dm[1]= 88.7*tanAlpha-space;
1299 gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1303 dm[0]= 131.65*tanAlpha-space;
1304 dm[1]= 136.5*tanAlpha-space;
1307 zBar = -dR +131.65+dm[3]-rLow;
1309 gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1313 dm[0]= 240.4*tanAlpha-space;
1314 dm[1]= rUp*tanAlpha-space;
1319 gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1322 //------------------------------------------------------
1323 // TPc Lower "S" Sectors
1324 //------------------------------------------------------
1329 Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow();
1330 Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp();
1332 dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1333 dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1334 dm[2] = 0.5*(250. - 5.e-3);
1335 dm[3] = 0.5*(inSecUpEdge-inSecLowEdge);
1337 gMC->Gsvolu("TPLS", "TRD1", idtmed[1], dm, 4); // nonsensitive
1339 //----------------------------------------------------------
1340 // TPc Upper Sectors
1341 //----------------------------------------------------------
1343 Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow();
1344 Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp();
1346 dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1347 dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1348 dm[2] = 0.5*(250. - 5.e-3);
1349 dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge);
1351 gMC->Gsvolu("TPUS", "TRD1", idtmed[1], dm, 4); // nonsensitive
1353 //--------------------------------------------------------
1354 // TPc Sensitive Strips, the same for S and L sectors
1355 //--------------------------------------------------------
1357 gMC->Gsvolu("TPSS","TRD1",idtmed[2],dm,0); // sensitive
1359 Int_t nofStrips,nstr;
1361 Float_t stripThick = 0.01; // 100 microns
1365 nofStrips = fTPCParam->GetNRowLow();
1366 deadSpace = fTPCParam->GetInnerWireMount();
1368 dm[2] = 0.5*(250. - 5.e-3);
1369 dm[3] = 0.5 * stripThick;
1371 for(nstr=0;nstr<nofStrips;nstr++){
1373 r1 = fTPCParam->GetPadRowRadiiLow(nstr);
1374 r2 = r1 + stripThick;
1375 dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1376 dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1377 zs = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge);
1381 gMC->Gsposp("TPSS", nstr+1, "TPLS", 0., 0., zs, 0, "ONLY", dm, 4);
1385 Int_t nsSave = nofStrips;
1389 nofStrips = fTPCParam->GetNRowUp();
1390 deadSpace = fTPCParam->GetOuterWireMount();
1392 dm[2] = 0.5*(250. - 5.e-3);
1393 dm[3] = 0.5 * stripThick;
1395 for(nstr=0;nstr<nofStrips;nstr++){
1397 r1 = fTPCParam->GetPadRowRadiiUp(nstr);
1398 r2 = r1 + stripThick;
1399 dm[0] = r1 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1400 dm[1] = r2 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1401 zs = -ouSecLowEdge -0.5*(ouSecUpEdge-ouSecLowEdge);
1405 gMC->Gsposp("TPSS", nstr+1+nsSave, "TPUS", 0., 0., zs, 0, "ONLY", dm, 4);
1409 //-------------------------------------------------------
1410 // positioning of the empty spaces into the main wheel
1411 // and readout chambers and sectors into the drift gas
1412 //-------------------------------------------------------
1415 Float_t rCenter,xc,yc;
1416 Float_t rInner,rOuter; // center of the inner and outer chamber
1424 for(Int_t ns=0; ns<nInnerSector;ns++){
1426 phi1 = ns * innerOpenAngle + innerAngleShift;
1427 phi1 *= kRaddeg; // in degrees
1429 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1431 if (phi1 > 360.) phi1 -= 360.;
1436 phi3 = ns * innerOpenAngle + innerAngleShift;
1437 phi3 *= kRaddeg; // in degrees
1439 phi3 = (Float_t)TMath::Nint(phi3);
1441 if(phi3 > 360.) phi3 -= 360.;
1445 // "holes"->End plate
1447 xc = rCenter*TMath::Cos(phi3*kDegrad);
1448 yc = rCenter*TMath::Sin(phi3*kDegrad);
1450 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1452 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1454 // TSCE->TSWC (services wheel volumes)
1456 xc = 166.142*TMath::Cos(phi3*kDegrad);
1457 yc = 166.142*TMath::Sin(phi3*kDegrad);
1459 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1460 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1463 // readout chambers->TDGN (drift gas)
1465 xc = rInner*TMath::Cos(phi3*kDegrad);
1466 yc = rInner*TMath::Sin(phi3*kDegrad);
1468 gMC->Gspos("TIRC",ns+1,"TDGN",xc,yc,252.,idrotm[nRotMat],"ONLY");
1470 // here lower sectors
1472 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1473 gMC->Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1477 xc = rOuter*TMath::Cos(phi3*kDegrad);
1478 yc = rOuter*TMath::Sin(phi3*kDegrad);
1480 gMC->Gspos("TORC",ns+1,"TDGN",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1482 // here upper sectors
1484 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1485 gMC->Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1490 theta2 = 0.; // reflection
1492 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1494 xc = rInner*TMath::Cos(phi3*kDegrad);
1495 yc = rInner*TMath::Sin(phi3*kDegrad);
1497 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGN",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1499 xc = rOuter*TMath::Cos(phi3*kDegrad);
1500 yc = rOuter*TMath::Sin(phi3*kDegrad);
1502 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGN",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1509 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1510 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1512 //---------------------------------------------------------
1513 // Tpc High Voltage Membrane - 100 microns of mylar
1514 //---------------------------------------------------------
1520 gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1522 gMC->Gspos("THVM",1,"TDGN",0.,0.,0.,0,"ONLY");
1524 // Tpc High Voltage membrane Holders
1526 gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1536 gMC->Gsposp("THVH",1,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1544 gMC->Gsposp("THVH",2,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1546 //----------------------------------------------------------
1547 // TPc Support Rods - MAKROLON
1548 //----------------------------------------------------------
1553 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1556 for(Int_t nrod=0;nrod<18;nrod++){
1557 Float_t angle=innerOpenAngle*(Float_t)nrod;
1559 xc=81.5*TMath::Cos(angle);
1560 yc=81.5*TMath::Sin(angle);
1564 gMC->Gsposp("TPSR",nrod+1,"TDGN",xc,yc,126.9,0,"ONLY",dm,3);
1565 gMC->Gsposp("TPSR",nrod+19,"TDGN",xc,yc,-126.9,0,"ONLY",dm,3);
1569 xc=254.25*TMath::Cos(angle);
1570 yc=254.25*TMath::Sin(angle);
1572 // rod number 54 contans the HV cable
1575 gMC->Gsposp("TPSR",nrod+37,"TDGN",xc,yc,127.,0,"ONLY",dm,3);
1576 gMC->Gsposp("TPSR",nrod+54,"TDGN",xc,yc,-127.,0,"ONLY",dm,3);
1581 //----------------------------------------------------------
1582 // Tpc High Voltage Rod - MAKROLON + Copper cable
1583 //----------------------------------------------------------
1585 // rod with cable (Left)
1591 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1599 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1607 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1609 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1610 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1612 // rod without cable
1618 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1620 gMC->Gspos("THVL",1,"TDGN",xc,yc,-127.,0,"ONLY");
1621 gMC->Gspos("THVR",1,"TDGN",xc,yc,127.,0,"ONLY");
1623 gMC->Gspos("TDGN",1,"TPC ",0.,0.,0.,0,"ONLY");
1625 // services wheel cover -> wheel
1628 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1629 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1632 // put the wheel into the TPC
1634 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1635 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1639 gMC->Gsord("TPMW",6);
1640 gMC->Gsord("TSSW",6);
1641 gMC->Gsord("TSWC",6);
1642 gMC->Gsord("TPLS",3);
1643 gMC->Gsord("TPUS",3);
1644 gMC->Gsord("TDGN",6);
1647 // put the TPC into ALIC (main mother volume)
1649 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1653 } // end of function
1655 //_____________________________________________________________________________
1656 void AliTPCv1::DrawDetector()
1659 // Draw a shaded view of the Time Projection Chamber version 1
1662 // Set everything unseen
1663 gMC->Gsatt("*", "seen", -1);
1665 // Set ALIC mother transparent
1666 gMC->Gsatt("ALIC","SEEN",0);
1668 // Set the volumes visible
1669 gMC->Gsatt("TPC ","SEEN",0);
1670 gMC->Gsatt("TOIN","SEEN",1);
1671 gMC->Gsatt("TOIN","COLO",7);
1672 gMC->Gsatt("TOCV","SEEN",1);
1673 gMC->Gsatt("TOCV","COLO",4);
1674 gMC->Gsatt("TSA1","SEEN",0);
1675 gMC->Gsatt("TSA2","SEEN",0);
1676 gMC->Gsatt("TSA3","SEEN",0);
1677 gMC->Gsatt("TSA4","SEEN",0);
1678 gMC->Gsatt("TSA5","SEEN",0);
1679 gMC->Gsatt("TOFC","SEEN",1);
1680 gMC->Gsatt("TOFC","COLO",4);
1681 gMC->Gsatt("TSA6","SEEN",0);
1682 gMC->Gsatt("TSA7","SEEN",0);
1683 gMC->Gsatt("TSA8","SEEN",0);
1684 gMC->Gsatt("TIIN","SEEN",1);
1685 gMC->Gsatt("TIIN","COLO",7);
1686 gMC->Gsatt("TII1","SEEN",0);
1687 gMC->Gsatt("TIFC","SEEN",1);
1688 gMC->Gsatt("TIFC","COLO",4);
1689 gMC->Gsatt("TSA9","SEEN",0);
1690 gMC->Gsatt("TS10","SEEN",0);
1691 gMC->Gsatt("TS11","SEEN",0);
1692 gMC->Gsatt("TS12","SEEN",0);
1693 gMC->Gsatt("TS13","SEEN",0);
1694 gMC->Gsatt("TS14","SEEN",0);
1695 gMC->Gsatt("TICC","SEEN",0);
1696 gMC->Gsatt("TICM","SEEN",0);
1697 gMC->Gsatt("TS15","SEEN",0);
1698 gMC->Gsatt("TS16","SEEN",0);
1699 gMC->Gsatt("TS17","SEEN",0);
1700 gMC->Gsatt("TS18","SEEN",0);
1701 gMC->Gsatt("TS19","SEEN",0);
1702 gMC->Gsatt("TPJ1","SEEN",0);
1703 gMC->Gsatt("TPJ2","SEEN",0);
1704 gMC->Gsatt("TICS","SEEN",0);
1705 gMC->Gsatt("TDGN","SEEN",0);
1706 gMC->Gsatt("TIRC","SEEN",0);
1707 gMC->Gsatt("TIC1","SEEN",1);
1708 gMC->Gsatt("TIPP","SEEN",0);
1709 gMC->Gsatt("TIC3","SEEN",0);
1710 gMC->Gsatt("TRCE","SEEN",0);
1711 gMC->Gsatt("TPSC","SEEN",0);
1712 gMC->Gsatt("TPCC","SEEN",0);
1713 gMC->Gsatt("TORC","SEEN",0);
1714 gMC->Gsatt("TOPP","SEEN",0);
1715 gMC->Gsatt("TOC3","SEEN",0);
1716 gMC->Gsatt("TOC1","SEEN",1);
1717 gMC->Gsatt("TSSW","SEEN",1);
1718 gMC->Gsatt("TSWC","SEEN",1);
1719 gMC->Gsatt("TSSW","COLO",3);
1720 gMC->Gsatt("TSWC","COLO",3);
1721 gMC->Gsatt("TSCE","COLO",6);
1722 gMC->Gsatt("TSCE","SEEN",1);
1723 gMC->Gsatt("TWES","SEEN",0);
1724 gMC->Gsatt("TSWB","SEEN",0);
1725 gMC->Gsatt("TPEL","SEEN",0);
1726 gMC->Gsatt("TPMW","SEEN",1);
1727 gMC->Gsatt("TESR","SEEN",1);
1728 gMC->Gsatt("TPMW","COLO",12);
1729 gMC->Gsatt("TIC1","COLO",5);
1730 gMC->Gsatt("TOC1","COLO",5);
1731 gMC->Gsatt("TESB","SEEN",0);
1732 gMC->Gsatt("THVM","SEEN",1);
1733 gMC->Gsatt("THVM","COLO",11);
1734 gMC->Gsatt("THVH","SEEN",0);
1735 gMC->Gsatt("TPSR","SEEN",0);
1736 gMC->Gsatt("THVL","SEEN",0);
1737 gMC->Gsatt("THVC","SEEN",0);
1738 gMC->Gsatt("THVE","SEEN",0);
1739 gMC->Gsatt("THVR","SEEN",0);
1740 gMC->Gsatt("TPSS","SEEN",0);
1741 gMC->Gsatt("TPUS","SEEN",0);
1742 gMC->Gsatt("TPLS","SEEN",0);
1745 gMC->Gdopt("hide", "on");
1746 gMC->Gdopt("shad", "on");
1747 gMC->Gsatt("*", "fill", 7);
1748 gMC->SetClipBox(".");
1749 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1750 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1751 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1752 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1753 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1754 gMC->DefaultRange();
1755 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1756 gMC->Gdhead(1111, "Time Projection Chamber");
1757 gMC->Gdman(18, 4, "MAN");
1758 gMC->Gdopt("hide","off");
1761 //_____________________________________________________________________________
1762 void AliTPCv1::CreateMaterials()
1765 // Define materials for Time Projection Chamber
1767 AliTPC::CreateMaterials();
1770 //_____________________________________________________________________________
1771 void AliTPCv1::Init()
1774 // Initialises TPC detector after it has been created
1777 fIdSens=gMC->VolId("TPSS"); // sensitive strip
1778 fIdLSec=gMC->VolId("TPLS"); // lower sector
1779 fIdUSec=gMC->VolId("TPUS"); // upper sector
1781 printf("TPC version 1 initialized\n");
1784 //_____________________________________________________________________________
1785 void AliTPCv1::StepManager()
1788 // Called at every step in the Time Projection Chamber
1796 if(gMC->TrackCharge() && gMC->IsTrackEntering()) {
1799 // Only charged tracks entering the sensitive volume
1802 id = gMC->CurrentVolID(copy);
1806 // sensitive volume (strip)
1808 vol[1]= copy-1; // row number (absolute)
1812 id = gMC->CurrentVolOffID(1,copy);
1818 vol[0] = copy-1; // sector number
1825 vol[0] = copy-1+fTPCParam->GetNInnerSector(); // sector number
1826 vol[1] -= fTPCParam->GetNRowLow(); // row number
1832 // because Jouri wants to have this
1834 gMC->TrackMomentum(p);
1838 hits[3]=0.; // this hit has no energy loss
1839 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1841 AddHit(gAlice->CurrentTrack(), vol,hits); // M.I.
1843 gMC->TrackPosition(p);
1847 hits[3]=0.; // this hit has no energy loss
1848 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1850 AddHit(gAlice->CurrentTrack(), vol,hits); // M.I.
1854 gMC->TrackPosition(p);
1855 for(i=0;i<3;++i) hits[i]=p[i];
1856 hits[3]=1; //I'd like to have something positive here (I.Belikov)
1857 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1859 AddHit(gAlice->CurrentTrack(), vol,hits); // M.I.
1866 //_____________________________________________________________________________