91 G4double G4MuPairProductionModel::zdat[]={1., 4., 13., 29., 92.};
92 G4double G4MuPairProductionModel::adat[]={1.01, 9.01, 26.98, 63.55, 238.03};
93 G4double G4MuPairProductionModel::tdat[]={1.e3, 1.e4, 1.e5, 1.e6, 1.e7, 1.e8,
96 0.5917, 0.7628, 0.8983, 0.9801 };
98 0.1813, 0.1569, 0.1112, 0.0506 };
110 sqrte(sqrt(exp(1.))),
114 lowestKinEnergy(
GeV),
121 dy((ymax-ymin)/nbiny),
122 samplingTablesAreFilled(false)
132 for(
size_t i=0; i<1001; ++i) { ya[i] = 0.0; }
147 return minPairEnergy;
156 return maxPairEnergy;
164 if (!samplingTablesAreFilled) {
166 MakeSamplingTables();
180 if (cutEnergy <= minPairEnergy || kineticEnergy <= lowestKinEnergy)
184 const G4double* theAtomicNumDensityVector =
189 G4double Z = (*theElementVector)[i]->GetZ();
193 dedx += loss*theAtomicNumDensityVector[i];
195 if (dedx < 0.) { dedx = 0.; }
209 G4double cut = std::min(cutEnergy,tmax);
210 if(cut <= minPairEnergy) {
return loss; }
219 if (kkk > 8) kkk = 8;
220 else if (kkk < 1) { kkk = 1; }
224 for (
G4int l=0 ; l<kkk; l++)
227 for (
G4int ll=0; ll<8; ll++)
235 if (loss < 0.) loss = 0.;
249 if (tmax <= cut) {
return cross; }
256 if(kkk > 8) { kkk = 8; }
260 for(
G4int l=0; l<kkk; ++l)
262 for(
G4int i=0; i<8; ++i)
271 if(cross < 0.0) { cross = 0.0; }
291 G4double residEnergy = totalEnergy - pairEnergy;
293 G4double massratio2 = massratio*massratio ;
299 if (residEnergy <= c3*
z13) {
return cross; }
305 if (a3 <= 0.) {
return cross; }
309 if( Z < 1.5 ) { bbb = bbbh ; g1 = g1h ; g2 = g2h ; }
310 else { bbb = bbbtf; g1 = g1tf; g2 = g2tf; }
313 G4double zeta1 = 0.073*log(totalEnergy/(particleMass+g1*
z23*totalEnergy))-0.26;
316 G4double zeta2 = 0.058*log(totalEnergy/(particleMass+g2*z13*totalEnergy))-0.14;
322 G4double a0 = totalEnergy*residEnergy;
323 G4double a1 = pairEnergy*pairEnergy/a0;
329 G4double tmnexp = alf/(1. + rta3) + del*rta3;
330 if(tmnexp >= 1.0)
return cross;
336 for (
G4int i=0; i<8; ++i)
348 G4double yed = 2.*(1.+3.*bet)*log(3.+xii)-a6-a1*(2.-a6) ;
350 G4double ale=log(bbb/z13*sqrt(xi1*ye1)/(1.+screen*ye1)) ;
351 G4double cre = 0.5*log(1.+2.25*
z23*xi1*ye1/massratio2) ;
354 if (xi <= 1.e3) be = ((2.+a6)*(1.+bet)+xi*a9)*log(1.+xii)+(a5-bet)/xi1-a9;
355 else be = (3.-a6+a1*a7)/(2.*xi);
358 if ( fe < 0.) fe = 0. ;
361 G4double ymd = a7*(1.5+a1)*log(3.+xi)+1.-1.5*a6 ;
363 G4double alm_crm = log(bbb*massratio/(1.5*
z23*(1.+screen*ym1)));
368 bm = (a7*(1.+1.5*bet)-a10*xii)*log(xi1)+xi*(a5-bet)/xi1+a10;
370 bm = (5.-a6+bet*a9)*(xi/2.);
374 if ( fm < 0.) fm = 0. ;
376 sum +=
wgi[i]*a4*(fe+fm/massratio2);
379 cross = -tmn*sum*
factorForCross*z2*residEnergy/(totalEnergy*pairEnergy);
394 if (kineticEnergy <= lowestKinEnergy) {
return cross; }
399 G4double tmax = std::min(maxEnergy, maxPairEnergy);
400 G4double cut = std::max(cutEnergy, minPairEnergy);
401 if (cut >= tmax)
return cross;
404 if(tmax < kineticEnergy) {
412 void G4MuPairProductionModel::MakeSamplingTables()
419 for (
G4int it=0; it<ntdat; ++it) {
427 if(maxPairEnergy > minPairEnergy) {
435 G4double c = log(maxPairEnergy/minPairEnergy);
437 for (
G4int i=0 ; i<nbiny; ++i) {
442 G4double ep = minPairEnergy*exp(c*x) ;
447 proba[
iz][it][i] = xSec;
451 for (
G4int i=0 ; i<nbiny; ++i) {
452 proba[
iz][it][i] = xSec;
457 proba[
iz][it][nbiny] = xSec;
461 samplingTablesAreFilled =
true;
476 sqrt(kineticEnergy*(kineticEnergy + 2.0*particleMass));
481 for(it=1; it<ntdat; ++it) {
if(kineticEnergy <= tdat[it]) {
break; } }
482 if(it == ntdat) { --it; }
483 G4double dt = log(kineticEnergy/tdat[it-1])/log(tdat[it]/tdat[it-1]);
487 SelectRandomAtom(kineticEnergy, dt, it, couple, tmin);
492 G4double maxEnergy = std::min(tmax, maxPairEnergy);
493 G4double minEnergy = std::max(tmin, minPairEnergy);
495 if(minEnergy >= maxEnergy) {
return; }
500 G4double logmaxmin = log(maxPairEnergy/minPairEnergy);
504 G4int iymax = nbiny-1;
505 if( minEnergy > minPairEnergy)
507 G4double xc = log(minEnergy/minPairEnergy)/logmaxmin;
508 iymin = (
G4int)((log(xc) - ymin)/dy);
509 if(iymin >= nbiny) iymin = nbiny-1;
510 else if(iymin < 0) iymin = 0;
511 xc = log(maxEnergy/minPairEnergy)/logmaxmin;
512 iymax = (
G4int)((log(xc) - ymin)/dy) + 1;
513 if(iymax >= nbiny) iymax = nbiny-1;
514 else if(iymax < 0) iymax = 0;
520 for(iz=1; iz<nzdat; ++
iz) {
if(
currentZ <= zdat[iz]) {
break; } }
521 if(iz == nzdat) { --
iz; }
525 G4double pmin = InterpolatedIntegralCrossSection(dt,dz,iz,it,iymin,
currentZ);
526 G4double pmax = InterpolatedIntegralCrossSection(dt,dz,iz,it,iymax,
currentZ);
533 for(iy=iymin+1; iy<=iymax; ++iy) {
535 p2 = InterpolatedIntegralCrossSection(dt, dz, iz, it, iy,
currentZ);
536 if(p <= p2) {
break; }
540 G4double y = ya[iy-1] + dy*(p - p1)/(p2 - p1);
542 G4double PairEnergy = minPairEnergy*exp( exp(y)*logmaxmin );
544 if(PairEnergy < minEnergy) { PairEnergy = minEnergy; }
545 if(PairEnergy > maxEnergy) { PairEnergy = maxEnergy; }
549 (1.-6.*particleMass*particleMass/(totalEnergy*(totalEnergy-PairEnergy)))
550 *sqrt(1.-minPairEnergy/PairEnergy);
554 G4double ElectronEnergy = (1.-
r)*PairEnergy*0.5;
555 G4double PositronEnergy = PairEnergy - ElectronEnergy;
561 G4double gmax = gam*std::min(1.0, totalEnergy/PairEnergy - 1.0);
568 G4double dirx = sint*cos(phi), diry = sint*sin(phi), dirz = cos(theta) ;
586 kineticEnergy -= (ElectronEnergy + PositronEnergy);
589 partDirection *= totalMomentum;
591 partDirection = partDirection.
unit();
595 vdp->push_back(aParticle1);
596 vdp->push_back(aParticle2);
601 const G4Element* G4MuPairProductionModel::SelectRandomAtom(
610 if (nElements == 1) {
return (*theElementVector)[0]; }
612 if(nElements > nmaxElements) {
613 nmaxElements = nElements;
614 partialSum.resize(nmaxElements);
623 for (i=0; i<nElements; ++i) {
624 G4double Z = ((*theElementVector)[i])->GetZ();
627 G4double minEnergy = std::max(tmin, minPairEnergy);
629 if(minEnergy < maxPairEnergy) {
632 for(iz=1; iz<nzdat; ++
iz) {
if(Z <= zdat[iz]) {
break; } }
633 if(iz == nzdat) { --
iz; }
634 G4double dz = log(Z/zdat[iz-1])/log(zdat[iz]/zdat[iz-1]);
637 if(minEnergy <= minPairEnergy)
641 G4double xc = log(minEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy);
643 if(iy < 0) { iy = 0; }
644 if(iy >= nbiny) { iy = nbiny-1; }
645 sigcut = InterpolatedIntegralCrossSection(dt,dz,iz,it,iy, Z);
648 G4double sigtot = InterpolatedIntegralCrossSection(dt,dz,iz,it,nbiny,Z);
649 dl = (sigtot - sigcut)*theAtomNumDensityVector[i];
652 if(dl < 0.0) { dl = 0.0; }
658 for (i=0; i<nElements; ++i) {
659 if(rval<=partialSum[i]) {
return (*theElementVector)[i]; }
662 return (*theElementVector)[nElements - 1];