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 2 -- detailed TPC and slow simulation //
25 <img src="picts/AliTPCv2Class.gif">
30 ///////////////////////////////////////////////////////////////////////////////
34 #include <TLorentzVector.h>
37 #include <TVirtualMC.h>
43 #include "AliTPCDigitsArray.h"
44 #include "AliTPCParam.h"
45 #include "AliTPCParamSR.h"
46 #include "AliTPCTrackHitsV2.h"
51 //_____________________________________________________________________________
52 AliTPCv2::AliTPCv2(const char *name, const char *title) :
56 // Standard constructor for Time Projection Chamber version 2
62 SetBufferSize(128000);
64 SetGasMixt(2,20,10,-1,0.9,0.1,0.); // Ne-CO2 90-10
70 SetSecLows(1, 2, 3, 19, 20, 21);
71 SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
72 SetSens(1); // sensitive strips set
75 fTPCParam->Write(fTPCParam->GetTitle());
78 //_____________________________________________________________________________
79 void AliTPCv2::CreateGeometry()
82 // Create the geometry of Time Projection Chamber version 2
86 <img src="picts/AliTPC.gif">
91 <img src="picts/AliTPCv2Tree.gif">
96 Int_t *idtmed = fIdtmed->GetArray();
107 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
108 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
110 // ---------------------------------------------------
111 // sector specification check
112 // ---------------------------------------------------
116 for (i = 0; i < 6; ++i) {
117 if (fSecLows[i] >= 0 && fSecLows[i] < 2*nInnerSector) {
119 AliInfo(Form("*** SECTOR %d selected",fSecLows[i]));
124 AliInfo("*** ALL LOWER SECTORS SELECTED ***");
129 AliError("*** AT LEAST ONE LOWER SECTOR MUST BE SPECIFIED ***");
130 AliError("!!! PROGRAM STOPPED !!!");
136 for (i = 0; i < 12; ++i) {
137 if (fSecUps[i] > 2*nInnerSector-1 &&
138 fSecUps[i] < 2*(nInnerSector+nOuterSector)) {
139 AliInfo(Form("*** SECTOR %d selected",fSecUps[i]));
144 AliInfo("*** ALL UPPER SECTORS SELECTED ***");
149 //--------------------------------------------------------------------
152 // Mother volume TPC (Air) - all volumes will be positioned in it
207 gMC->Gsvolu("TPC ","PCON",idtmed[0],dm,27);
211 //-------------------------------------------------------------------
212 // Tpc Outer INsulator (CO2) - contains cont. vessel and field cage
213 //-------------------------------------------------------------------
255 gMC->Gsvolu("TOIN","PCON",idtmed[3],dm,21);
257 //----------------------------------------------------------------
258 // Tpc Outer Contaiment Vessel
259 // mother volume - Al, daughters - composite (sandwich)
260 //----------------------------------------------------------------
302 gMC->Gsvolu("TOCV","PCON",idtmed[4],dm,21);
304 // Daughter volumes - sandwich
306 // Tpc SAndwich 1 - Al
312 gMC->Gsvolu("TSA1","TUBE",idtmed[4],dm,3);
314 // Tpc SAndwich 2 - epoxy glue (I use Lexan)
319 gMC->Gsvolu("TSA2","TUBE",idtmed[14],dm,3);
321 // Tpc SAndwich 3 - Tedlar
326 gMC->Gsvolu("TSA3","TUBE",idtmed[9],dm,3);
329 // Tpc SAndwich 4 - fiber glass (G10)
334 gMC->Gsvolu("TSA4","TUBE",idtmed[12],dm,3);
336 // Tpc SAndwich 5 - NOMEX honeycomb
341 gMC->Gsvolu("TSA5","TUBE",idtmed[6],dm,3);
343 // 5->4->3->2->1->TCOV
346 gMC->Gspos("TSA5",1,"TSA4",0.,0.,0.,0,"ONLY");
347 gMC->Gspos("TSA4",1,"TSA3",0.,0.,0.,0,"ONLY");
348 gMC->Gspos("TSA3",1,"TSA2",0.,0.,0.,0,"ONLY");
349 gMC->Gspos("TSA2",1,"TSA1",0.,0.,0.,0,"ONLY");
351 gMC->Gspos("TSA1",1,"TOCV",0.,0.,3.,0,"ONLY");
355 gMC->Gspos("TOCV",1,"TOIN",0.,0.,0.,0,"ONLY");
357 //-------------------------------------------------------
358 // Tpc Outer Field Cage
359 // mother volume - Al, daughters - composite (sandwich)
360 //-------------------------------------------------------
402 gMC->Gsvolu("TOFC","PCON",idtmed[4],dm,21);
406 // Tpc SAndwich 6 - Tedlar
412 gMC->Gsvolu("TSA6","TUBE",idtmed[9],dm,3);
414 // Tpc SAndwich 7 - fiber glass
419 gMC->Gsvolu("TSA7","TUBE",idtmed[12],dm,3);
422 // Tpc SAndwich 8 - NOMEX
427 gMC->Gsvolu("TSA8","TUBE",idtmed[6],dm,3);
431 gMC->Gspos("TSA8",1,"TSA7",0.,0.,0.,0,"ONLY");
432 gMC->Gspos("TSA7",1,"TSA6",0.,0.,0.,0,"ONLY");
433 gMC->Gspos("TSA6",1,"TOFC",0.,0.,0.,0,"ONLY");
436 // TOFC overlaps with
438 gMC->Gspos("TOFC",1,"TOIN",0.,0.,0.,0,"ONLY");
442 gMC->Gspos("TOIN",1,"TPC ",0.,0.,0.,0,"ONLY");
446 //--------------------------------------------------------------------
447 // Tpc Inner INsulator (CO2) - inner f.c. will be placed there
448 // Inner containment vessel will be placed directly in the TPC
449 //--------------------------------------------------------------------
479 gMC->Gsvolu("TIIN","PCON",idtmed[3],dm,15);
481 // the middle part of the F.C. is thinner - carve out the strip - Ne-CO2
487 gMC->Gsvolu("TII1","TUBE",idtmed[1],dm,3);
489 gMC->Gspos("TII1",1,"TIIN",0.,0.,0.,0,"ONLY");
491 //-----------------------------------------------------
492 // Tpc Inner Field Cage
493 // mother volume - Al, daughters - composite (sandwich)
494 //------------------------------------------------------
560 gMC->Gsvolu("TIFC","PCON",idtmed[4],dm,33);
562 // daughter volumes - central part
564 // Tpc Sandwich 9 -Tedlar
570 gMC->Gsvolu("TSA9","TUBE",idtmed[9],dm,3);
572 // Tpc Sandwich 10 - fiber glass (G10)
577 gMC->Gsvolu("TS10","TUBE",idtmed[12],dm,3);
579 // Tpc Sandwich 11 - NOMEX
584 gMC->Gsvolu("TS11","TUBE",idtmed[6],dm,3);
588 gMC->Gspos("TS11",1,"TS10",0.,0.,0.,0,"ONLY");
589 gMC->Gspos("TS10",1,"TSA9",0.,0.,0.,0,"ONLY");
591 gMC->Gspos("TSA9",1,"TIFC",0.,0.,0.,0,"ONLY");
593 // daughter volumes - outer parts (reinforced)
595 // Tpc Sandwich 12 -Tedlar
601 gMC->Gsvolu("TS12","TUBE",idtmed[9],dm,3);
603 // Tpc Sandwich 13 - fiber glass (G10)
608 gMC->Gsvolu("TS13","TUBE",idtmed[12],dm,3);
610 // Tpc Sandwich 14 - NOMEX
615 gMC->Gsvolu("TS14","TUBE",idtmed[6],dm,3);
619 gMC->Gspos("TS14",1,"TS13",0.,0.,0.,0,"ONLY");
620 gMC->Gspos("TS13",1,"TS12",0.,0.,0.,0,"ONLY");
622 gMC->Gspos("TS12",1,"TIFC",0.,0.,170.05,0,"ONLY");
623 gMC->Gspos("TS12",2,"TIFC",0.,0.,-170.05,0,"ONLY");
625 // place this inside the inner insulator
627 gMC->Gspos("TIFC",1,"TIIN",0.,0.,0.,0,"ONLY");
629 // and now in the TPC...
631 gMC->Gspos("TIIN",1,"TPC ",0.,0.,0.,0,"ONLY");
633 //---------------------------------------------------------
634 // Tpc Inner Containment vessel - Cones
635 //---------------------------------------------------------
689 gMC->Gsvolu("TICC","PCON",idtmed[4],dm,27);
691 Float_t phi1,phi2,phi3,theta1,theta2,theta3; // rotation angles
702 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
704 gMC->Gspos("TICC",1,"TPC ",0.,0.,0.,0,"ONLY");
705 gMC->Gspos("TICC",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
708 //---------------------------------------------------------
709 // Tpc Inner Containment vessel - Middle part -Al
710 //---------------------------------------------------------
752 gMC->Gsvolu("TICM","PCON",idtmed[4],dm,21);
754 // Tpc Sandwich 15 - Al
760 gMC->Gsvolu("TS15","TUBE",idtmed[4],dm,3);
762 // Tpc Sandwich 16 - epoxy glue
767 gMC->Gsvolu("TS16","TUBE",idtmed[14],dm,3);
769 // Tpc Sandwich 17 - Tedlar
774 gMC->Gsvolu("TS17","TUBE",idtmed[9],dm,3);
776 // Tpc Sandwich 18 - carbon fiber
781 gMC->Gsvolu("TS18","TUBE",idtmed[15],dm,3);
783 // Tpc Sandwich 19 - Nomex
788 gMC->Gsvolu("TS19","TUBE",idtmed[6],dm,3);
790 // 19->18->17->16->15-> TICM
792 gMC->Gspos("TS19",1,"TS18",0.,0.,0.,0,"ONLY");
793 gMC->Gspos("TS18",1,"TS17",0.,0.,0.,0,"ONLY");
794 gMC->Gspos("TS17",1,"TS16",0.,0.,0.,0,"ONLY");
795 gMC->Gspos("TS16",1,"TS15",0.,0.,0.,0,"ONLY");
797 gMC->Gspos("TS15",1,"TICM ",0.,0.,0.,0,"ONLY");
800 // TPc inner cont. vessel Joints
806 gMC->Gsvolu("TPJ1","TUBE",idtmed[4],dm,3);
808 gMC->Gspos("TPJ1",1,"TPC ",0.,0.,72.3,0,"ONLY");
809 gMC->Gspos("TPJ1",2,"TPC ",0.,0.,-72.3,0,"ONLY");
841 gMC->Gsvolu("TPJ2","PCON",idtmed[4],dm,15);
843 gMC->Gspos("TPJ2",1,"TPC ",0.,0.,0.,0,"ONLY");
844 gMC->Gspos("TPJ2",2,"TPC ",0.,0.,0.,idrotm[nRotMat],"ONLY");
848 // Tpc Inner Containment vessel Seal (Viton, I use Lexan for a time being)
854 gMC->Gsvolu("TICS","TUBE",idtmed[14],dm,3);
856 gMC->Gspos("TICS",1,"TPC ",0.,0.,71.7,0,"ONLY");
857 gMC->Gspos("TICS",2,"TPC ",0.,0.,-71.7,0,"ONLY");
861 gMC->Gspos("TICM",1,"TPC ",0.,0.,0.,0,"ONLY");
865 nRotMat++; // prepare for the next rotation matrix
867 //---------------------------------------------------------
868 // Tpc Dift Gas volume Nonsensitive (Ne-CO2 90/10)
869 // and its daughters (HV membrane, rods, readout chambers)
870 //---------------------------------------------------------
876 gMC->Gsvolu("TDGN","TUBE",idtmed[1],dm,3);
878 // sector opening angles
880 Float_t innerOpenAngle = fTPCParam->GetInnerAngle();
881 Float_t outerOpenAngle = fTPCParam->GetOuterAngle();
883 // sector angle shift
885 Float_t innerAngleShift = fTPCParam->GetInnerAngleShift();
888 // All above parameters are identical for inner and outer
889 // sectors. The distinction is kept for the historical reasons
890 // and eventually will disappear.
892 Float_t tanAlpha = TMath::Tan(0.5*innerOpenAngle);
893 Float_t cosAlpha = TMath::Sqrt(1.+tanAlpha*tanAlpha);
896 //-------------------------------------------------------------------------
897 // Tpc Inner Readout Chambers
898 //-------------------------------------------------------------------------
902 dm[2]= 1.6; // thickness
905 gMC->Gsvolu("TIRC","TRD1",idtmed[4],dm,4);
907 // this volume will be positioned in the empty space
908 // of the end-cap to avoid overlaps
915 gMC->Gsvolu("TIC1","TRD1",idtmed[4],dm,4);
918 //------------------------------------------------
919 // Tpc Inner readout chamber Pad Plane
920 //------------------------------------------------
927 gMC->Gsvolu("TIPP","TRD1",idtmed[12],dm,4);
931 dm[0] -= 1.218511934;
932 dm[1] -= 1.218511934;
935 gMC->Gsvolu("TIC3","TRD1",idtmed[1],dm,4);
937 gMC->Gspos("TIC3",1,"TIPP",0.,0.15,0.,0,"ONLY");
939 gMC->Gspos("TIPP",1,"TIRC",0.,1.1,0.,0,"ONLY");
942 //----------------------------------------------
943 // Tpc Readout Chambers Empty spaces - for both
944 // inner and outer sectors
945 //----------------------------------------------
947 gMC->Gsvolu("TRCE","TRD1",idtmed[0],dm,0);
949 // Inner sector - 4 spaces
960 space = rr*tanAlpha-dm[0];
962 for(Int_t nsLow=0;nsLow<4;nsLow++){
965 dm[1]= rr*tanAlpha - space;
969 gMC->Gsposp("TRCE",nsLow+1,"TIRC",0.,-0.8,zz,0,"ONLY",dm,4);
975 gMC->Gsposp("TRCE",nsLow+5,"TIC1",0.,1.05,zz-2.1,0,"ONLY",dm,4);
978 dm[0] = rr*tanAlpha - space;
984 // dm[1] - this is the dm[1] from the previous TRCE
988 gMC->Gsposp("TRCE",9,"TIC1",0.,-1.2,0.,0,"ONLY",dm,4);
991 // TPc Space for Connectors
998 gMC->Gsvolu("TPSC","BOX ",idtmed[0],dm,3);
1006 gMC->Gsvolu("TPCC","BOX ",idtmed[13],dm,3);
1008 gMC->Gspos("TPCC",1,"TPSC",0.,0.15,0.,0,"ONLY");
1016 // inner part of the inner sector - 2 x 20 holes
1018 astep = 20.00096874/19.;
1020 alpha = 10.00048437-astep;
1032 for(ncon=0;ncon<20;ncon++){
1038 phi3 = (alpha>0) ? 0. : 180.;
1039 theta3 = TMath::Abs(alpha);
1041 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1045 gMC->Gspos("TPSC",ncon+1,"TIRC",x1,0.3,-12.7875,idrotm[nRotMat],"ONLY");
1046 gMC->Gspos("TPSC",ncon+21,"TIRC",x2,0.3,-2.8625,idrotm[nRotMat],"ONLY");
1057 // outer part of the inner sector - 2 x 25 holes
1059 astep = 20.00096874/24.;
1060 alpha = 10.00048437-astep;
1068 for(ncon=0;ncon<25;ncon++){
1074 phi3 = (alpha>0) ? 0. : 180.;
1075 theta3 = TMath::Abs(alpha);
1077 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1081 gMC->Gspos("TPSC",ncon+41,"TIRC",x1,0.3,7.0625,idrotm[nRotMat],"ONLY");
1082 gMC->Gspos("TPSC",ncon+66,"TIRC",x2,0.3,16.9875,idrotm[nRotMat],"ONLY");
1093 //--------------------------------------------------------------------------
1094 // TPC Outer Readout Chambers
1095 // this is NOT a final design
1096 //--------------------------------------------------------------------------
1100 dm[2]= 1.5; //thickness
1103 gMC->Gsvolu("TORC","TRD1",idtmed[4],dm,4);
1105 //------------------------------------------------
1106 // Tpc Outer readout chamber Pad Plane
1107 //------------------------------------------------
1111 gMC->Gsvolu("TOPP","TRD1",idtmed[12],dm,4);
1113 dm[0] -= 1.218511934;
1114 dm[1] -= 1.218511934;
1117 gMC->Gsvolu("TOC3","TRD1",idtmed[1],dm,4);
1119 gMC->Gspos("TOC3",1,"TOPP",0.,0.15,0.,0,"ONLY");
1121 gMC->Gspos("TOPP",1,"TORC",0.,1.0,0.,0,"ONLY");
1130 gMC->Gsposp("TRCE",10,"TORC",0.,-0.8,-2.15,0,"ONLY",dm,4);
1137 gMC->Gsvolu("TOC1","TRD1",idtmed[4],dm,4);
1144 gMC->Gsposp("TRCE",11,"TOC1",0.,0.,0.,0,"ONLY",dm,4);
1146 //-----------------------------------------------
1147 // Tpc Services Support Wheel
1148 //-----------------------------------------------
1163 gMC->Gsvolu("TSSW","PGON",idtmed[4],dm,10);
1165 // Tpc Services Wheel Cover
1170 gMC->Gsvolu("TSWC","PGON",idtmed[4],dm,10);
1172 // Tpc Service wheel Cover Empty space
1179 gMC->Gsvolu("TSCE","TRD1",idtmed[0],dm,4);
1181 // Tpc services Wheel Empty Spaces
1188 gMC->Gsvolu("TWES","TRD1",idtmed[0],dm,4);
1190 // Tpc Services Wheel Bars
1192 gMC->Gsvolu("TSWB","TRD1",idtmed[4],dm,0);
1202 gMC->Gsposp("TSWB",1,"TWES",0.,0.,-85.125,0,"ONLY",dm,4);
1207 gMC->Gsposp("TSWB",2,"TWES",0.,0.,85.125,0,"ONLY",dm,4);
1209 // TPc ELectronics - right now 30% X0 Si
1216 gMC->Gsvolu("TPEL","TRD1",idtmed[11],dm,4);
1217 gMC->Gspos("TPEL",1,"TWES",0.,0.,0.,0,"ONLY");
1219 //--------------------------------------------------------------------------
1221 //--------------------------------------------------------------------------
1223 // TPc Main Wheel - Al
1229 gMC->Gsvolu("TPMW","TUBE",idtmed[4],dm,3);
1231 //--------------------------------------------------------------------------
1232 // Tpc Empty Space for the Readout chambers
1233 //--------------------------------------------------------------------------
1237 Float_t dR = 0.5*(rUp-rLow);
1239 space= 1.5/cosAlpha; // wheel ribs are 3.0 cm wide
1241 dm[0]= rLow*tanAlpha-space;
1242 dm[1]= rUp*tanAlpha-space;
1246 gMC->Gsvolu("TESR","TRD1",idtmed[0],dm,4);
1250 gMC->Gspos("TIC1",1,"TESR",0.,0.75,-dR+23.97,0,"ONLY");
1254 gMC->Gspos("TOC1",1,"TESR",0.,0.75,dR-55.02,0,"ONLY");
1256 // Tpc Empty Space Bars - Al (daughters of TESR)
1260 gMC->Gsvolu("TESB","TRD1",idtmed[4],dm,0);
1264 dm[0]= rLow*tanAlpha-space;
1265 dm[1]= 88.7*tanAlpha-space;
1271 gMC->Gsposp("TESB",1,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1275 dm[0]= 131.65*tanAlpha-space;
1276 dm[1]= 136.5*tanAlpha-space;
1279 zBar = -dR +131.65+dm[3]-rLow;
1281 gMC->Gsposp("TESB",2,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1285 dm[0]= 240.4*tanAlpha-space;
1286 dm[1]= rUp*tanAlpha-space;
1291 gMC->Gsposp("TESB",3,"TESR",0.,0.75,zBar,0,"ONLY",dm,4);
1293 //------------------------------------------------------
1294 // TPc Lower "S" Sectors
1295 //------------------------------------------------------
1298 Float_t inSecLowEdge = fTPCParam->GetInnerRadiusLow();
1299 Float_t inSecUpEdge = fTPCParam->GetInnerRadiusUp();
1301 dm[0] = inSecLowEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1302 dm[1] = inSecUpEdge*TMath::Tan(0.5*innerOpenAngle)-0.01;
1303 dm[2] = 0.5*(250. - 5.e-3);
1304 dm[3] = 0.5*(inSecUpEdge-inSecLowEdge);
1306 gMC->Gsvolu("TPLS", "TRD1", idtmed[2], dm, 4); // sensitive
1309 //----------------------------------------------------------
1310 // TPc Upper Sectors
1311 //----------------------------------------------------------
1313 Float_t ouSecLowEdge = fTPCParam->GetOuterRadiusLow();
1314 Float_t ouSecUpEdge = fTPCParam->GetOuterRadiusUp();
1316 dm[0] = ouSecLowEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1317 dm[1] = ouSecUpEdge*TMath::Tan(0.5*outerOpenAngle)-0.01;
1318 dm[2] = 0.5*(250. - 5.e-3);
1319 dm[3] = 0.5*(ouSecUpEdge-ouSecLowEdge);
1321 gMC->Gsvolu("TPUS", "TRD1", idtmed[2], dm, 4); // sensitive
1327 gMC->Gsvolu("TPSS","TRD1",idtmed[2],dm,0); // sensitive
1329 Int_t nofStrips,nstr;
1331 Float_t stripThick = 0.01; // 100 microns
1337 // if all lower sectors selected define only 1 strip
1339 nofStrips=((fSecAL <0)||(fSecAL>=0 && fSens<0)) ? 1 : fTPCParam->GetNRowLow();
1340 deadSpace = fTPCParam->GetInnerWireMount();
1342 dm[2] = 0.5*(250. - 5.e-3);
1343 dm[3] = 0.5 * stripThick;
1345 for(nstr=0;nstr<nofStrips;nstr++){
1347 r1 = fTPCParam->GetPadRowRadiiLow(nstr);
1348 r2 = r1 + stripThick;
1349 dm[0] = r1 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1350 dm[1] = r2 * TMath::Tan(0.5*innerOpenAngle) - deadSpace;
1351 zs = -inSecLowEdge -0.5*(inSecUpEdge-inSecLowEdge);
1355 gMC->Gsposp("TPSS", nstr+1, "TPLS", 0., 0., zs, 0, "ONLY", dm, 4);
1360 // strips only if several upper sectors selected end fSens > 0
1362 if(fSecAU >=0 && fSens >0){
1364 Int_t nsSave = nofStrips;
1368 nofStrips = fTPCParam->GetNRowUp();
1369 deadSpace = fTPCParam->GetOuterWireMount();
1371 dm[2] = 0.5*(250. - 5.e-3);
1372 dm[3] = 0.5 * stripThick;
1375 for(nstr=0;nstr<nofStrips;nstr++){
1377 r1 = fTPCParam->GetPadRowRadiiUp(nstr);
1378 r2 = r1 + stripThick;
1379 dm[0] = r1 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1380 dm[1] = r2 * TMath::Tan(0.5*outerOpenAngle) - deadSpace;
1381 zs = -ouSecLowEdge -0.5*(ouSecUpEdge-ouSecLowEdge);
1385 gMC->Gsposp("TPSS", nstr+1+nsSave, "TPUS", 0., 0., zs, 0, "ONLY", dm, 4);
1391 //-------------------------------------------------------
1392 // positioning of the empty spaces into the main wheel
1393 // and readout chambers and sectors into the drift gas
1394 //-------------------------------------------------------
1396 Float_t rCenter,xc,yc;
1397 Float_t rInner,rOuter; // center of the inner and outer chamber
1405 for(Int_t ns=0; ns<nInnerSector;ns++){
1407 phi1 = ns * innerOpenAngle + innerAngleShift;
1408 phi1 *= kRaddeg; // in degrees
1410 phi1 = (Float_t)TMath::Nint(phi1) + 270.;
1412 if (phi1 > 360.) phi1 -= 360.;
1417 phi3 = ns * innerOpenAngle + innerAngleShift;
1418 phi3 *= kRaddeg; // in degrees
1420 phi3 = (Float_t)TMath::Nint(phi3);
1422 if(phi3 > 360.) phi3 -= 360.;
1426 // "holes"->End plate
1428 xc = rCenter*TMath::Cos(phi3*kDegrad);
1429 yc = rCenter*TMath::Sin(phi3*kDegrad);
1431 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1433 gMC->Gspos("TESR",ns+1,"TPMW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1435 // TSCE->TSWC (services wheel volumes)
1437 xc = 166.142*TMath::Cos(phi3*kDegrad);
1438 yc = 166.142*TMath::Sin(phi3*kDegrad);
1440 gMC->Gspos("TSCE",ns+1,"TSWC",xc,yc,0.,idrotm[nRotMat],"ONLY");
1441 gMC->Gspos("TWES",ns+1,"TSSW",xc,yc,0.,idrotm[nRotMat],"ONLY");
1444 // readout chambers->TDGN (drift gas)
1446 xc = rInner*TMath::Cos(phi3*kDegrad);
1447 yc = rInner*TMath::Sin(phi3*kDegrad);
1449 gMC->Gspos("TIRC",ns+1,"TDGN",xc,yc,252.,idrotm[nRotMat],"ONLY");
1451 // here lower sectors
1455 // all lower sectors are positioned
1457 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1459 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1463 // only selected sectors are positioned (up to 6 sectors)
1465 for(Int_t sel=0;sel<6;sel++){
1467 if(fSecLows[sel] == ns){
1468 gMC->Gspos("TPLS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1470 else if(fSecLows[sel] == ns+nInnerSector){
1472 Gspos("TPLS",ns+nInnerSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1475 } // lower sectors finished
1478 xc = rOuter*TMath::Cos(phi3*kDegrad);
1479 yc = rOuter*TMath::Sin(phi3*kDegrad);
1481 gMC->Gspos("TORC",ns+1,"TDGN",xc,yc,252.1,idrotm[nRotMat],"ONLY");
1483 // here upper sectors
1487 // all upper sectors
1489 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1491 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1495 // only selected sectors (up to 12)
1497 for(Int_t sel=0;sel<12;sel++){
1498 if(fSecUps[sel] == ns+2*nInnerSector){
1499 gMC->Gspos("TPUS",ns+1,"TDGN",xc,yc,125.0025,idrotm[nRotMat],"ONLY");
1501 else if(fSecUps[sel] == ns+2*nInnerSector+nOuterSector){
1503 Gspos("TPUS",ns+nOuterSector+1,"TDGN",xc,yc,-125.0025,idrotm[nRotMat],"ONLY");
1506 } // upper sectors finished
1511 theta2 = 0.; // reflection
1513 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
1515 xc = rInner*TMath::Cos(phi3*kDegrad);
1516 yc = rInner*TMath::Sin(phi3*kDegrad);
1518 gMC->Gspos("TIRC",ns+nInnerSector+1,"TDGN",xc,yc,-252.,idrotm[nRotMat],"ONLY");
1520 xc = rOuter*TMath::Cos(phi3*kDegrad);
1521 yc = rOuter*TMath::Sin(phi3*kDegrad);
1523 gMC->Gspos("TORC",ns+nOuterSector+1,"TDGN",xc,yc,-252.1,idrotm[nRotMat],"ONLY");
1530 gMC->Gspos("TPMW",1,"TPC ",0.,0.,256.6,0,"ONLY");
1531 gMC->Gspos("TPMW",2,"TPC ",0.,0.,-256.6,idrotm[0],"ONLY");
1533 //---------------------------------------------------------
1534 // Tpc High Voltage Membrane - 100 microns of mylar
1535 //---------------------------------------------------------
1541 gMC->Gsvolu("THVM","TUBE",idtmed[8],dm,3);
1543 gMC->Gspos("THVM",1,"TDGN",0.,0.,0.,0,"ONLY");
1545 // Tpc High Voltage membrane Holders
1547 gMC->Gsvolu("THVH","TUBE",idtmed[4],dm,0);
1557 gMC->Gsposp("THVH",1,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1565 gMC->Gsposp("THVH",2,"TDGN",0.,0.,0.,0,"ONLY",dm,3);
1567 //----------------------------------------------------------
1568 // TPc Support Rods - MAKROLON
1569 //----------------------------------------------------------
1574 gMC->Gsvolu("TPSR","TUBE",idtmed[7],dm,0); // inner and outer rods differ
1577 for(Int_t nrod=0;nrod<18;nrod++){
1578 Float_t angle=innerOpenAngle*(Float_t)nrod;
1580 xc=81.5*TMath::Cos(angle);
1581 yc=81.5*TMath::Sin(angle);
1585 gMC->Gsposp("TPSR",nrod+1,"TDGN",xc,yc,126.9,0,"ONLY",dm,3);
1586 gMC->Gsposp("TPSR",nrod+19,"TDGN",xc,yc,-126.9,0,"ONLY",dm,3);
1590 xc=254.25*TMath::Cos(angle);
1591 yc=254.25*TMath::Sin(angle);
1593 // rod number 54 contans the HV cable
1596 gMC->Gsposp("TPSR",nrod+37,"TDGN",xc,yc,127.,0,"ONLY",dm,3);
1597 gMC->Gsposp("TPSR",nrod+54,"TDGN",xc,yc,-127.,0,"ONLY",dm,3);
1602 //----------------------------------------------------------
1603 // Tpc High Voltage Rod - MAKROLON + Copper cable
1604 //----------------------------------------------------------
1606 // rod with cable (Left)
1612 gMC->Gsvolu("THVL","TUBE",idtmed[7],dm,3);
1620 gMC->Gsvolu("THVC","TUBE",idtmed[10],dm,3);
1628 gMC->Gsvolu("THVE","TUBE",idtmed[1],dm,3);
1630 gMC->Gspos("THVC",1,"THVL",0.,0.,0.,0,"ONLY");
1631 gMC->Gspos("THVE",1,"THVL",0.,0.,0.,0,"ONLY");
1633 // rod without cable
1639 gMC->Gsvolu("THVR","TUBE",idtmed[7],dm,3);
1641 gMC->Gspos("THVL",1,"TDGN",xc,yc,-127.,0,"ONLY");
1642 gMC->Gspos("THVR",1,"TDGN",xc,yc,127.,0,"ONLY");
1644 gMC->Gspos("TDGN",1,"TPC ",0.,0.,0.,0,"ONLY");
1646 // services wheel cover -> wheel
1649 gMC->Gspos("TSWC",1,"TSSW",0.,0.,4.5,0,"ONLY");
1650 gMC->Gspos("TSWC",2,"TSSW",0.,0.,-4.5,0,"ONLY");
1653 // put the wheel into the TPC
1655 gMC->Gspos("TSSW",1,"TPC ",0.,0.,278.7,0,"ONLY");
1656 gMC->Gspos("TSSW",2,"TPC ",0.,0.,-278.7,0,"ONLY");
1660 gMC->Gsord("TPMW",6);
1661 gMC->Gsord("TSSW",6);
1662 gMC->Gsord("TSWC",6);
1663 if(fSecAL >=0) gMC->Gsord("TPLS",3);
1664 if(fSecAU >=0 && fSens >0) gMC->Gsord("TPUS",3);
1665 gMC->Gsord("TDGN",6);
1667 // put the TPC into ALIC (main mother volume)
1669 gMC->Gspos("TPC ",1,"ALIC",0.,0.,0.,0,"ONLY");
1673 } // end of function
1675 //_____________________________________________________________________________
1676 void AliTPCv2::DrawDetector()
1679 // Draw a shaded view of the Time Projection Chamber version 1
1682 // Set everything unseen
1683 gMC->Gsatt("*", "seen", -1);
1685 // Set ALIC mother transparent
1686 gMC->Gsatt("ALIC","SEEN",0);
1688 // Set the volumes visible
1691 gMC->Gsatt("TPC ","SEEN",0);
1692 gMC->Gsatt("TOIN","SEEN",1);
1693 gMC->Gsatt("TOIN","COLO",7);
1694 gMC->Gsatt("TOCV","SEEN",1);
1695 gMC->Gsatt("TOCV","COLO",4);
1696 gMC->Gsatt("TSA1","SEEN",0);
1697 gMC->Gsatt("TSA2","SEEN",0);
1698 gMC->Gsatt("TSA3","SEEN",0);
1699 gMC->Gsatt("TSA4","SEEN",0);
1700 gMC->Gsatt("TSA5","SEEN",0);
1701 gMC->Gsatt("TOFC","SEEN",1);
1702 gMC->Gsatt("TOFC","COLO",4);
1703 gMC->Gsatt("TSA6","SEEN",0);
1704 gMC->Gsatt("TSA7","SEEN",0);
1705 gMC->Gsatt("TSA8","SEEN",0);
1706 gMC->Gsatt("TIIN","SEEN",1);
1707 gMC->Gsatt("TIIN","COLO",7);
1708 gMC->Gsatt("TII1","SEEN",0);
1709 gMC->Gsatt("TIFC","SEEN",1);
1710 gMC->Gsatt("TIFC","COLO",4);
1711 gMC->Gsatt("TSA9","SEEN",0);
1712 gMC->Gsatt("TS10","SEEN",0);
1713 gMC->Gsatt("TS11","SEEN",0);
1714 gMC->Gsatt("TS12","SEEN",0);
1715 gMC->Gsatt("TS13","SEEN",0);
1716 gMC->Gsatt("TS14","SEEN",0);
1717 gMC->Gsatt("TICC","SEEN",0);
1718 gMC->Gsatt("TICM","SEEN",0);
1719 gMC->Gsatt("TS15","SEEN",0);
1720 gMC->Gsatt("TS16","SEEN",0);
1721 gMC->Gsatt("TS17","SEEN",0);
1722 gMC->Gsatt("TS18","SEEN",0);
1723 gMC->Gsatt("TS19","SEEN",0);
1724 gMC->Gsatt("TPJ1","SEEN",0);
1725 gMC->Gsatt("TPJ2","SEEN",0);
1726 gMC->Gsatt("TICS","SEEN",0);
1727 gMC->Gsatt("TDGN","SEEN",0);
1728 gMC->Gsatt("TIRC","SEEN",0);
1729 gMC->Gsatt("TIC1","SEEN",1);
1730 gMC->Gsatt("TIPP","SEEN",0);
1731 gMC->Gsatt("TIC3","SEEN",0);
1732 gMC->Gsatt("TRCE","SEEN",0);
1733 gMC->Gsatt("TPSC","SEEN",0);
1734 gMC->Gsatt("TPCC","SEEN",0);
1735 gMC->Gsatt("TORC","SEEN",0);
1736 gMC->Gsatt("TOPP","SEEN",0);
1737 gMC->Gsatt("TOC3","SEEN",0);
1738 gMC->Gsatt("TOC1","SEEN",1);
1739 gMC->Gsatt("TSSW","SEEN",1);
1740 gMC->Gsatt("TSWC","SEEN",1);
1741 gMC->Gsatt("TSSW","COLO",3);
1742 gMC->Gsatt("TSWC","COLO",3);
1743 gMC->Gsatt("TSCE","COLO",6);
1744 gMC->Gsatt("TSCE","SEEN",1);
1745 gMC->Gsatt("TWES","SEEN",0);
1746 gMC->Gsatt("TSWB","SEEN",0);
1747 gMC->Gsatt("TPEL","SEEN",0);
1748 gMC->Gsatt("TPMW","SEEN",1);
1749 gMC->Gsatt("TESR","SEEN",1);
1750 gMC->Gsatt("TPMW","COLO",12);
1751 gMC->Gsatt("TIC1","COLO",5);
1752 gMC->Gsatt("TOC1","COLO",5);
1753 gMC->Gsatt("TESB","SEEN",0);
1754 gMC->Gsatt("THVM","SEEN",1);
1755 gMC->Gsatt("THVM","COLO",11);
1756 gMC->Gsatt("THVH","SEEN",0);
1757 gMC->Gsatt("TPSR","SEEN",0);
1758 gMC->Gsatt("THVL","SEEN",0);
1759 gMC->Gsatt("THVC","SEEN",0);
1760 gMC->Gsatt("THVE","SEEN",0);
1761 gMC->Gsatt("THVR","SEEN",0);
1762 gMC->Gsatt("TPSS","SEEN",0);
1763 gMC->Gsatt("TPUS","SEEN",0);
1764 gMC->Gsatt("TPLS","SEEN",0);
1767 gMC->Gdopt("hide", "on");
1768 gMC->Gdopt("shad", "on");
1769 gMC->Gsatt("*", "fill", 7);
1770 gMC->SetClipBox(".");
1771 gMC->SetClipBox("TPMW",-300,300,-300,300,254.,270.);
1772 gMC->SetClipBox("TESR",-300,300,-300,300,254.,270.);
1773 gMC->SetClipBox("TSSW",-300,300,-300,300,283.,284.);
1774 gMC->SetClipBox("TSWC",-300,300,-300,300,283.,284.);
1775 gMC->SetClipBox("*", 0, 300, -300, 300, -290, 290);
1776 gMC->DefaultRange();
1777 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
1778 gMC->Gdhead(1111, "Time Projection Chamber");
1779 gMC->Gdman(18, 4, "MAN");
1780 gMC->Gdopt("hide","off");
1783 //_____________________________________________________________________________
1784 void AliTPCv2::CreateMaterials()
1787 // Define materials for version 2 of the Time Projection Chamber
1790 AliTPC::CreateMaterials();
1793 //_____________________________________________________________________________
1794 void AliTPCv2::Init()
1797 // Initialises version 2 of the TPC after that it has been built
1800 Int_t *idtmed = fIdtmed->GetArray();
1806 fIdSens=gMC->VolId("TPSS");
1808 fIdLSec=gMC->VolId("TPLS"); // lower sector
1809 fIdUSec=gMC->VolId("TPUS"); // upper sector
1811 gMC->SetMaxNStep(30000); // max. number of steps increased
1813 gMC->Gstpar(idtmed[2],"LOSS",5); // specific energy loss
1815 AliInfo("*** TPC version 2 initialized ***");
1816 AliInfo(Form("Maximum number of steps = %d",gMC->GetMaxNStep()));
1822 //_____________________________________________________________________________
1823 void AliTPCv2::StepManager()
1826 // Called for every step in the Time Projection Chamber
1830 // parameters used for the energy loss calculations
1832 const Float_t kprim = 14.35; // number of primary collisions per 1 cm
1833 const Float_t kpoti = 20.77e-9; // first ionization potential for Ne/CO2
1834 const Float_t kwIon = 35.97e-9; // energy for the ion-electron pair creation
1837 const Float_t kbig = 1.e10;
1844 vol[1]=0; // preset row number to 0
1848 gMC->SetMaxStep(kbig);
1850 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1852 Float_t charge = gMC->TrackCharge();
1854 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1856 // check the sensitive volume
1858 id = gMC->CurrentVolID(copy); // current volume Id
1860 if ( (gMC->IsTrackEntering() || gMC->IsTrackExiting()) &&
1861 ((id == fIdLSec) || (id == fIdUSec)) ) {
1863 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
1867 vol[0] = copy-1; // lower sector number
1869 else if(id == fIdUSec){
1870 vol[0] = copy+fTPCParam->GetNInnerSector()-1; // upper sector number
1872 else if(id == fIdSens && gMC->IsTrackEntering()){
1874 // track is entering the sensitive strip
1876 vol[1]= copy-1; // row number (absolute)
1880 id = gMC->CurrentVolOffID(1,copy);
1886 vol[0] = copy-1; // sector number
1893 vol[0] = copy-1+fTPCParam->GetNInnerSector(); // sector number
1894 vol[1] -= fTPCParam->GetNRowLow(); // row number (starts also from 0)
1900 // because Jouri wants to have this
1902 gMC->TrackMomentum(p);
1906 hits[3]=0.; // this hit has no energy loss
1907 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
1909 // Get also the track time for pileup simulation
1910 hits[4]=gMC->TrackTime();
1912 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
1916 gMC->TrackPosition(p);
1920 hits[3]=0.; // this hit has no energy loss
1921 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
1923 // Get also the track time for pileup simulation
1924 hits[4]=gMC->TrackTime();
1926 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
1931 //-----------------------------------------------------------------
1932 // charged particle is in the sensitive volume
1933 //-----------------------------------------------------------------
1935 if(gMC->TrackStep() > 0) {
1937 Int_t nel = (Int_t)(((gMC->Edep())-kpoti)/kwIon) + 1;
1938 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1940 gMC->TrackPosition(p);
1944 hits[3]=(Float_t)nel;
1948 // new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
1950 gMC->TrackMomentum(p);
1951 Float_t momentum = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]);
1952 Float_t precision = (momentum>0.1) ? 0.002 :0.01;
1953 fTrackHits->SetHitPrecision(precision);
1956 // Get also the track time for pileup simulation
1957 hits[4]=gMC->TrackTime();
1959 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
1963 // Stemax calculation for the next step
1967 gMC->TrackMomentum(mom);
1968 Float_t ptot=mom.Rho();
1969 Float_t betaGamma = ptot/gMC->TrackMass();
1971 Int_t pid=gMC->TrackPid();
1972 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1974 pp = kprim*1.58; // electrons above 20 MeV/c are on the plateau!
1979 betaGamma = TMath::Max(betaGamma,(Float_t)7.e-3); // protection against too small bg
1980 pp=kprim*BetheBloch(betaGamma);
1982 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1985 Double_t rnd = gMC->GetRandom()->Rndm();
1987 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1991 //_____________________________________________________________________________
1992 Float_t AliTPCv2::BetheBloch(Float_t bg)
1995 // Bethe-Bloch energy loss formula
1997 const Double_t kp1=0.76176e-1;
1998 const Double_t kp2=10.632;
1999 const Double_t kp3=0.13279e-4;
2000 const Double_t kp4=1.8631;
2001 const Double_t kp5=1.9479;
2003 Double_t dbg = (Double_t) bg;
2005 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
2007 Double_t aa = TMath::Power(beta,kp4);
2008 Double_t bb = TMath::Power(1./dbg,kp5);
2010 bb=TMath::Log(kp3+bb);
2012 return ((Float_t)((kp2-aa-bb)*kp1/aa));