1 ///////////////////////////////////////////////////////////////////////////////
3 // Time Projection Chamber version 2 -- detailed TPC and slow simulation //
7 <img src="picts/AliTPCv2Class.gif">
12 ///////////////////////////////////////////////////////////////////////////////
24 //_____________________________________________________________________________
25 AliTPCv2::AliTPCv2(const char *name, const char *title) :
29 // Standard constructor for Time Projection Chamber version 2
33 SetBufferSize(128000);
36 //_____________________________________________________________________________
37 void AliTPCv2::CreateGeometry()
40 // Create the geometry of Time Projection Chamber version 2
44 <img src="picts/AliTPCv2.gif">
49 <img src="picts/AliTPCv2Tree.gif">
53 AliTPCParam * fTPCParam = &(fDigParam->GetParam());
55 Int_t *idtmed = fIdtmed->GetArray();
64 Int_t nInnerSector = fTPCParam->GetNInnerSector()/2;
65 Int_t nOuterSector = fTPCParam->GetNOuterSector()/2;
67 // ---------------------------------------------------
68 // sector specification check
69 // ---------------------------------------------------
73 for (i = 0; i < 6; ++i) {
74 if (fSecLows[i] >= 0 && fSecLows[i] < 2*nInnerSector) {
76 printf("*** SECTOR %d selected\n",fSecLows[i]);
81 printf("*** ALL LOWER SECTORS SELECTED ***\n");
88 for (i = 0; i < 12; ++i) {
89 if (fSecUps[i] > 2*nInnerSector-1 &&
90 fSecUps[i] < 2*(nInnerSector+nOuterSector)) {
92 printf("*** SECTOR %d selected\n",fSecUps[i]);
97 printf("*** ALL UPPER SECTORS SELECTED ***\n");
101 if (ifl1 == 0 && ifl2 == 0) {
102 printf("*** ERROR: AT LEAST ONE SECTOR MUST BE SPECIFIED ***\n");
103 printf("!!! PROGRAM STOPPED !!!\n");
107 if ((fSecAL < 0 || fSecAU < 0) && fSens >= 0) {
108 printf("** ERROR: STRIPS CANNOT BE SPECIFIED FOR ALL SECTORS **\n");
109 printf("!!! PROGRAM STOPPED !!!\n");
113 // ----------------------------------------------------
114 // FIELD CAGE WITH ENDCAPS - G10
115 // THIS IS ALSO A TPC MOTHER VOLUME
116 // ----------------------------------------------------
122 gMC->Gsvolu("TPC ", "TUBE", idtmed[8], dm, 3);
124 //-----------------------------------------------------
125 // Endcap cover c-fibre 0.86% X0
126 //-----------------------------------------------------
132 gMC->Gsvolu("TPEC","TUBE",idtmed[10],dm,3);
134 //-----------------------------------------------------
135 // Drift gas , leave 2 cm at the outer radius
137 //-----------------------------------------------------
143 gMC->Gsvolu("TGAS", "TUBE", idtmed[3], dm, 3);
145 //------------------------------------------------------
146 // membrane holder - carbon fiber
147 //------------------------------------------------------
150 gMC->Gsvolu("TPMH","TUBE",idtmed[6],dm,0);
156 gMC->Gsposp("TPMH",1,"TGAS",0.,0.,0.,0,"ONLY",dm,3);
162 gMC->Gsposp("TPMH",2,"TGAS",0.,0.,0.,0,"ONLY",dm,3);
164 //----------------------------------------------------------
165 // HV membrane - 25 microns of mylar
166 //----------------------------------------------------------
172 gMC->Gsvolu("TPHV","TUBE",idtmed[5],dm,3);
174 gMC->Gspos("TPHV",1,"TGAS",0.,0.,0.,0,"ONLY");
176 gMC->Gspos("TGAS",1,"TPC ",0.,0.,0.,0,"ONLY");
178 //----------------------------------------------------------
179 // "side" gas volume, the same as the drift gas
180 // the readout chambers are placed there.
181 //----------------------------------------------------------
185 dm[2] = 0.5*(275. - 250.);
187 gMC->Gsvolu("TPSG", "TUBE", idtmed[2], dm, 3);
189 Float_t z_side = dm[2]; // 1/2 of the side gas thickness
191 //-----------------------------------------------------------
192 // Readout chambers , 25% of X0, I use Al as the material
193 //-----------------------------------------------------------
195 Float_t InnerOpenAngle = fTPCParam->GetInnerAngle();
196 Float_t OuterOpenAngle = fTPCParam->GetOuterAngle();
198 Float_t InnerAngleShift = fTPCParam->GetInnerAngleShift();
199 Float_t OuterAngleShift = fTPCParam->GetOuterAngleShift();
201 Float_t InSecLowEdge = fTPCParam->GetInSecLowEdge();
202 Float_t InSecUpEdge = fTPCParam->GetInSecUpEdge();
204 Float_t OuSecLowEdge = fTPCParam->GetOuSecLowEdge();
205 Float_t OuSecUpEdge = fTPCParam->GetOuSecUpEdge();
208 Float_t SecThick = 2.225; // Al
210 Float_t edge = fTPCParam->GetEdge();
214 dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-edge;
215 dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-edge;
216 dm[2] = 0.5*SecThick;
217 dm[3] = 0.5*(InSecUpEdge-InSecLowEdge);
219 Float_t xCenterS = InSecLowEdge+dm[3];
221 gMC->Gsvolu("TRCS", "TRD1", idtmed[0], dm, 4);
225 dm[0] = OuSecLowEdge*TMath::Tan(0.5*OuterOpenAngle)-edge;
226 dm[1] = OuSecUpEdge*TMath::Tan(0.5*OuterOpenAngle)-edge;
227 dm[2] = 0.5*SecThick;
228 dm[3] = 0.5*(OuSecUpEdge-OuSecLowEdge);
230 Float_t xCenterL = OuSecLowEdge+dm[3];
232 gMC->Gsvolu("TRCL", "TRD1", idtmed[0], dm, 4);
234 Float_t z1 = -z_side + SecThick*0.5;
236 //------------------------------------------------------------------
237 // S sectors - "gas sectors" (TRD1)
238 //------------------------------------------------------------------
240 dm[0] = InSecLowEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01;
241 dm[1] = InSecUpEdge*TMath::Tan(0.5*InnerOpenAngle)-0.01;
242 dm[2] = 0.5*(250. - 0.001);
243 dm[3] = 0.5*(InSecUpEdge-InSecLowEdge);
245 gMC->Gsvolu("TSGA", "TRD1", idtmed[4], dm, 4); // sensitive
247 // -------------------------------------------------------------
248 // Only for the debugging purpose and resolution calculation
249 // Sensitive strips at the pad-row center
250 // -------------------------------------------------------------
258 Float_t StripThick = 0.01; // 100 microns
259 Float_t dead = fTPCParam->GetDeadZone();
261 gMC->Gsvolu("TSST", "TRD1", idtmed[4], dm, 0);
263 dm[2] = 0.5*(250. - 0.002);
264 dm[3] = 0.5 * StripThick;
267 for (ns = 0; ns < fTPCParam->GetNRowLow(); ns++) {
269 r1 = fTPCParam->GetPadRowRadiiLow(ns);
270 r2 = r1 + StripThick;
271 dm[0] = r1 * TMath::Tan(0.5*InnerOpenAngle) - dead;
272 dm[1] = r2 * TMath::Tan(0.5*InnerOpenAngle) - dead;
274 zz = -InSecLowEdge -0.5*(InSecUpEdge-InSecLowEdge);
278 gMC->Gsposp("TSST", ns+1, "TSGA", 0., 0., zz, 0, "ONLY", dm, 4);
283 gMC->Gsord("TSGA", 3);
285 } // if strips selected
288 //-----------------------------------------------------------------
289 // L sectors - "gas sectors" (PGON to avoid overlaps)
290 //-----------------------------------------------------------------
292 dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle;
294 dm[0] = (Float_t)TMath::Nint(dm[0]);
296 dm[1] = OuterOpenAngle*kRaddeg;
297 dm[1] = (Float_t)TMath::Nint(dm[1]);
303 dm[5] = OuSecLowEdge;
304 dm[6] = 252.*TMath::Cos(0.5*OuterOpenAngle)-0.002;
311 dm[11] = OuSecLowEdge;
312 dm[12] = OuSecUpEdge;
318 gMC->Gsvolu("TLGA","PGON",idtmed[4],dm,16);
322 Float_t rmax = dm[6];
324 Float_t dead = fTPCParam->GetDeadZone();
326 Float_t StripThick = 0.01; // 100 microns
328 gMC->Gsvolu("TLST", "PGON", idtmed[4], dm, 0);
330 dm[0] = 360.*kDegrad - 0.5*OuterOpenAngle;
332 dm[0] = (Float_t)TMath::Nint(dm[0]);
334 dm[1] = OuterOpenAngle*kRaddeg;
335 dm[1] = (Float_t)TMath::Nint(dm[1]);
342 Float_t xx = dead/TMath::Tan(0.5*OuterOpenAngle);
344 for(ns=0;ns<fTPCParam->GetNRowUp();ns++){
346 r1 = fTPCParam->GetPadRowRadiiUp(ns)-xx;
347 r2 = r1 + StripThick;
362 gMC->Gsposp("TLST",ns+1,"TLGA",xx,0.,0.,0,"ONLY",dm,10);
366 gMC->Gsord("TLGA", 4);
368 } // if strips selected
370 //------------------------------------------------------------------
371 // Positioning of the S-sector readout chambers
372 //------------------------------------------------------------------
374 Float_t zs = 0.5*(250.+0.002);
376 Float_t theta1,theta2,theta3;
377 Float_t phi1,phi2,phi3;
381 for(ns=0;ns<nInnerSector;ns++){
383 phi1 = ns * InnerOpenAngle + 270.*kDegrad + InnerAngleShift;
384 phi1 *= kRaddeg; // in degrees
386 phi1 = (Float_t)TMath::Nint(phi1);
388 if (phi1 > 360.) phi1 -= 360.;
393 phi3 = ns * InnerOpenAngle + InnerAngleShift;
394 phi3 *= kRaddeg; // in degrees
396 phi3 = (Float_t)TMath::Nint(phi3);
398 if(phi3 > 360.) phi3 -= 360.;
402 alpha = phi3*kDegrad;
404 x = xCenterS * TMath::Cos(alpha);
405 y = xCenterS * TMath::Sin(alpha);
407 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
409 gMC->Gspos("TRCS", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY");
413 //---------------------------------------------------------------
414 // position all sectors
415 //---------------------------------------------------------------
417 gMC->Gspos("TSGA",ns+1,"TGAS",x,y,zs,idrotm[nRotMat], "ONLY");
418 gMC->Gspos("TSGA",ns+1+nInnerSector,"TGAS",x,y,-zs,idrotm[nRotMat], "ONLY");
423 //---------------------------------------------------------------
424 // position selected sectors
425 //---------------------------------------------------------------
427 for(Int_t sel=0;sel<6;sel++){
429 if(fSecLows[sel] == ns){
430 gMC->Gspos("TSGA", ns+1, "TGAS", x, y, zs, idrotm[nRotMat], "ONLY");
432 else if(fSecLows[sel] == ns+nInnerSector){
434 Gspos("TSGA",ns+1+nInnerSector,"TGAS", x, y,-zs,idrotm[nRotMat],"ONLY");
443 //-------------------------------------------------------------------
444 // Positioning of the L-sectors readout chambers
445 //-------------------------------------------------------------------
447 for(ns=0;ns<nOuterSector;ns++){
448 phi1 = ns * OuterOpenAngle + 270.*kDegrad + OuterAngleShift;
449 phi1 *= kRaddeg; // in degrees
451 phi1 = (Float_t)TMath::Nint(phi1);
454 if (phi1 > 360.) phi1 -= 360.;
459 phi3 = ns * OuterOpenAngle+OuterAngleShift;
460 phi3 *= kRaddeg; // in degrees
462 phi3 = (Float_t)TMath::Nint(phi3);
465 if(phi3 > 360.) phi3 -= 360.;
469 alpha = phi3*kDegrad;
471 x = xCenterL * TMath::Cos(alpha);
472 y = xCenterL * TMath::Sin(alpha);
474 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
477 gMC->Gspos("TRCL", ns+1, "TPSG", x, y, z1, idrotm[nRotMat], "ONLY");
483 //-------------------------------------------------------------------
484 // Positioning of the L-sectors (gas sectors)
485 //-------------------------------------------------------------------
487 for(ns=0;ns<nOuterSector;ns++){
489 phi1 = ns*OuterOpenAngle + OuterAngleShift;
492 phi1 = (Float_t)TMath::Nint(phi1);
493 if(phi1>360.) phi1 -= 360.;
498 if(phi2>360.) phi2 -= 360.;
507 //--------------------------------------------------------------
508 // position all sectors
509 //--------------------------------------------------------------
511 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
513 gMC->Gspos("TLGA",ns+1,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
522 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
524 gMC->Gspos("TLGA",ns+1+nOuterSector,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
531 //---------------------------------------------------------------
532 // position selected sectors
533 //---------------------------------------------------------------
535 for(Int_t sel=0;sel<12;sel++){
537 if(fSecUps[sel] == ns+2*nInnerSector){
539 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
540 gMC->Gspos("TLGA",ns+1,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
544 else if(fSecUps[sel] == ns+2*nInnerSector+nOuterSector){
551 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
553 Gspos("TLGA",ns+1+nOuterSector,"TGAS" ,0.,0.,0.,idrotm[nRotMat],"ONLY");
564 Float_t z0 = z_side - 0.95;
566 gMC->Gspos("TPEC",1,"TPSG",0.,0.,z0,0,"ONLY");
568 // ==========================================================
570 // ==========================================================
573 // auxilary structures
577 gMC->Gsvolu("TPWI","TUBE",idtmed[24],dm,0); // "air"
579 // ----------------------------------------------------------
580 // Large wheel -> positioned in the TPC
581 // ----------------------------------------------------------
584 z0 = 263.5; // TPC length - 1/2 spoke wheel width
590 gMC->Gsvolu("TPWL", "TUBE", idtmed[0], dm, 3);
596 gMC->Gsposp("TPWI",1,"TPWL",0.,0.,0.,0,"ONLY",dm,3);
598 gMC->Gspos("TPWL", 1, "TPC ", 0, 0, z0, 0, "ONLY");
599 gMC->Gspos("TPWL", 2, "TPC ", 0, 0, -z0, 0, "ONLY");
602 // Outer vessel + CO2 HV degrader
609 gMC->Gsvolu("TPCO","TUBE",idtmed[12],dm,3);
614 gMC->Gsvolu("TPOV","TUBE",idtmed[10],dm,3);
616 gMC->Gspos("TPOV",1,"TPCO",0.,0.,0.,0,"ONLY");
625 gMC->Gsvolu("TPG1","TUBE",idtmed[8],dm,3);
626 gMC->Gspos("TPG1",1,"TPCO",0.,0.,251.,0,"ONLY");
627 gMC->Gspos("TPG1",2,"TPCO",0.,0.,-251.,0,"ONLY");
629 gMC->Gspos("TPCO",1,"TPC ",0.,0.,0.,0,"ONLY");
632 //----------------------------------------------------------
633 // Small wheel -> positioned in "side gas
634 //----------------------------------------------------------
640 gMC->Gsvolu("TPWS", "TUBE", idtmed[0], dm, 3);
646 gMC->Gsvolu("TPW1", "TUBE", idtmed[2], dm, 3);
648 gMC->Gspos("TPW1", 1, "TPWS", 0., 0., 0., 0, "ONLY");
650 z0 = 1.; // spoke wheel is shifted w.r.t. center of the "side gas"
652 gMC->Gspos("TPWS", 1, "TPSG", 0, 0, z0, 0, "ONLY");
661 gMC->Gsvolu("TPS1","TUBE",idtmed[0],dm,3);
665 gMC->Gsvolu("TPS2","TUBE",idtmed[24],dm,3);
667 gMC->Gspos("TPS2",1,"TPS1",0.,0.,0.,0,"ONLY");
671 gMC->Gspos("TPS1",1,"TPC ",0.,0.,z0,0,"ONLY");
672 gMC->Gspos("TPS1",2,"TPC ",0.,0.,-z0,0,"ONLY");
680 gMC->Gsvolu("TPG2","TUBE",idtmed[8],dm,3);
684 gMC->Gspos("TPG2",1,"TPC ",0.,0.,z0,0,"ONLY");
685 gMC->Gspos("TPG2",2,"TPC ",0.,0.,-z0,0,"ONLY");
688 //---------------------------------------------------------
689 // central wheel 6 (radial direction) x 4 (along z) cm2
690 //---------------------------------------------------------
696 gMC->Gsvolu("TPWC","TUBE",idtmed[0],dm,3);
702 gMC->Gsposp("TPWI",2,"TPWC",0.,0.,0.,0,"ONLY",dm,3);
704 z0 = z_side - 1.9 - 2.;
706 gMC->Gspos("TPWC",1,"TPSG",0.,0.,z0,0,"ONLY");
710 gMC->Gsvolu("TPSE","BOX ",idtmed[24],dm,0); // "empty" part of the spoke
713 //---------------------------------------------------------
714 // inner spokes (nSectorInner)
715 //---------------------------------------------------------
717 dm[0] = 0.5*(139.9-82.1);
721 Float_t x1 = dm[0]+82.;
723 gMC->Gsvolu("TPSI","BOX",idtmed[0],dm,3);
728 gMC->Gsposp("TPSE",1,"TPSI",0.,0.,0.,0,"ONLY",dm,3);
730 for(ns=0;ns<nInnerSector;ns++){
732 phi1 = 0.5*InnerOpenAngle + ns*InnerOpenAngle + InnerAngleShift;
736 phi1 = (Float_t)TMath::Nint(phi1);
737 if(phi1>360.) phi1 -= 360.;
740 if(phi2>360.) phi2 -= 360.;
745 alpha = phi1 * kDegrad;
746 x = x1 * TMath::Cos(alpha);
747 y = x1 * TMath::Sin(alpha);
749 AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3);
751 gMC->Gspos("TPSI",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY");
757 //-------------------------------------------------------------
758 // outer spokes (nSectorOuter)
759 //-------------------------------------------------------------
761 dm[0] = 0.5*(257.9-146.1);
767 gMC->Gsvolu("TPSO","BOX ",idtmed[0],dm,3);
772 gMC->Gsposp("TPSE",2,"TPSO",0.,0.,0.,0,"ONLY",dm,3);
774 for(ns=0;ns<nOuterSector;ns++){
776 phi1 = 0.5*OuterOpenAngle + ns*OuterOpenAngle + OuterAngleShift;
780 phi1 = (Float_t)TMath::Nint(phi1);
781 if(phi1>360.) phi1 -= 360.;
784 if(phi2>360.) phi2 -= 360.;
789 alpha = phi1 * kDegrad;
790 x = x1 * TMath::Cos(alpha);
791 y = x1 * TMath::Sin(alpha);
793 AliMatrix(idrotm[nRotMat],theta1,phi1,theta2,phi2,theta3,phi3);
795 gMC->Gspos("TPSO",ns+1,"TPSG",x,y,z0,idrotm[nRotMat],"ONLY");
803 // --------------------------------------------------------
804 // put the readout chambers into the TPC
805 // --------------------------------------------------------
814 AliMatrix(idrotm[nRotMat], theta1, phi1, theta2, phi2, theta3, phi3);
818 gMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY");
819 gMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[nRotMat], "ONLY");
821 gMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
823 //----------------------------------------------------
824 // Inner vessel and HV degrader
825 //----------------------------------------------------
847 gMC->Gsvolu("TPVD", "PCON", idtmed[12], dm, 15); // CO2
864 gMC->Gsvolu("TIVC","PCON",idtmed[11],dm,9); // C-fibre
866 gMC->Gspos("TIVC",1,"TPVD",0.,0.,0.,0,"ONLY");
867 gMC->Gspos("TIVC",2,"TPVD",0.,0.,0.,idrotm[nRotMat],"ONLY");
875 gMC->Gsvolu("TIVB","TUBE",idtmed[9],dm,3);
877 gMC->Gspos("TIVB",1,"TPVD",0.,0.,0.,0,"ONLY");
879 gMC->Gspos("TPVD",1,"ALIC",0.,0.,0.,0,"ONLY");
882 // ---------------------------------------------------
884 // ---------------------------------------------------
886 gMC->Gsord("TGAS", 6);
887 gMC->Gsord("TPSG", 6);
893 //_____________________________________________________________________________
894 void AliTPCv2::DrawDetector()
897 // Draw a shaded view of the Time Projection Chamber version 1
900 // Set everything unseen
901 gMC->Gsatt("*", "seen", -1);
903 // Set ALIC mother transparent
904 gMC->Gsatt("ALIC","SEEN",0);
906 // Set the volumes visible
907 gMC->Gsatt("TPC","SEEN",0);
908 gMC->Gsatt("TGAS","SEEN",0);
909 gMC->Gsatt("TPSG","SEEN",0);
910 gMC->Gsatt("TPHV","SEEN",1);
911 gMC->Gsatt("TPMH","SEEN",1);
912 gMC->Gsatt("TPEC","SEEN",0);
913 gMC->Gsatt("TRCS","SEEN",1);
914 gMC->Gsatt("TRCL","SEEN",1);
915 gMC->Gsatt("TPWL","SEEN",1);
916 gMC->Gsatt("TPWI","SEEN",1);
917 gMC->Gsatt("TPWS","SEEN",1);
918 gMC->Gsatt("TPW1","SEEN",1);
919 gMC->Gsatt("TPS1","SEEN",1);
920 gMC->Gsatt("TPS2","SEEN",1);
921 gMC->Gsatt("TPG1","SEEN",1);
922 gMC->Gsatt("TPG2","SEEN",1);
923 gMC->Gsatt("TPWC","SEEN",1);
924 gMC->Gsatt("TPSI","SEEN",1);
925 gMC->Gsatt("TPSO","SEEN",1);
926 gMC->Gsatt("TPCO","SEEN",1);
927 gMC->Gsatt("TPOV","SEEN",1);
928 gMC->Gsatt("TPVD","SEEN",1);
930 gMC->Gdopt("hide", "on");
931 gMC->Gdopt("shad", "on");
932 gMC->Gsatt("*", "fill", 7);
933 gMC->SetClipBox(".");
934 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
936 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
937 gMC->Gdhead(1111, "Time Projection Chamber");
938 gMC->Gdman(18, 4, "MAN");
939 gMC->Gdopt("hide","off");
942 //_____________________________________________________________________________
943 void AliTPCv2::CreateMaterials()
946 // Define materials for version 2 of the Time Projection Chamber
950 // Increase maximum number of steps
951 gMC->SetMaxNStep(30000);
953 AliTPC::CreateMaterials();
956 //_____________________________________________________________________________
957 void AliTPCv2::Init()
960 // Initialises version 2 of the TPC after that it has been built
962 Int_t *idtmed = fIdtmed->GetArray()-399;
964 fIdSens1=gMC->VolId("TLGA"); // L-sector
965 fIdSens2=gMC->VolId("TSGA"); // S-sector
966 fIdSens3=gMC->VolId("TSST"); // strip - S-sector (not always used)
967 fIdSens4=gMC->VolId("TLST"); // strip - S-sector (not always used)
969 gMC->SetMaxNStep(30000); // max. number of steps increased
971 gMC->Gstpar(idtmed[403],"LOSS",5);
973 printf("*** TPC version 2 initialized ***\n");
974 printf("Maximum number of steps = %d\n",gMC->GetMaxNStep());
980 //_____________________________________________________________________________
981 void AliTPCv2::StepManager()
984 // Called for every step in the Time Projection Chamber
988 // parameters used for the energy loss calculations
990 const Float_t prim = 14.35; // number of primary collisions per 1 cm
991 const Float_t poti = 20.77e-9; // first ionization potential for Ne/CO2
992 const Float_t w_ion = 35.97e-9; // energy for the ion-electron pair creation
994 // const Float_t prim = 17.65;
995 // const Float_t poti = 19.02e-9;
996 // const Float_t w_ion = 33.06e-9;
999 const Float_t big = 1.e10;
1004 TClonesArray &lhits = *fHits;
1007 AliTPCParam *fTPCParam = &(fDigParam->GetParam());
1013 gMC->SetMaxStep(big);
1015 if(!gMC->IsTrackAlive()) return; // particle has disappeared
1017 Float_t charge = gMC->TrackCharge();
1019 if(TMath::Abs(charge)<=0.) return; // take only charged particles
1022 id=gMC->CurrentVolID(copy);
1024 // Check the sensitive volume
1028 vol[0] = copy + fTPCParam->GetNInnerSector()-1; // L-sector number
1030 else if(id == fIdSens2)
1032 vol[0] = copy-1; // S-sector number
1034 else if(id == fIdSens3 && gMC->IsTrackEntering())
1036 vol[1] = copy-1; // row number
1037 id = gMC->CurrentVolOffID(1,copy);
1038 vol[0] = copy-1; // sector number (S-sector)
1040 gMC->TrackPosition(pos);
1044 hits[3]=0.; // this hit has no energy loss
1045 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1047 else if(id == fIdSens4 && gMC->IsTrackEntering())
1049 vol[1] = copy-1; // row number
1050 id = gMC->CurrentVolOffID(1,copy);
1051 vol[0] = copy+fTPCParam->GetNInnerSector()-1; // sector number (L-sector)
1053 gMC->TrackPosition(pos);
1057 hits[3]=0.; // this hit has no energy loss
1058 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1063 // charged particle is in the sensitive volume
1066 if(gMC->TrackStep() > 0) {
1068 Int_t nel = (Int_t)(((gMC->Edep())-poti)/w_ion) + 1;
1069 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
1071 gMC->TrackPosition(pos);
1075 hits[3]=(Float_t)nel;
1079 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
1083 // Stemax calculation for the next step
1087 gMC->TrackMomentum(mom);
1088 Float_t ptot=mom.Rho();
1089 Float_t beta_gamma = ptot/gMC->TrackMass();
1091 if(gMC->IdFromPDG(gMC->TrackPid()) <= 3 && ptot > 0.002)
1093 pp = prim*1.58; // electrons above 20 MeV/c are on the plateau!
1097 pp=prim*BetheBloch(beta_gamma);
1098 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
1102 gMC->Rndm(random,1); // good, old GRNDM from Geant3
1104 Double_t rnd = (Double_t)random[0];
1106 gMC->SetMaxStep(-TMath::Log(rnd)/pp);
1110 //_____________________________________________________________________________
1111 Float_t AliTPCv2::BetheBloch(Float_t bg)
1114 // Bethe-Bloch energy loss formula
1116 const Double_t p1=0.76176e-1;
1117 const Double_t p2=10.632;
1118 const Double_t p3=0.13279e-4;
1119 const Double_t p4=1.8631;
1120 const Double_t p5=1.9479;
1122 Double_t dbg = (Double_t) bg;
1124 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
1126 Double_t aa = TMath::Power(beta,p4);
1127 Double_t bb = TMath::Power(1./dbg,p5);
1129 bb=TMath::Log(p3+bb);
1131 return ((Float_t)((p2-aa-bb)*p1/aa));