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.20 2000/04/17 09:37:33 kowal2
19 removed obsolete AliTPCDigitsDisplay.C
21 Revision 1.19.8.2 2000/04/10 08:31:52 kowal2
23 Different geometry for different sectors
24 Updated readout chambers
25 Some modifications to StepManager by J.Belikov
27 Revision 1.19.8.1 2000/04/10 07:56:53 kowal2
28 Not used anymore - removed
30 Revision 1.19 1999/11/04 17:28:07 fca
31 Correct barrel part of HV Degrader
33 Revision 1.18 1999/10/14 16:52:08 fca
34 Only use PDG codes and not GEANT ones
36 Revision 1.17 1999/10/08 06:27:23 fca
37 Corrected bug in the HV degrader geometry, thanks to G.Tabary
39 Revision 1.16 1999/10/04 13:39:54 fca
40 Correct array index problem
42 Revision 1.15 1999/09/29 09:24:34 fca
43 Introduction of the Copyright and cvs Log
47 ///////////////////////////////////////////////////////////////////////////////
49 // Time Projection Chamber version 2 -- detailed TPC and slow simulation //
53 <img src="picts/AliTPCv2Class.gif">
58 ///////////////////////////////////////////////////////////////////////////////
64 #include "AliTPCDigitsArray.h"
71 //_____________________________________________________________________________
72 AliTPCv2::AliTPCv2(const char *name, const char *title) :
76 // Standard constructor for Time Projection Chamber version 2
80 SetBufferSize(128000);
83 //_____________________________________________________________________________
84 void AliTPCv2::CreateGeometry()
87 // Create the geometry of Time Projection Chamber version 2
91 <img src="picts/AliTPCv2.gif">
96 <img src="picts/AliTPCv2Tree.gif">
101 Int_t *idtmed = fIdtmed->GetArray();
110 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
111 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
113 // ---------------------------------------------------
114 // sector specification check
115 // ---------------------------------------------------
119 for (i = 0; i < 6; ++i) {
120 if (fSecLows[i] >= 0 && fSecLows[i] < 2*nInnerSector) {
122 printf("*** SECTOR %d selected\n",fSecLows[i]);
127 printf("*** ALL LOWER SECTORS SELECTED ***\n");
134 for (i = 0; i < 12; ++i) {
135 if (fSecUps[i] > 2*nInnerSector-1 &&
136 fSecUps[i] < 2*(nInnerSector+nOuterSector)) {
138 printf("*** SECTOR %d selected\n",fSecUps[i]);
143 printf("*** ALL UPPER SECTORS SELECTED ***\n");
147 if (ifl1 == 0 && ifl2 == 0) {
148 printf("*** ERROR: AT LEAST ONE SECTOR MUST BE SPECIFIED ***\n");
149 printf("!!! PROGRAM STOPPED !!!\n");
153 if ((fSecAL < 0 || fSecAU < 0) && fSens >= 0) {
154 printf("** ERROR: STRIPS CANNOT BE SPECIFIED FOR ALL SECTORS **\n");
155 printf("!!! PROGRAM STOPPED !!!\n");
159 // ----------------------------------------------------
160 // FIELD CAGE WITH ENDCAPS - G10
161 // THIS IS ALSO A TPC MOTHER VOLUME
162 // ----------------------------------------------------
168 gMC->Gsvolu("TPC ", "TUBE", idtmed[8], dm, 3);
170 //-----------------------------------------------------
171 // Endcap cover c-fibre 0.86% X0
172 //-----------------------------------------------------
178 gMC->Gsvolu("TPEC","TUBE",idtmed[10],dm,3);
180 //-----------------------------------------------------
181 // Drift gas , leave 2 cm at the outer radius
183 //-----------------------------------------------------
189 gMC->Gsvolu("TGAS", "TUBE", idtmed[3], dm, 3);
191 //------------------------------------------------------
192 // membrane holder - carbon fiber
193 //------------------------------------------------------
196 gMC->Gsvolu("TPMH","TUBE",idtmed[6],dm,0);
202 gMC->Gsposp("TPMH",1,"TGAS",0.,0.,0.,0,"ONLY",dm,3);
208 gMC->Gsposp("TPMH",2,"TGAS",0.,0.,0.,0,"ONLY",dm,3);
210 //----------------------------------------------------------
211 // HV membrane - 25 microns of mylar
212 //----------------------------------------------------------
218 gMC->Gsvolu("TPHV","TUBE",idtmed[5],dm,3);
220 gMC->Gspos("TPHV",1,"TGAS",0.,0.,0.,0,"ONLY");
222 gMC->Gspos("TGAS",1,"TPC ",0.,0.,0.,0,"ONLY");
224 //----------------------------------------------------------
225 // "side" gas volume, the same as the drift gas
226 // the readout chambers are placed there.
227 //----------------------------------------------------------
231 dm[2] = 0.5*(275. - 250.);
233 gMC->Gsvolu("TPSG", "TUBE", idtmed[2], dm, 3);
235 Float_t z_side = dm[2]; // 1/2 of the side gas thickness
237 //------------------------------------------------------------
238 // Readout chambers , 25% of X0, I use Al as the material
239 //------------------------------------------------------------
241 Float_t InnerOpenAngle = fTPCParam->GetInnerAngle();
242 Float_t OuterOpenAngle = fTPCParam->GetOuterAngle();
244 Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift();
245 Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift();
247 Float_t InSecLowEdge = fTPCParam->GetInnerRadiusLow();
248 Float_t InSecUpEdge = fTPCParam->GetInnerRadiusUp();
250 Float_t OuSecLowEdge = fTPCParam->GetOuterRadiusLow();
251 Float_t OuSecUpEdge = fTPCParam->GetOuterRadiusUp();
254 Float_t SecThick = 2.225; // Al
256 Float_t LowEdge = fTPCParam->GetInnerFrameSpace();
260 dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge;
261 dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-LowEdge;
262 dm[2] = 0.5*SecThick;
263 dm[3] = 0.5*(InSecUpEdge-InSecLowEdge);
265 Float_t xCenterS = InSecLowEdge+dm[3];
267 gMC->Gsvolu("TRCS", "TRD1", idtmed[0], dm, 4);
271 Float_t UpEdge = fTPCParam->GetOuterFrameSpace();
273 dm[0] = OuSecLowEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge;
274 dm[1] = OuSecUpEdge*TMath::Tan(0.5*OuterOpenAngle)-UpEdge;
275 dm[2] = 0.5*SecThick;
276 dm[3] = 0.5*(OuSecUpEdge-OuSecLowEdge);
278 Float_t xCenterL = OuSecLowEdge+dm[3];
280 gMC->Gsvolu("TRCL", "TRD1", idtmed[0], dm, 4);
282 Float_t z1 = -z_side + SecThick*0.5;
284 //------------------------------------------------------------------
285 // S sectors - "gas sectors" (TRD1)
286 //------------------------------------------------------------------
288 dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01;
289 dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01;
290 dm[2] = 0.5*(250. - 0.001);
291 dm[3] = 0.5*(InSecUpEdge-InSecLowEdge);
293 gMC->Gsvolu("TSGA", "TRD1", idtmed[4], dm, 4); // sensitive
295 // -------------------------------------------------------------
296 // Only for the debugging purpose and resolution calculation
297 // Sensitive strips at the pad-row center
298 // -------------------------------------------------------------
306 Float_t StripThick = 0.01; // 100 microns
309 gMC->Gsvolu("TSST", "TRD1", idtmed[4], dm, 0);
311 dm[2] = 0.5*(250. - 0.002);
312 dm[3] = 0.5 * StripThick;
314 dead= fTPCParam->GetInnerWireMount();
317 for (ns = 0; ns < fTPCParam->GetNRowLow(); ns++) {
319 r1 = fTPCParam->GetPadRowRadiiLow(ns);
320 r2 = r1 + StripThick;
321 dm[0] = r1 * TMath::Tan(0.5*InnerOpenAngle) - dead;
322 dm[1] = r2 * TMath::Tan(0.5*InnerOpenAngle) - dead;
324 zz = -InSecLowEdge -0.5*(InSecUpEdge-InSecLowEdge);
328 gMC->Gsposp("TSST", ns+1, "TSGA", 0., 0., zz, 0, "ONLY", dm, 4);
333 gMC->Gsord("TSGA", 3);
335 } // if strips selected
338 //-----------------------------------------------------------------
339 // L sectors - "gas sectors" (PGON to avoid overlaps)
340 //-----------------------------------------------------------------
342 dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle;
344 dm[0] = (Float_t)TMath::Nint(dm[0]);
346 dm[1] = OuterOpenAngle*kRaddeg;
347 dm[1] = (Float_t)TMath::Nint(dm[1]);
353 dm[5] = OuSecLowEdge;
354 dm[6] = 252.*TMath::Cos(0.5*OuterOpenAngle)-0.002;
361 dm[11] = OuSecLowEdge;
362 dm[12] = OuSecUpEdge;
368 gMC->Gsvolu("TLGA","PGON",idtmed[4],dm,16);
372 Float_t rmax = dm[6];
374 Float_t dead = fTPCParam->GetOuterWireMount();
376 Float_t StripThick = 0.01; // 100 microns
378 gMC->Gsvolu("TLST", "PGON", idtmed[4], dm, 0);
380 dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle;
382 dm[0] = (Float_t)TMath::Nint(dm[0]);
384 dm[1] = OuterOpenAngle*kRaddeg;
385 dm[1] = (Float_t)TMath::Nint(dm[1]);
392 Float_t xx = dead/TMath::Tan(0.5*OuterOpenAngle);
394 for(ns=0;ns<fTPCParam->GetNRowUp();ns++){
396 r1 = fTPCParam->GetPadRowRadiiUp(ns)-xx;
397 r2 = r1 + StripThick;
412 gMC->Gsposp("TLST",ns+1,"TLGA",xx,0.,0.,0,"ONLY",dm,10);
416 gMC->Gsord("TLGA", 4);
418 } // if strips selected
420 //------------------------------------------------------------------
421 // Positioning of the S-sector readout chambers
422 //------------------------------------------------------------------
424 Float_t zs = 0.5*(250.+0.002);
426 Float_t theta1,theta2,theta3;
427 Float_t phi1,phi2,phi3;
431 for(ns=0;ns<nInnerSector;ns++){
433 phi1 = ns * InnerOpenAngle + 270.*kDegrad + InnerAngleShift;
434 phi1 *= kRaddeg; // in degrees
436 phi1 = (Float_t)TMath::Nint(phi1);
438 if (phi1 > 360.) phi1 -= 360.;
443 phi3 = ns * InnerOpenAngle + InnerAngleShift;
444 phi3 *= kRaddeg; // in degrees
446 phi3 = (Float_t)TMath::Nint(phi3);
448 if(phi3 > 360.) phi3 -= 360.;
452 alpha = phi3*kDegrad;
454 x = xCenterS * TMath::Cos(alpha);
455 y = xCenterS * TMath::Sin(alpha);
457 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
459 gMC->Gspos("TRCS", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY");
463 //---------------------------------------------------------------
464 // position all sectors
465 //---------------------------------------------------------------
467 gMC->Gspos("TSGA",ns+1,"TGAS",x,y,zs,idrotm[nRotMat], "ONLY");
468 gMC->Gspos("TSGA",ns+1+nInnerSector,"TGAS",x,y,-zs,idrotm[nRotMat], "ONLY");
473 //---------------------------------------------------------------
474 // position selected sectors
475 //---------------------------------------------------------------
477 for(Int_t sel=0;sel<6;sel++){
479 if(fSecLows[sel] == ns){
480 gMC->Gspos("TSGA", ns+1, "TGAS", x, y, zs, idrotm[nRotMat], "ONLY");
482 else if(fSecLows[sel] == ns+nInnerSector){
484 Gspos("TSGA",ns+1+nInnerSector,"TGAS", x, y,-zs,idrotm[nRotMat],"ONLY");
493 //-------------------------------------------------------------------
494 // Positioning of the L-sectors readout chambers
495 //-------------------------------------------------------------------
497 for(ns=0;ns<nOuterSector;ns++){
498 phi1 = ns * OuterOpenAngle + 270.*kDegrad + OuterAngleShift;
499 phi1 *= kRaddeg; // in degrees
501 phi1 = (Float_t)TMath::Nint(phi1);
504 if (phi1 > 360.) phi1 -= 360.;
509 phi3 = ns * OuterOpenAngle+OuterAngleShift;
510 phi3 *= kRaddeg; // in degrees
512 phi3 = (Float_t)TMath::Nint(phi3);
515 if(phi3 > 360.) phi3 -= 360.;
519 alpha = phi3*kDegrad;
521 x = xCenterL * TMath::Cos(alpha);
522 y = xCenterL * TMath::Sin(alpha);
524 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
527 gMC->Gspos("TRCL", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY");
533 //-------------------------------------------------------------------
534 // Positioning of the L-sectors (gas sectors)
535 //-------------------------------------------------------------------
537 for(ns=0;ns<nOuterSector;ns++){
539 phi1 = ns*OuterOpenAngle + OuterAngleShift;
542 phi1 = (Float_t)TMath::Nint(phi1);
543 if(phi1>360.) phi1 -= 360.;
548 if(phi2>360.) phi2 -= 360.;
557 //--------------------------------------------------------------
558 // position all sectors
559 //--------------------------------------------------------------
561 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
563 gMC->Gspos("TLGA",ns+1,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
572 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
574 gMC->Gspos("TLGA",ns+1+nOuterSector,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
581 //---------------------------------------------------------------
582 // position selected sectors
583 //---------------------------------------------------------------
585 for(Int_t sel=0;sel<12;sel++){
587 if(fSecUps[sel] == ns+2*nInnerSector){
589 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
590 gMC->Gspos("TLGA",ns+1,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
594 else if(fSecUps[sel] == ns+2*nInnerSector+nOuterSector){
601 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
603 Gspos("TLGA",ns+1+nOuterSector,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
614 Float_t z0 = z_side - 0.95;
616 gMC->Gspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY");
618 // ==========================================================
620 // ==========================================================
623 // auxilary structures
627 gMC->Gsvolu("TPWI","TUBE",idtmed[24],dm,0); // "air"
629 // ----------------------------------------------------------
630 // Large wheel -> positioned in the TPC
631 // ----------------------------------------------------------
634 z0 = 263.5; // TPC length - 1/2 spoke wheel width
640 gMC->Gsvolu("TPWL", "TUBE", idtmed[0], dm, 3);
646 gMC->Gsposp("TPWI",1,"TPWL",0.,0.,0.,0,"ONLY",dm,3);
648 gMC->Gspos("TPWL", 1, "TPC ", 0, 0, z0, 0, "ONLY");
649 gMC->Gspos("TPWL", 2, "TPC ", 0, 0, -z0, 0, "ONLY");
652 // Outer vessel + CO2 HV degrader
659 gMC->Gsvolu("TPCO","TUBE",idtmed[12],dm,3);
664 gMC->Gsvolu("TPOV","TUBE",idtmed[10],dm,3);
666 gMC->Gspos("TPOV",1,"TPCO",0.,0.,0.,0,"ONLY");
670 gMC->Gspos("TPCO",1,"TPC ",0.,0.,0.,0,"ONLY");
673 //----------------------------------------------------------
674 // Small wheel -> positioned in "side gas
675 //----------------------------------------------------------
681 gMC->Gsvolu("TPWS", "TUBE", idtmed[0], dm, 3);
687 gMC->Gsvolu("TPW1", "TUBE", idtmed[2], dm, 3);
689 gMC->Gspos("TPW1", 1, "TPWS", 0., 0., 0., 0, "ONLY");
691 z0 = 1.; // spoke wheel is shifted w.r.t. center of the "side gas"
693 gMC->Gspos("TPWS", 1, "TPSG", 0, 0, z0, 0, "ONLY");
702 gMC->Gsvolu("TPS1","TUBE",idtmed[0],dm,3);
706 gMC->Gsvolu("TPS2","TUBE",idtmed[24],dm,3);
708 gMC->Gspos("TPS2",1,"TPS1",0.,0.,0.,0,"ONLY");
712 gMC->Gspos("TPS1",1,"TPC ",0.,0.,z0,0,"ONLY");
713 gMC->Gspos("TPS1",2,"TPC ",0.,0.,-z0,0,"ONLY");
721 gMC->Gsvolu("TPG2","TUBE",idtmed[8],dm,3);
725 gMC->Gspos("TPG2",1,"TPC ",0.,0.,z0,0,"ONLY");
726 gMC->Gspos("TPG2",2,"TPC ",0.,0.,-z0,0,"ONLY");
729 //---------------------------------------------------------
730 // central wheel 6 (radial direction) x 4 (along z) cm2
731 //---------------------------------------------------------
737 gMC->Gsvolu("TPWC","TUBE",idtmed[0],dm,3);
743 gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3);
745 z0 = z_side - 1.9 - 2.;
747 gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY");
751 gMC->Gsvolu("TPSE","BOX ",idtmed[24],dm,0); // "empty" part of the spoke
754 //---------------------------------------------------------
755 // inner spokes (nSectorInner)
756 //---------------------------------------------------------
758 dm[0] = 0.5*(139.9-82.1);
762 Float_t x1 = dm[0]+82.;
764 gMC->Gsvolu("TPSI","BOX",idtmed[0],dm,3);
769 gMC->Gsposp("TPSE",1,"TPSI",0.,0.,0.,0,"ONLY",dm,3);
771 for(ns=0;ns<nInnerSector;ns++){
773 phi1 = 0.5*InnerOpenAngle + ns*InnerOpenAngle + InnerAngleShift;
777 phi1 = (Float_t)TMath::Nint(phi1);
778 if(phi1>360.) phi1 -= 360.;
781 if(phi2>360.) phi2 -= 360.;
786 alpha = phi1 * kDegrad;
787 x = x1 * TMath::Cos(alpha);
788 y = x1 * TMath::Sin(alpha);
790 AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3);
792 gMC->Gspos("TPSI",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY");
798 //-------------------------------------------------------------
799 // outer spokes (nSectorOuter)
800 //-------------------------------------------------------------
802 dm[0] = 0.5*(257.9-146.1);
808 gMC->Gsvolu("TPSO","BOX ",idtmed[0],dm,3);
813 gMC->Gsposp("TPSE",2,"TPSO",0.,0.,0.,0,"ONLY",dm,3);
815 for(ns=0;ns<nOuterSector;ns++){
817 phi1 = 0.5*OuterOpenAngle + ns*OuterOpenAngle + OuterAngleShift;
821 phi1 = (Float_t)TMath::Nint(phi1);
822 if(phi1>360.) phi1 -= 360.;
825 if(phi2>360.) phi2 -= 360.;
830 alpha = phi1 * kDegrad;
831 x = x1 * TMath::Cos(alpha);
832 y = x1 * TMath::Sin(alpha);
834 AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3);
836 gMC->Gspos("TPSO",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY");
844 // --------------------------------------------------------
845 // put the readout chambers into the TPC
846 // --------------------------------------------------------
855 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
859 gMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY");
860 gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY");
862 gMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
864 //----------------------------------------------------
865 // Inner vessel and HV degrader
866 //----------------------------------------------------
888 gMC->Gsvolu("TPVD", "PCON", idtmed[12], dm, 15); // CO2
905 gMC->Gsvolu("TIVC","PCON",idtmed[11],dm,9); // C-fibre
907 gMC->Gspos("TIVC",1,"TPVD",0.,0.,0.,0,"ONLY");
908 gMC->Gspos("TIVC",2,"TPVD",0.,0.,0.,idrotm[nRotMat],"ONLY");
916 gMC->Gsvolu("TIVB","TUBE",idtmed[9],dm,3);
918 gMC->Gspos("TIVB",1,"TPVD",0.,0.,0.,0,"ONLY");
920 gMC->Gspos("TPVD",1,"ALIC",0.,0.,0.,0,"ONLY");
923 // ---------------------------------------------------
925 // ---------------------------------------------------
927 gMC->Gsord("TGAS", 6);
928 gMC->Gsord("TPSG", 6);
934 //_____________________________________________________________________________
935 void AliTPCv2::DrawDetector()
938 // Draw a shaded view of the Time Projection Chamber version 1
941 // Set everything unseen
942 gMC->Gsatt("*", "seen", -1);
944 // Set ALIC mother transparent
945 gMC->Gsatt("ALIC","SEEN",0);
947 // Set the volumes visible
948 gMC->Gsatt("TPC","SEEN",0);
949 gMC->Gsatt("TGAS","SEEN",0);
950 gMC->Gsatt("TPSG","SEEN",0);
951 gMC->Gsatt("TPHV","SEEN",1);
952 gMC->Gsatt("TPMH","SEEN",1);
953 gMC->Gsatt("TPEC","SEEN",0);
954 gMC->Gsatt("TRCS","SEEN",1);
955 gMC->Gsatt("TRCL","SEEN",1);
956 gMC->Gsatt("TPWL","SEEN",1);
957 gMC->Gsatt("TPWI","SEEN",1);
958 gMC->Gsatt("TPWS","SEEN",1);
959 gMC->Gsatt("TPW1","SEEN",1);
960 gMC->Gsatt("TPS1","SEEN",1);
961 gMC->Gsatt("TPS2","SEEN",1);
962 gMC->Gsatt("TPG1","SEEN",1);
963 gMC->Gsatt("TPG2","SEEN",1);
964 gMC->Gsatt("TPWC","SEEN",1);
965 gMC->Gsatt("TPSI","SEEN",1);
966 gMC->Gsatt("TPSO","SEEN",1);
967 gMC->Gsatt("TPCO","SEEN",1);
968 gMC->Gsatt("TPOV","SEEN",1);
969 gMC->Gsatt("TPVD","SEEN",1);
971 gMC->Gdopt("hide", "on");
972 gMC->Gdopt("shad", "on");
973 gMC->Gsatt("*", "fill", 7);
974 gMC->SetClipBox(".");
975 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
977 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
978 gMC->Gdhead(1111, "Time Projection Chamber");
979 gMC->Gdman(18, 4, "MAN");
980 gMC->Gdopt("hide","off");
983 //_____________________________________________________________________________
984 void AliTPCv2::CreateMaterials()
987 // Define materials for version 2 of the Time Projection Chamber
991 // Increase maximum number of steps
992 gMC->SetMaxNStep(30000);
994 AliTPC::CreateMaterials();
997 //_____________________________________________________________________________
998 void AliTPCv2::Init()
1001 // Initialises version 2 of the TPC after that it has been built
1003 Int_t *idtmed = fIdtmed->GetArray()-399;
1005 fIdSens1=gMC->VolId("TLGA"); // L-sector
1006 fIdSens2=gMC->VolId("TSGA"); // S-sector
1007 fIdSens3=gMC->VolId("TSST"); // strip - S-sector (not always used)
1008 fIdSens4=gMC->VolId("TLST"); // strip - S-sector (not always used)
1010 gMC->SetMaxNStep(30000); // max. number of steps increased
1012 gMC->Gstpar(idtmed[403],"LOSS",5);
1014 printf("*** TPC version 2 initialized ***\n");
1015 printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
1021 //_____________________________________________________________________________
1022 void AliTPCv2::StepManager()
1025 // Called for every step in the Time Projection Chamber
1029 // parameters used for the energy loss calculations
1031 const Float_t prim = 14.35; // number of primary collisions per 1 cm
1032 const Float_t poti = 20.77e-9; // first ionization potential for Ne/CO2
1033 const Float_t w_ion = 35.97e-9; // energy for the ion-electron pair creation
1036 const Float_t big = 1.e10;
1041 TClonesArray &lhits = *fHits;
1048 gMC->SetMaxStep(big);
1050 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1052 Float_t charge = gMC->TrackCharge();
1054 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1057 id=gMC->CurrentVolID(copy);
1059 // Check the sensitive volume
1063 vol[0] = copy + fTPCParam->GetNInnerSector()-1; // L-sector number
1065 else if(id == fIdSens2)
1067 vol[0] = copy-1; // S-sector number
1069 else if(id == fIdSens3 && gMC->IsTrackEntering())
1071 vol[1] = copy-1; // row number
1072 id = gMC->CurrentVolOffID(1,copy);
1073 vol[0] = copy-1; // sector number (S-sector)
1075 //I.Belikov's modification
1077 gMC->TrackMomentum(pos);
1081 hits[3]=0.; // this hit has no energy loss
1082 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1084 //end of I.Belikov's modification
1086 gMC->TrackPosition(pos);
1090 hits[3]=0.; // this hit has no energy loss
1091 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1093 else if(id == fIdSens4 && gMC->IsTrackEntering())
1095 vol[1] = copy-1; // row number
1096 id = gMC->CurrentVolOffID(1,copy);
1097 vol[0] = copy+fTPCParam->GetNInnerSector()-1; // sector number (L-sector)
1099 //I.Belikov's modification
1101 gMC->TrackMomentum(pos);
1105 hits[3]=0.; // this hit has no energy loss
1106 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1108 //end of I.Belikov's modification
1110 gMC->TrackPosition(pos);
1114 hits[3]=0.; // this hit has no energy loss
1115 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1120 // charged particle is in the sensitive volume
1123 if(gMC->TrackStep() > 0) {
1125 Int_t nel = (Int_t)(((gMC->Edep())-poti)/w_ion) + 1;
1126 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1128 gMC->TrackPosition(pos);
1132 hits[3]=(Float_t)nel;
1136 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1140 // Stemax calculation for the next step
1144 gMC->TrackMomentum(mom);
1145 Float_t ptot=mom.Rho();
1146 Float_t beta_gamma = ptot/gMC->TrackMass();
1148 Int_t pid=gMC->TrackPid();
1149 if((pid==kElectron || pid==kPositron) && ptot > 0.002)
1151 pp = prim*1.58; // electrons above 20 MeV/c are on the plateau!
1155 pp=prim*BetheBloch(beta_gamma);
1156 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1160 gMC->Rndm(random,1); // good, old GRNDM from Geant3
1162 Double_t rnd = (Double_t)random[0];
1164 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1168 //_____________________________________________________________________________
1169 Float_t AliTPCv2::BetheBloch(Float_t bg)
1172 // Bethe-Bloch energy loss formula
1174 const Double_t p1=0.76176e-1;
1175 const Double_t p2=10.632;
1176 const Double_t p3=0.13279e-4;
1177 const Double_t p4=1.8631;
1178 const Double_t p5=1.9479;
1180 Double_t dbg = (Double_t) bg;
1182 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
1184 Double_t aa = TMath::Power(beta,p4);
1185 Double_t bb = TMath::Power(1./dbg,p5);
1187 bb=TMath::Log(p3+bb);
1189 return ((Float_t)((p2-aa-bb)*p1/aa));