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.29.6.2 2002/07/24 10:09:01 alibrary
21 Revision 1.29 2002/01/21 17:12:00 kowal2
22 New track hits structure using root containers
24 Revision 1.28 2001/06/12 07:07:41 kowal2
25 New files for folder and stack
27 Revision 1.27 2001/05/08 16:03:06 kowal2
28 Geometry update according to the latest technical spec.
30 Revision 1.26 2001/04/27 15:23:07 kowal2
31 Correct materian in the central part of the inner containment vessel
33 Revision 1.25 2001/04/26 06:15:12 kowal2
34 Corrected bug in the inner containment vessel (cones)
36 Revision 1.24 2001/04/24 11:22:01 kowal2
37 Protection against too small betagamma
39 Revision 1.23 2001/04/24 11:17:33 kowal2
42 Revision 1.22 2001/03/13 13:07:34 kowal2
43 Corrected bug in the TPC mother volume geometry.
46 Revision 1.21 2000/11/30 11:48:50 kowal2
47 TLorentzVector.h adde to satisfy the latest changes by Federico
49 Revision 1.20 2000/11/14 10:48:57 kowal2
50 Correct material used for TSA4. Thanks to J. Barbosa.
52 Revision 1.19 2000/11/06 17:24:10 kowal2
53 Corrected bug in the outer containment vessel and
54 the outer field cage geometry.
57 Revision 1.18 2000/11/02 16:55:24 kowal2
58 Corrected bug in the inner containment vessel geometry.
61 Revision 1.17 2000/11/02 07:24:11 kowal2
62 Correction in the TPC geometry.
63 Changes due to the new hit structure.
65 Revision 1.16 2000/10/02 21:28:18 fca
66 Removal of useless dependecies via forward declarations
68 Revision 1.15 2000/07/10 20:57:39 hristov
69 Update of TPC code and macros by M.Kowalski
71 Revision 1.14 2000/06/30 12:07:50 kowal2
72 Updated from the TPC-PreRelease branch
74 Revision 1.13.2.4 2000/06/26 07:39:42 kowal2
75 Changes to obey the coding rules
77 Revision 1.13.2.3 2000/06/25 08:38:41 kowal2
78 Splitted from AliTPCtracking
80 Revision 1.13.2.2 2000/06/16 12:58:13 kowal2
81 Changed parameter settings
83 Revision 1.13.2.1 2000/06/09 07:15:07 kowal2
85 Defaults loaded automatically (hard-wired)
86 Optional parameters can be set via macro called in the constructor
88 Revision 1.13 2000/05/15 10:00:30 kowal2
89 Corrected bug in the TPC geometry, thanks to Ivana Hrivnacova
91 Revision 1.12 2000/04/17 09:37:33 kowal2
92 removed obsolete AliTPCDigitsDisplay.C
94 Revision 1.11.8.2 2000/04/10 08:36:12 kowal2
96 Updated readout chambers
97 Some modifications to StepManager by M. Kowalski
99 Revision 1.11.8.1 2000/04/10 07:56:53 kowal2
100 Not used anymore - removed
102 Revision 1.11 1999/11/04 17:28:07 fca
103 Correct barrel part of HV Degrader
105 Revision 1.10 1999/10/14 16:52:08 fca
106 Only use PDG codes and not GEANT ones
108 Revision 1.9 1999/10/08 06:27:23 fca
109 Corrected bug in the HV degrader geometry, thanks to G.Tabary
111 Revision 1.8 1999/10/04 13:39:55 fca
112 Correct array index problem
114 Revision 1.7 1999/09/29 09:24:34 fca
115 Introduction of the Copyright and cvs Log
120 ///////////////////////////////////////////////////////////////////////////////
122 // Time Projection Chamber version 3 -- detailed TPC and slow simulation //
126 <img src="picts/AliTPCv3Class.gif">
131 ///////////////////////////////////////////////////////////////////////////////
135 #include "AliTPCv3.h"
138 #include "AliConst.h"
139 #include "AliTPCDigitsArray.h"
140 #include"AliTPCParam.h"
141 #include"AliTPCParamSR.h"
143 #include <TInterpreter.h>
144 #include "TLorentzVector.h"
145 #include "AliTPCTrackHitsV2.h"
148 //_____________________________________________________________________________
150 AliTPCv3::AliTPCv3(){
156 //_____________________________________________________________________________
157 AliTPCv3::AliTPCv3(const char *name, const char *title) :
161 // Standard constructor for Time Projection Chamber version 3
164 SetBufferSize(128000);
167 SetGasMixt(2,20,10,-1,0.9,0.1,0.);
170 fTPCParam->Write(fTPCParam->GetTitle());
175 //_____________________________________________________________________________
176 void AliTPCv3::CreateGeometry()
179 // Creation of the TPC coarse geometry (version 3)
180 // The whole drift volume is sensitive
181 // Origin Marek Kowalski Cracow
185 <img src="picts/AliTPCgif">
190 <img src="picts/AliTPCv3Tree.gif">
195 Int_t *idtmed = fIdtmed->GetArray(); // TPC media
197 Int_t idrotm[120]; // rotation matrices
199 Int_t nRotMat = 0; // actual number of rotation matrices
203 // Mother volume (Air) - all volumes will be positioned in it
258 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
262 //-------------------------------------------------------------------
263 // Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
264 //-------------------------------------------------------------------
306 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
308 //----------------------------------------------------------------
309 // Tpc Outer Contaiment Vessel
310 // mother volume - Al, daughters - composite (sandwich)
311 //----------------------------------------------------------------
353 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
355 // Daughter volumes - sandwich
357 // Tpc SAndwich 1 - Al
363 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
365 // Tpc SAndwich 2 - epoxy glue (I use Lexan)
370 gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
372 // Tpc SAndwich 3 - Tedlar
377 gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
380 // Tpc SAndwich 4 - fiber glass (G10)
385 gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);
387 // Tpc SAndwich 5 - NOMEX honeycomb
392 gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
394 // 5->4->3->2->1->TCOV
397 gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
398 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
399 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
400 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
402 gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
406 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
408 //-------------------------------------------------------
409 // Tpc Outer Field Cage
410 // mother volume - Al, daughters - composite (sandwich)
411 //-------------------------------------------------------
453 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
457 // Tpc SAndwich 6 - Tedlar
463 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
465 // Tpc SAndwich 7 - fiber glass
470 gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
473 // Tpc SAndwich 8 - NOMEX
478 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
482 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
483 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
484 gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
488 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
492 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
496 //--------------------------------------------------------------------
497 // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
498 // Inner containment vessel will be placed directly in the TPC
499 //--------------------------------------------------------------------
529 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
531 // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
537 gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
539 gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
541 //-----------------------------------------------------
542 // Tpc Inner Field Cage
543 // mother volume - Al, daughters - composite (sandwich)
544 //------------------------------------------------------
610 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
612 // daughter volumes - central part
614 // Tpc Sandwich 9 -Tedlar
620 gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3);
622 // Tpc Sandwich 10 - fiber glass (G10)
627 gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
629 // Tpc Sandwich 11 - NOMEX
634 gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
638 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
639 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
641 gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
643 // daughter volumes - outer parts (reinforced)
645 // Tpc Sandwich 12 -Tedlar
651 gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
653 // Tpc Sandwich 13 - fiber glass (G10)
658 gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
660 // Tpc Sandwich 14 - NOMEX
665 gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
669 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
670 gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY");
672 gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
673 gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY");
675 // place this inside the inner insulator
677 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
679 // and now in the TPC...
681 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
683 //---------------------------------------------------------
684 // Tpc Inner Containment vessel - Cones
685 //---------------------------------------------------------
739 gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
741 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
752 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
754 gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
755 gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
758 //---------------------------------------------------------
759 // Tpc Inner Containment vessel - Middle part -Al
760 //---------------------------------------------------------
802 gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
804 // Tpc Sandwich 15 - Al
810 gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
812 // Tpc Sandwich 16 - epoxy glue
817 gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
819 // Tpc Sandwich 17 - Tedlar
824 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
826 // Tpc Sandwich 18 - carbon fiber
831 gMC->Gsvolu("TS18","TUBE",idtmed[15],dm,3);
833 // Tpc Sandwich 19 - Nomex
838 gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3);
840 // 19->18->17->16->15-> TICM
842 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
843 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
844 gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
845 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
847 gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
850 // TPc inner cont. vessel Joints
856 gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
858 gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
859 gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
891 gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
893 gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
894 gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
898 // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
904 gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
906 gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
907 gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY");
911 gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
915 nRotMat++; // prepare for the next rotation matrix
917 //---------------------------------------------------------
918 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
919 // and its daughters (HV membrane, rods, readout chambers)
920 //---------------------------------------------------------
926 gMC->Gsvolu("TDGS","TUBE",idtmed[2],dm,3);
928 // sector opening angles
930 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
932 // sector angle shift
934 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
938 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
939 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
941 // All above parameters are identical for inner and outer
942 // sectors. The distinction is kept for the historical reasons
943 // and eventually will disappear.
945 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
946 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
949 //-------------------------------------------------------------------------
950 // Tpc Inner Readout Chambers
951 //-------------------------------------------------------------------------
955 dm[2]= 1.6; // thickness
958 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
960 // this volume will be positioned in the empty space
961 // of the end-cap to avoid overlaps
968 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
971 //------------------------------------------------
972 // Tpc Inner readout chamber Pad Plane
973 //------------------------------------------------
980 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
984 dm[0] -= 1.218511934;
985 dm[1] -= 1.218511934;
988 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
990 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
992 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
995 //----------------------------------------------
996 // Tpc Readout Chambers Empty spaces - for both
997 // inner and outer sectors
998 //----------------------------------------------
1000 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
1002 // Inner sector - 4 spaces
1013 space = rr*tanAlpha-dm[0];
1015 for(Int_t nsLow=0;nsLow<4;nsLow++){
1018 dm[1]= rr*tanAlpha - space;
1022 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
1028 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
1031 dm[0] = rr*tanAlpha - space;
1037 // dm[1] - this is the dm[1] from the previous TRCE
1041 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
1044 // TPc Space for Connectors
1051 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1059 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1061 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1069 // inner part of the inner sector - 2 x 20 holes
1071 astep = 20.00096874/19.;
1073 alpha = 10.00048437-astep;
1085 for(ncon=0;ncon<20;ncon++){
1091 phi3 = (alpha>0) ? 0. : 180.;
1092 theta3 = TMath::Abs(alpha);
1094 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1098 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1099 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1110 // outer part of the inner sector - 2 x 25 holes
1112 astep = 20.00096874/24.;
1113 alpha = 10.00048437-astep;
1121 for(ncon=0;ncon<25;ncon++){
1127 phi3 = (alpha>0) ? 0. : 180.;
1128 theta3 = TMath::Abs(alpha);
1130 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1134 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1135 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1146 //--------------------------------------------------------------------------
1147 // TPC Outer Readout Chambers
1148 // this is NOT a final design
1149 //--------------------------------------------------------------------------
1153 dm[2]= 1.5; //thickness
1156 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1158 //------------------------------------------------
1159 // Tpc Outer readout chamber Pad Plane
1160 //------------------------------------------------
1164 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1166 dm[0] -= 1.218511934;
1167 dm[1] -= 1.218511934;
1170 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1172 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1174 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1183 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1190 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1197 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1199 //-----------------------------------------------
1200 // Tpc Services Support Wheel
1201 //-----------------------------------------------
1216 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1218 // Tpc Services Wheel Cover
1223 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1225 // Tpc Service wheel Cover Empty space
1232 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1234 // Tpc services Wheel Empty Spaces
1241 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1243 // Tpc Services Wheel Bars
1245 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1255 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1260 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1262 // TPc ELectronics - right now 30% X0 Si
1269 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1270 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1272 //--------------------------------------------------------------------------
1274 //--------------------------------------------------------------------------
1276 // TPc Main Wheel - Al
1282 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1284 //--------------------------------------------------------------------------
1285 // Tpc Empty Space for the Readout chambers
1286 //--------------------------------------------------------------------------
1290 Float_t dR = 0.5*(rUp-rLow);
1292 space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1294 dm[0]= rLow*tanAlpha-space;
1295 dm[1]= rUp*tanAlpha-space;
1299 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1303 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1307 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1309 // Tpc Empty Space Bars - Al (daughters of TESR)
1313 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1317 dm[0]= rLow*tanAlpha-space;
1318 dm[1]= 88.7*tanAlpha-space;
1324 gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1328 dm[0]= 131.65*tanAlpha-space;
1329 dm[1]= 136.5*tanAlpha-space;
1332 zBar = -dR +131.65+dm[3]-rLow;
1334 gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1338 dm[0]= 240.4*tanAlpha-space;
1339 dm[1]= rUp*tanAlpha-space;
1344 gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1346 // positioning of the empty spaces into the main wheel
1348 Float_t rCenter,xc,yc;
1349 Float_t rInner,rOuter; // center of the inner and outer chamber
1357 for(Int_t ns=0; ns<nInnerSector;ns++){
1359 phi1 = ns * innerOpenAngle + innerAngleShift;
1360 phi1 *= kRaddeg; // in degrees
1362 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1364 if (phi1 > 360.) phi1 -= 360.;
1369 phi3 = ns * innerOpenAngle + innerAngleShift;
1370 phi3 *= kRaddeg; // in degrees
1372 phi3 = (Float_t)TMath::Nint(phi3);
1374 if(phi3 > 360.) phi3 -= 360.;
1378 // "holes"->End plate
1380 xc = rCenter*TMath::Cos(phi3*kDegrad);
1381 yc = rCenter*TMath::Sin(phi3*kDegrad);
1383 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1385 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1387 // TSCE->TSWC (services wheel volumes)
1389 xc = 166.142*TMath::Cos(phi3*kDegrad);
1390 yc = 166.142*TMath::Sin(phi3*kDegrad);
1392 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1393 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1396 // readout chambers->TDGS (drift gas)
1398 xc = rInner*TMath::Cos(phi3*kDegrad);
1399 yc = rInner*TMath::Sin(phi3*kDegrad);
1401 gMC->Gspos("TIRC",ns+1,"TDGS",xc,yc,252.,idrotm[nRotMat],"ONLY");
1403 xc = rOuter*TMath::Cos(phi3*kDegrad);
1404 yc = rOuter*TMath::Sin(phi3*kDegrad);
1406 gMC->Gspos("TORC",ns+1,"TDGS",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1410 theta2 = 0.; // reflection
1412 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1414 xc = rInner*TMath::Cos(phi3*kDegrad);
1415 yc = rInner*TMath::Sin(phi3*kDegrad);
1417 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGS",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1419 xc = rOuter*TMath::Cos(phi3*kDegrad);
1420 yc = rOuter*TMath::Sin(phi3*kDegrad);
1422 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGS",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1429 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1430 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1432 //---------------------------------------------------------
1433 // Tpc High Voltage Membrane - 100 microns of mylar
1434 //---------------------------------------------------------
1440 gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1442 gMC->Gspos("THVM",1,"TDGS",0.,0.,0.,0,"ONLY");
1444 // Tpc High Voltage membrane Holders
1446 gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1456 gMC->Gsposp("THVH",1,"TDGS",0.,0.,0.,0,"ONLY",dm,3);
1464 gMC->Gsposp("THVH",2,"TDGS",0.,0.,0.,0,"ONLY",dm,3);
1466 //----------------------------------------------------------
1467 // TPc Support Rods - MAKROLON
1468 //----------------------------------------------------------
1473 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1476 for(Int_t nrod=0;nrod<18;nrod++){
1477 Float_t angle=innerOpenAngle*(Float_t)nrod;
1479 xc=81.5*TMath::Cos(angle);
1480 yc=81.5*TMath::Sin(angle);
1484 gMC->Gsposp("TPSR",nrod+1,"TDGS",xc,yc,126.9,0,"ONLY",dm,3);
1485 gMC->Gsposp("TPSR",nrod+19,"TDGS",xc,yc,-126.9,0,"ONLY",dm,3);
1489 xc=254.25*TMath::Cos(angle);
1490 yc=254.25*TMath::Sin(angle);
1492 // rod number 54 contans the HV cable
1495 gMC->Gsposp("TPSR",nrod+37,"TDGS",xc,yc,127.,0,"ONLY",dm,3);
1496 gMC->Gsposp("TPSR",nrod+54,"TDGS",xc,yc,-127.,0,"ONLY",dm,3);
1501 //----------------------------------------------------------
1502 // Tpc High Voltage Rod - MAKROLON + Copper cable
1503 //----------------------------------------------------------
1505 // rod with cable (Left)
1511 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1519 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1527 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1529 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1530 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1532 // rod without cable
1538 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1540 gMC->Gspos("THVL",1,"TDGS",xc,yc,-127.,0,"ONLY");
1541 gMC->Gspos("THVR",1,"TDGS",xc,yc,127.,0,"ONLY");
1543 gMC->Gspos("TDGS",1,"TPC ",0.,0.,0.,0,"ONLY");
1545 // services wheel cover -> wheel
1548 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1549 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1552 // put the wheel into the TPC
1554 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1555 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1559 gMC->Gsord("TPMW",6);
1560 gMC->Gsord("TSSW",6);
1561 gMC->Gsord("TSWC",6);
1563 // put the TPC into ALIC (main mother volume)
1565 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1568 } // end of function
1570 //_____________________________________________________________________________
1571 void AliTPCv3::DrawDetector()
1574 // Draw a shaded view of the Time Projection Chamber version 3
1578 // Set everything unseen
1579 gMC->Gsatt("*", "seen", -1);
1581 // Set ALIC mother transparent
1582 gMC->Gsatt("ALIC","SEEN",0);
1584 // Set the volumes visible
1587 gMC->Gsatt("TPC ","SEEN",0);
1588 gMC->Gsatt("TOIN","SEEN",1);
1589 gMC->Gsatt("TOIN","COLO",7);
1590 gMC->Gsatt("TOCV","SEEN",1);
1591 gMC->Gsatt("TOCV","COLO",4);
1592 gMC->Gsatt("TSA1","SEEN",0);
1593 gMC->Gsatt("TSA2","SEEN",0);
1594 gMC->Gsatt("TSA3","SEEN",0);
1595 gMC->Gsatt("TSA4","SEEN",0);
1596 gMC->Gsatt("TSA5","SEEN",0);
1597 gMC->Gsatt("TOFC","SEEN",1);
1598 gMC->Gsatt("TOFC","COLO",4);
1599 gMC->Gsatt("TSA6","SEEN",0);
1600 gMC->Gsatt("TSA7","SEEN",0);
1601 gMC->Gsatt("TSA8","SEEN",0);
1602 gMC->Gsatt("TIIN","SEEN",1);
1603 gMC->Gsatt("TIIN","COLO",7);
1604 gMC->Gsatt("TII1","SEEN",0);
1605 gMC->Gsatt("TIFC","SEEN",1);
1606 gMC->Gsatt("TIFC","COLO",4);
1607 gMC->Gsatt("TSA9","SEEN",0);
1608 gMC->Gsatt("TS10","SEEN",0);
1609 gMC->Gsatt("TS11","SEEN",0);
1610 gMC->Gsatt("TS12","SEEN",0);
1611 gMC->Gsatt("TS13","SEEN",0);
1612 gMC->Gsatt("TS14","SEEN",0);
1613 gMC->Gsatt("TICC","SEEN",0);
1614 gMC->Gsatt("TICM","SEEN",0);
1615 gMC->Gsatt("TS15","SEEN",0);
1616 gMC->Gsatt("TS16","SEEN",0);
1617 gMC->Gsatt("TS17","SEEN",0);
1618 gMC->Gsatt("TS18","SEEN",0);
1619 gMC->Gsatt("TS19","SEEN",0);
1620 gMC->Gsatt("TPJ1","SEEN",0);
1621 gMC->Gsatt("TPJ2","SEEN",0);
1622 gMC->Gsatt("TICS","SEEN",0);
1623 gMC->Gsatt("TDGS","SEEN",0);
1624 gMC->Gsatt("TIRC","SEEN",0);
1625 gMC->Gsatt("TIC1","SEEN",1);
1626 gMC->Gsatt("TIPP","SEEN",0);
1627 gMC->Gsatt("TIC3","SEEN",0);
1628 gMC->Gsatt("TRCE","SEEN",0);
1629 gMC->Gsatt("TPSC","SEEN",0);
1630 gMC->Gsatt("TPCC","SEEN",0);
1631 gMC->Gsatt("TORC","SEEN",0);
1632 gMC->Gsatt("TOPP","SEEN",0);
1633 gMC->Gsatt("TOC3","SEEN",0);
1634 gMC->Gsatt("TOC1","SEEN",1);
1635 gMC->Gsatt("TSSW","SEEN",1);
1636 gMC->Gsatt("TSWC","SEEN",1);
1637 gMC->Gsatt("TSSW","COLO",3);
1638 gMC->Gsatt("TSWC","COLO",3);
1639 gMC->Gsatt("TSCE","COLO",6);
1640 gMC->Gsatt("TSCE","SEEN",1);
1641 gMC->Gsatt("TWES","SEEN",0);
1642 gMC->Gsatt("TSWB","SEEN",0);
1643 gMC->Gsatt("TPEL","SEEN",0);
1644 gMC->Gsatt("TPMW","SEEN",1);
1645 gMC->Gsatt("TESR","SEEN",1);
1646 gMC->Gsatt("TPMW","COLO",12);
1647 gMC->Gsatt("TIC1","COLO",5);
1648 gMC->Gsatt("TOC1","COLO",5);
1649 gMC->Gsatt("TESB","SEEN",0);
1650 gMC->Gsatt("THVM","SEEN",1);
1651 gMC->Gsatt("THVM","COLO",11);
1652 gMC->Gsatt("THVH","SEEN",0);
1653 gMC->Gsatt("TPSR","SEEN",0);
1654 gMC->Gsatt("THVL","SEEN",0);
1655 gMC->Gsatt("THVC","SEEN",0);
1656 gMC->Gsatt("THVE","SEEN",0);
1657 gMC->Gsatt("THVR","SEEN",0);
1660 gMC->Gdopt("hide", "on");
1661 gMC->Gdopt("shad", "on");
1662 gMC->Gsatt("*", "fill", 7);
1663 gMC->SetClipBox(".");
1664 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1665 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1666 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1667 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1668 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1669 gMC->DefaultRange();
1670 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1671 gMC->Gdhead(1111, "Time Projection Chamber");
1672 gMC->Gdman(18, 4, "MAN");
1673 gMC->Gdopt("hide","off");
1676 //_____________________________________________________________________________
1677 void AliTPCv3::CreateMaterials()
1680 // Define materials for version 2 of the Time Projection Chamber
1685 AliTPC::CreateMaterials();
1688 //_____________________________________________________________________________
1689 void AliTPCv3::Init()
1692 // Initialises version 3 of the TPC after that it has been built
1694 Int_t *idtmed = fIdtmed->GetArray();
1698 fIdSens=gMC->VolId("TDGS"); // drift gas as a sensitive volume
1700 gMC->SetMaxNStep(30000); // max. number of steps increased
1702 gMC->Gstpar(idtmed[2],"LOSS",5);
1704 printf("%s: *** TPC version 3 initialized***\n",ClassName());
1706 printf("%s: Maximum number of steps = %d\n",ClassName(),gMC->GetMaxNStep());
1708 // printf("*** TPC version 3 initialized ***\n");
1709 // printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
1715 //_____________________________________________________________________________
1716 void AliTPCv3::StepManager()
1719 // Called for every step in the Time Projection Chamber
1723 // parameters used for the energy loss calculations
1725 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1726 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1727 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1730 const Float_t kbig = 1.e10;
1742 gMC->SetMaxStep(kbig);
1744 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1746 Float_t charge = gMC->TrackCharge();
1748 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1751 id=gMC->CurrentVolID(copy);
1753 // Check the sensitive volume
1755 if (id != fIdSens) return;
1758 // charged particle is in the sensitive volume
1761 if(gMC->TrackStep() > 0) {
1764 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1765 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1767 gMC->TrackPosition(pos);
1773 // check the selected side of the TPC
1776 if(fSide && fSide*hits[2]<=0.) return;
1778 hits[3]=(Float_t)nel;
1782 AddHit(gAlice->CurrentTrack(), vol,hits); //MI change
1786 // Stemax calculation for the next step
1790 gMC->TrackMomentum(mom);
1791 Float_t ptot=mom.Rho();
1792 Float_t betaGamma = ptot/gMC->TrackMass();
1794 Int_t pid=gMC->TrackPid();
1795 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1797 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1801 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3);
1802 pp=kprim*BetheBloch(betaGamma);
1803 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1806 Double_t rnd = gMC->GetRandom()->Rndm();
1808 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1812 //_____________________________________________________________________________
1813 Float_t AliTPCv3::BetheBloch(Float_t bg)
1816 // Bethe-Bloch energy loss formula
1818 const Double_t kp1=0.76176e-1;
1819 const Double_t kp2=10.632;
1820 const Double_t kp3=0.13279e-4;
1821 const Double_t kp4=1.8631;
1822 const Double_t kp5=1.9479;
1824 Double_t dbg = (Double_t) bg;
1826 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
1828 Double_t aa = TMath::Power(beta,kp4);
1829 Double_t bb = TMath::Power(1./dbg,kp5);
1831 bb=TMath::Log(kp3+bb);
1833 return ((Float_t)((kp2-aa-bb)*kp1/aa));