1 ///////////////////////////////////////////////////////////////////////////////
3 // Time Projection Chamber version 2 -- detailed TPC and slow simulation //
7 <img src="gif/AliTPCv2Class.gif">
12 ///////////////////////////////////////////////////////////////////////////////
15 #include <TGeometry.h>
27 //_____________________________________________________________________________
28 AliTPCv2::AliTPCv2(const char *name, const char *title) :
32 // Standard constructor for Time Projection Chamber version 2
36 SetBufferSize(128000);
39 //_____________________________________________________________________________
40 void AliTPCv2::CreateGeometry()
43 // Create the geometry of Time Projection Chamber version 2
47 <img src="gif/AliTPCv2.gif">
52 <img src="gif/AliTPCv2Tree.gif">
56 AliMC* pMC = AliMC::GetMC();
58 Int_t *idtmed = gAlice->Idtmed();
62 Float_t rlsl, wlsl, rssl, rlsu, wssl, wlsu, rssu, wssu;
64 Float_t alpha, x, y, z, sec_thick;
66 Float_t r1, r2, x1, z0, z1, x2, theta1, theta2, theta3, dm[21];
75 Float_t thu, opu, dzz;
76 Int_t ifl1 = 0, ifl2 = 0;
77 Float_t phi1, phi2, phi3;
79 // ---------------------------------------------------
80 // sector specification check
81 // ---------------------------------------------------
85 for (i = 0; i < 6; ++i) {
86 if (fSecLows[i] > 0 && fSecLows[i] <25) {
88 printf("*** SECTOR %d selected\n",fSecLows[i]);
93 printf("*** ALL LOWER SECTORS SELECTED ***\n");
99 for (i = 0; i < 12; ++i) {
100 if (fSecUps[i] > 24 && fSecUps[i] < 73) {
102 printf("*** SECTOR %d selected\n",fSecUps[i]);
107 printf("*** ALL UPPER SECTORS SELECTED ***\n");
110 if (ifl1 == 0 && ifl2 == 0) {
111 printf("*** ERROR: AT LEAST ONE SECTOR MUST BE SPECIFIED ***\n");
112 printf("!!! PROGRAM STOPPED !!!\n");
116 if ((fSecAL < 0 || fSecAU < 0) && fSens >= 0) {
117 printf("** ERROR: STRIPS CANNOT BE SPECIFIED FOR ALL SECTORS **\n");
118 printf("!!! PROGRAM STOPPED !!!\n");
121 // ----------------------------------------------------
122 // FIELD CAGE WITH ENDCAPS - CARBON FIBER
123 // THIS IS ALSO A TPC MOTHER VOLUME
124 // ----------------------------------------------------
129 pMC->Gsvolu("TPC ", "TUBE", idtmed[407], dm, 3);
130 // -------------------------------------------------------
131 // drift gas Ne/CO2 (90/10 volume) - nonsensitive
132 // field cage thickness = 0.52% X0
133 // ----------------------------------------------------
138 pMC->Gsvolu("TGAS", "TUBE", idtmed[402], dm, 3);
139 // ------------------------------------------------------
140 // "side" gas volume (the same as drift gas),
141 // here the readout chambers are positioned
142 // ------------------------------------------------------
143 dm[2] = 0.5*(275.-250.);
146 pMC->Gsvolu("TPSG", "TUBE", idtmed[401], dm, 3);
147 // ------------------------------------------------------
148 // HV midplane - 20 microns of mylar
149 // -----------------------------------------------------
152 pMC->Gsvolu("TPHV", "TUBE", idtmed[405], dm, 3);
154 // ====================================================
155 // lower and upper readout chambers
156 // ====================================================
157 // sectros opening angles in degrees
158 // ---------------------------------------------------
161 thl = TMath::Tan(opl * .5 * kDegrad);
162 thu = TMath::Tan(opu * .5 * kDegrad);
163 // ---------------------------------------------------
164 // S and L-sectors radii
165 // ---------------------------------------------------
170 // --------------------------------------------------
172 // --------------------------------------------------
177 // ---------------------------------------------------
178 // Sector thickness 25% of X0 (Al)
179 // ---------------------------------------------------
181 // ---------------------------------------------------
182 // S-sectors (lower sectors)
183 // ---------------------------------------------------
186 dm[2] = sec_thick * .5;
187 dm[3] = (rssu - rssl) * .5;
191 pMC->Gsvolu("TRCS", "TRD1", idtmed[399], dm, 4);
192 // -----------------------------------------------------
193 // S-sectors --> "gas sectors" - sensitive
194 // -----------------------------------------------------
195 dm[2] = (250.-0.001)/2.;
196 pMC->Gsvolu("TSGA", "TRD1", idtmed[403], dm, 4);
197 // -------------------------------------------------------------
198 // Only for the debugging purpose and resolution calculation
199 // Sensitive strips at the pad-row center
200 // -------------------------------------------------------------
202 pMC->Gsvolu("TSST", "TRD1", idtmed[403], dm, 0);
205 z0 = (rssu - rssl) * .5;
206 dzz = (rssu - rssl - padl * 22.) * .5;
209 for (iss = 1; iss <= 23; ++iss) {
210 r1 = rssl + dzz + (iss - 1) * padl - dm[3];
211 r2 = r1 + dm[3] * 2.;
212 dm[0] = r1 * thl - .01;
213 dm[1] = r2 * thl - .01;
214 zz = z0 + (iss - 1) * padl;
215 pMC->Gsposp("TSST", iss, "TSGA", 0, 0, zz, 0, "ONLY", dm, 4);
217 pMC->Gsord("TSGA", 3);
219 // ---------------------------------------------------
220 // L-sectors (upper sectors)
221 // ---------------------------------------------------
224 dm[2] = sec_thick * .5;
225 dm[3] = (rlsu - rlsl) * .5;
229 pMC->Gsvolu("TRCL", "TRD1", idtmed[399], dm, 4);
230 // -----------------------------------------------------
231 // L-sectors - "gas sectors" - sensitive!
232 // -----------------------------------------------------
233 dm[2] = (250.-0.001)/2.;
234 pMC->Gsvolu("TLGA", "TRD1", idtmed[403], dm, 4);
235 // -------------------------------------------------------------
236 // Only for the debugging purpose and resolution calculation
237 // Sensitive strips at the pad-row center
238 // -------------------------------------------------------------
240 pMC->Gsvolu("TLST", "TRD1", idtmed[403], dm, 0);
244 z0 = (rlsu - rlsl) * .5;
245 dzz = (rlsu - rlsl - padl * 51.) * .5;
248 for (ils = 1; ils <= 52; ++ils) {
249 r1 = rlsl + dzz + (ils - 1) * padl - dm[3];
250 r2 = r1 + dm[3] * 2.;
251 dm[0] = r1 * thu - 1.1;
252 dm[1] = r2 * thu - 1.1;
253 zz = z0 + (ils - 1) * padl;
254 pMC->Gsposp("TLST", ils, "TLGA", 0, 0, zz, 0, "ONLY", dm, 4);
256 pMC->Gsord("TLGA", 3);
258 // ******************************************************
259 // ------------------------------------------------
260 // positioning of lower sectors (1-12)*2
261 // rotation matrices 1-12
263 // the isec_al flag allows to select all (<0) or
264 // only a few (up to 6) sectors
265 // ------------------------------------------------
267 z1 = -z_side + sec_thick * .5;
269 for (il = 1; il <= 12; ++il) {
270 phi1 = (il - 1) * opl + 270.;
277 phi3 = (il - 1) * opl;
281 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
283 alpha = (il - 1) * opl * kDegrad;
284 x = x0l * TMath::Cos(alpha);
285 y = x0l * TMath::Sin(alpha);
288 // -----------------------------------------------------------
289 // position ALL lower sectors
290 // -----------------------------------------------------------
291 pMC->Gspos("TSGA", il, "TGAS", x, y, z, idrotm[idr], "ONLY");
292 pMC->Gspos("TSGA",il+12 , "TGAS", x, y, -z, idrotm[idr], "ONLY");
294 // -----------------------------------------------------------
295 // position selected lower sectors
296 // -----------------------------------------------------------
297 for (isll = 1; isll <= 6; ++isll) {
298 if (fSecLows[isll - 1] == il) {
299 pMC->Gspos("TSGA", il, "TGAS", x, y, z, idrotm[idr], "ONLY");
300 } else if (fSecLows[isll - 1] == il + 12) {
301 pMC->Gspos("TSGA",il+12 , "TGAS", x, y, -z, idrotm[idr],"ONLY");
306 pMC->Gspos("TRCS", il, "TPSG", x, y, z1, idrotm[idr], "ONLY");
309 // ----------------------------------------------------
310 // positioning of upper sectors (1-24)*2
311 // rotation matrices 13-36
312 // the isec_au flag allows to select all (<0) or
313 // only a few (up to 12) sectors
314 // ----------------------------------------------------
315 for (iu = 1; iu <= 24; ++iu) {
316 phi1 = (iu - 1) * opu + 270.;
323 phi3 = (iu - 1) * opu;
327 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
329 alpha = (iu - 1) * opu * kDegrad;
330 x = x0u * TMath::Cos(alpha);
331 y = x0u * TMath::Sin(alpha);
334 // -------------------------------------------------------------
335 // position ALL upper sectors
336 // -------------------------------------------------------------
337 pMC->Gspos("TLGA", iu, "TGAS", x, y, z, idrotm[idr], "ONLY");
338 pMC->Gspos("TLGA",iu+24 , "TGAS", x, y, -z, idrotm[idr], "ONLY");
340 // -------------------------------------------------------------
341 // position selected upper sectors
342 // -------------------------------------------------------------
343 for (isll = 1; isll <= 12; ++isll) {
344 if (fSecUps[isll - 1] == iu + 24) {
345 pMC->Gspos("TLGA", iu, "TGAS", x, y, z, idrotm[idr], "ONLY");
346 } else if (fSecUps[isll - 1] == iu + 48) {
347 pMC->Gspos("TLGA",iu+24 , "TGAS", x, y, -z, idrotm[idr],"ONLY");
352 pMC->Gspos("TRCL", iu, "TPSG", x, y, z1, idrotm[idr], "ONLY");
354 // --------------------------------------------------------
355 // Spoke wheel structures
356 // --------------------------------------------------------
357 pMC->Gsvolu("TSWS", "TUBE", idtmed[399], dm, 0);
365 pMC->Gsposp("TSWS", 1, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
370 pMC->Gsposp("TSWS", 2, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
375 pMC->Gsposp("TSWS", 3, "TPSG", 0, 0, z0, 0, "ONLY", dm, 3);
377 // -------------------------------------------------------
378 // this volumes are to avoid overlaping
379 // -------------------------------------------------------
385 pMC->Gsposp("TSWS", 4, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
386 pMC->Gsposp("TSWS", 5, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
390 pMC->Gsposp("TSWS", 6, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
391 pMC->Gsposp("TSWS", 7, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
394 dm[1] = 257.+0.09776;
399 pMC->Gsposp("TSWS", 8, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
400 pMC->Gsposp("TSWS", 9, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
401 // ==========================================================
403 // ==========================================================
404 // ----------------------------------------------------------
405 // Large wheel -> positioned in the TPC
406 // ----------------------------------------------------------
407 dm[0] = 257.+0.09776;
410 pMC->Gsvolu("TPW1", "TUBE", idtmed[399], dm, 3);
416 pMC->Gsvolu("TPW2", "TUBE", idtmed[498], dm, 3);
418 pMC->Gspos("TPW2", 1, "TPW1", 0, 0, 0, 0, "ONLY");
420 pMC->Gspos("TPW1", 1, "TPC ", 0, 0, z0, 0, "ONLY");
421 pMC->Gspos("TPW1", 2, "TPC ", 0, 0, -z0, 0, "ONLY");
422 // -----------------------------------------------------------
423 // Small wheel -> positioned in the TPSG
424 // -----------------------------------------------------------
429 pMC->Gsvolu("TPW3", "TUBE", idtmed[399], dm, 3);
435 pMC->Gsvolu("TPW4", "TUBE", idtmed[401], dm, 3);
437 pMC->Gspos("TPW4", 1, "TPW3", 0, 0, 0, 0, "ONLY");
441 pMC->Gspos("TPW3", 1, "TPSG", 0, 0, z0, 0, "ONLY");
442 // ---------------------------------------------------------
443 // spokes, inner and outer, also the inner ring
444 // ---------------------------------------------------------
445 dm[0] = 0.5*(135.9-82.1);
451 pMC->Gsvolu("TSPI", "BOX ", idtmed[399], dm, 3);
456 pMC->Gsvolu("TSP1", "BOX ", idtmed[498], dm, 3);
458 pMC->Gspos("TSP1", 1, "TSPI", 0, 0, 0, 0, "ONLY");
460 dm[0] = 0.5*(256.9-142.1);
466 pMC->Gsvolu("TSPO", "BOX ", idtmed[399], dm, 3);
471 pMC->Gsvolu("TSP2", "BOX ", idtmed[498], dm, 3);
473 pMC->Gspos("TSP2", 1, "TSPO", 0, 0, 0, 0, "ONLY");
474 // --------------------------------------------------------
479 pMC->Gsvolu("TSWH", "TUBE", idtmed[399], dm, 3);
485 pMC->Gsvolu("TSW1", "TUBE", idtmed[498], dm, 3);
487 pMC->Gspos("TSW1", 1, "TSWH", 0, 0, 0, 0, "ONLY");
489 z0 = z_side - .16168 - 2.;
490 // --------------------------------------------------------
491 pMC->Gspos("TSWH", 1, "TPSG", 0, 0, z0, 0, "ONLY");
492 // -------------------------------------------------------
493 // posiioning of the inner spokes
494 // -------------------------------------------------------
495 for (il = 1; il <= 6; ++il) {
496 phi1 = opl * .5 + (il - 1) * 2. * opl;
498 phi2 = opl * .5 + 90. + (il - 1) * 2. * opl;
506 alpha = phi1 * kDegrad;
507 x = x1 * TMath::Cos(alpha);
508 y = x1 * TMath::Sin(alpha);
512 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
513 pMC->Gspos("TSPI", il, "TPSG", x, y, z0, idrotm[idr], "ONLY");
517 for (iu = 1; iu <= 12; ++iu) {
518 phi1 = opu * .5 + (iu - 1) * 2. * opu;
520 phi2 = opu * .5 + 90. + (iu - 1) * 2. * opu;
528 alpha = phi1 * kDegrad;
529 x = x2 * TMath::Cos(alpha);
530 y = x2 * TMath::Sin(alpha);
534 AliMatrix(idrotm[idr], theta1, phi1, theta2, phi2, theta3, phi3);
535 pMC->Gspos("TSPO", iu, "TPSG", x, y, z0, idrotm[idr], "ONLY");
537 // --------------------------------------------------------
538 // endcap cover (C, 0.86% X0)
539 // --------------------------------------------------------
544 pMC->Gsvolu("TCOV", "TUBE", idtmed[407], dm, 3);
548 pMC->Gspos("TCOV", 1, "TPSG", 0, 0, z0, 0, "ONLY");
549 // --------------------------------------------------------
550 // put the readout chambers into the TPC
551 // --------------------------------------------------------
559 AliMatrix(idrotm[55], theta1, phi1, theta2, phi2, theta3, phi3);
563 pMC->Gspos("TPSG", 1, "TPC ", 0, 0, z0, 0, "ONLY");
564 pMC->Gspos("TPSG", 2, "TPC ", 0, 0, -z0, idrotm[55], "ONLY");
565 // ---------------------------------------------------------
566 // outer gas insulation (CO2)
567 // ---------------------------------------------------------
568 dm[0] = 257.+0.09776;
569 dm[1] = 278.-0.25004;
572 pMC->Gsvolu("TPOI", "TUBE", idtmed[406], dm, 3);
574 pMC->Gspos("TPHV", 1, "TGAS", 0, 0, 0, 0, "ONLY");
575 pMC->Gspos("TGAS", 1, "TPC ", 0, 0, 0, 0, "ONLY");
576 pMC->Gspos("TPOI", 1, "TPC ", 0, 0, 0, 0, "ONLY");
578 pMC->Gspos("TPC ", 1, "ALIC", 0, 0, 0, 0, "ONLY");
579 // ======================================================
580 // all volumes below are positioned in ALIC
581 // ======================================================
582 // ------------------------------------------------------
583 // the last parts of the smaller wheel (TSWS)
584 // ------------------------------------------------------
591 pMC->Gsposp("TSWS", 10, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
592 pMC->Gsposp("TSWS", 11, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
598 pMC->Gsposp("TSWS", 12, "TPC ", 0, 0, z0, 0, "ONLY", dm, 3);
599 pMC->Gsposp("TSWS", 13, "TPC ", 0, 0, -z0, 0, "ONLY", dm, 3);
600 // ----------------------------------------------------
601 // Inner vessel (PCON)
602 // This volume is to be positioned directly in ALIC
603 // ----------------------------------------------------
624 pMC->Gsvolu("TPIV", "PCON", idtmed[407], dm, 15);
625 // --------------------------------------------------------
626 // fill the inner vessel with CO2, (HV kDegrader)
627 // cone parts have different thickness
628 // than the central barrel, according to the TP
629 // --------------------------------------------------------
636 dm[3] = -(250.-0.2162);
637 dm[4] = (185.5-0.2126)*tana+0.2126;
656 dm[18] = (250.-0.2162);
657 dm[19] = (185.5-0.2126)*tana+0.2126;
660 pMC->Gsvolu("TPVD", "PCON", idtmed[406], dm, 21);
662 pMC->Gspos("TPVD", 1, "TPIV", 0, 0, 0, 0, "ONLY");
664 pMC->Gspos("TPIV", 1, "ALIC", 0, 0, 0, 0, "ONLY");
665 // ---------------------------------------------------
667 // ---------------------------------------------------
668 pMC->Gsord("TGAS", 6);
669 pMC->Gsord("TPSG", 6);
672 //_____________________________________________________________________________
673 void AliTPCv2::DrawModule()
676 // Draw a shaded view of the Time Projection Chamber version 1
679 AliMC* pMC = AliMC::GetMC();
681 // Set everything unseen
682 pMC->Gsatt("*", "seen", -1);
684 // Set ALIC mother transparent
685 pMC->Gsatt("ALIC","SEEN",0);
687 // Set the volumes visible
688 pMC->Gsatt("TPC","SEEN",0);
689 pMC->Gsatt("TGAS","SEEN",0);
690 pMC->Gsatt("TPSG","SEEN",0);
691 pMC->Gsatt("TPHV","SEEN",1);
692 pMC->Gsatt("TRCS","SEEN",1);
693 pMC->Gsatt("TRCL","SEEN",1);
694 pMC->Gsatt("TSWS","SEEN",1);
695 pMC->Gsatt("TPW1","SEEN",1);
696 pMC->Gsatt("TPW3","SEEN",1);
697 pMC->Gsatt("TSPI","SEEN",1);
698 pMC->Gsatt("TSPO","SEEN",1);
699 pMC->Gsatt("TSWH","SEEN",1);
700 pMC->Gsatt("TPOI","SEEN",1);
701 pMC->Gsatt("TPIV","SEEN",1);
702 pMC->Gsatt("TPVD","SEEN",1);
704 pMC->Gdopt("hide", "on");
705 pMC->Gdopt("shad", "on");
706 pMC->Gsatt("*", "fill", 7);
707 pMC->SetClipBox(".");
708 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
710 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .025, .025);
711 pMC->Gdhead(1111, "Time Projection Chamber");
712 pMC->Gdman(18, 4, "MAN");
713 pMC->Gdopt("hide","off");
716 //_____________________________________________________________________________
717 void AliTPCv2::CreateMaterials()
720 // Define materials for version 2 of the Time Projection Chamber
723 AliMC* pMC = AliMC::GetMC();
726 // Increase maximum number of steps
727 pMC->SetMaxNStep(30000);
729 AliTPC::CreateMaterials();
732 //_____________________________________________________________________________
733 void AliTPCv2::Init()
736 // Initialises version 2 of the TPC after that it has been built
738 AliMC* pMC=AliMC::GetMC();
739 Int_t *idtmed = gAlice->Idtmed();
741 fIdSens1=pMC->VolId("TLGA"); // L-sector
742 fIdSens2=pMC->VolId("TSGA"); // S-sector
743 fIdSens3=pMC->VolId("TSST"); // strip - S-sector (not always used)
744 fIdSens4=pMC->VolId("TLST"); // strip - S-sector (not always used)
746 pMC->SetMaxNStep(30000); // max. number of steps increased
748 pMC->Gstpar(idtmed[403],"LOSS",5);
750 printf("*** TPC version 2 initialized ***\n");
751 printf("Maximum number of steps = %d\n",pMC->GetMaxNStep());
757 //_____________________________________________________________________________
758 void AliTPCv2::StepManager()
761 // Called for every step in the Time Projection Chamber
765 // parameters used for the energy loss calculations
767 const Float_t prim = 14.35; // number of primary collisions per 1 cm
768 const Float_t poti = 20.77e-9; // first ionization potential for Ne/CO2
769 const Float_t w_ion = 35.97e-9; // energy for the ion-electron pair creation
772 const Float_t big = 1.e10;
777 TClonesArray &lhits = *fHits;
778 AliMC* pMC=AliMC::GetMC();
784 pMC->SetMaxStep(big);
786 if(!pMC->TrackAlive()) return; // particle has disappeared
788 Float_t charge = pMC->TrackCharge();
790 if(TMath::Abs(charge)<=0.) return; // take only charged particles
793 id=pMC->CurrentVol(0, copy);
795 // Check the sensitive volume
799 vol[0] = copy + 24; // L-sector number
801 else if(id == fIdSens2)
803 vol[0] = copy; // S-sector number
805 else if(id == fIdSens3 && pMC->TrackEntering())
807 vol[1] = copy; // row number
808 id = pMC->CurrentVolOff(1,0,copy);
809 vol[0] = copy; // sector number (S-sector)
811 pMC->TrackPosition(hits);
812 hits[3]=0.; // this hit has no energy loss
813 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
815 else if(id == fIdSens4 && pMC->TrackEntering())
817 vol[1] = copy; // row number
818 id = pMC->CurrentVolOff(1,0,copy);
819 vol[0] = copy+24; // sector number (L-sector)
821 pMC->TrackPosition(hits);
822 hits[3]=0.; // this hit has no energy loss
823 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
828 // charged particle is in the sensitive volume
831 if(pMC->TrackStep() > 0) {
833 Int_t nel = (Int_t)(((pMC->Edep())-poti)/w_ion) + 1;
834 nel=TMath::Min(nel,300); // 300 electrons corresponds to 10 keV
836 pMC->TrackPosition(hits);
837 hits[3]=(Float_t)nel;
841 new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->CurrentTrack(),vol,hits);
845 // Stemax calculation for the next step
849 pMC->TrackMomentum(vect);
850 Float_t ptot = vect[3];
851 Float_t beta_gamma = ptot/(pMC->TrackMass());
853 if(pMC->TrackPid() <= 3 && ptot > 0.002)
855 pp = prim*1.58; // electrons above 20 MeV/c are on the plateau!
859 pp=prim*BetheBloch(beta_gamma);
860 if(TMath::Abs(charge) > 1.) pp *= (charge*charge);
864 pMC->Rndm(random,1); // good, old GRNDM from Geant3
866 Double_t rnd = (Double_t)random[0];
868 pMC->SetMaxStep(-TMath::Log(rnd)/pp);
872 //_____________________________________________________________________________
873 Float_t AliTPCv2::BetheBloch(Float_t bg)
876 // Bethe-Bloch energy loss formula
878 const Double_t p1=0.76176e-1;
879 const Double_t p2=10.632;
880 const Double_t p3=0.13279e-4;
881 const Double_t p4=1.8631;
882 const Double_t p5=1.9479;
884 Double_t dbg = (Double_t) bg;
886 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
888 Double_t aa = TMath::Power(beta,p4);
889 Double_t bb = TMath::Power(1./dbg,p5);
891 bb=TMath::Log(p3+bb);
893 return ((Float_t)((p2-aa-bb)*p1/aa));