91G4double G4MuPairProductionModel::zdat[]={1., 4., 13., 29., 92.};
92G4double G4MuPairProductionModel::adat[]={1.01, 9.01, 26.98, 63.55, 238.03};
93G4double 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 };
108 factorForCross(4.*fine_structure_const*fine_structure_const
109 *classic_electr_radius*classic_electr_radius/(3.*pi)),
110 sqrte(sqrt(exp(1.))),
113 minPairEnergy(4.*electron_mass_c2),
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;
223 for (
G4int l=0 ; l<kkk; l++)
226 for (
G4int ll=0; ll<8; ll++)
234 if (loss < 0.) loss = 0.;
248 if (tmax <= cut) {
return cross; }
255 if(kkk > 8) { kkk = 8; }
259 for(
G4int l=0; l<kkk; ++l)
261 for(
G4int i=0; i<8; ++i)
270 if(cross < 0.0) { cross = 0.0; }
290 G4double residEnergy = totalEnergy - pairEnergy;
292 G4double massratio2 = massratio*massratio ;
298 if (residEnergy <= c3*
z13) {
return cross; }
304 if (a3 <= 0.) {
return cross; }
308 if( Z < 1.5 ) { bbb = bbbh ; g1 = g1h ; g2 = g2h ; }
309 else { bbb = bbbtf; g1 = g1tf; g2 = g2tf; }
321 G4double a0 = totalEnergy*residEnergy;
322 G4double a1 = pairEnergy*pairEnergy/a0;
328 G4double tmnexp = alf/(1. + rta3) + del*rta3;
329 if(tmnexp >= 1.0)
return cross;
335 for (
G4int i=0; i<8; ++i)
347 G4double yed = 2.*(1.+3.*bet)*log(3.+xii)-a6-a1*(2.-a6) ;
349 G4double ale=log(bbb/
z13*sqrt(xi1*ye1)/(1.+screen*ye1)) ;
350 G4double cre = 0.5*log(1.+2.25*
z23*xi1*ye1/massratio2) ;
353 if (xi <= 1.e3) be = ((2.+a6)*(1.+bet)+xi*a9)*log(1.+xii)+(a5-bet)/xi1-a9;
354 else be = (3.-a6+a1*a7)/(2.*xi);
357 if (
fe < 0.)
fe = 0. ;
360 G4double ymd = a7*(1.5+a1)*log(3.+xi)+1.-1.5*a6 ;
362 G4double alm_crm = log(bbb*massratio/(1.5*
z23*(1.+screen*ym1)));
367 bm = (a7*(1.+1.5*bet)-a10*xii)*log(xi1)+xi*(a5-bet)/xi1+a10;
369 bm = (5.-a6+bet*a9)*(xi/2.);
373 if ( fm < 0.) fm = 0. ;
375 sum +=
wgi[i]*a4*(
fe+fm/massratio2);
378 cross = -tmn*sum*
factorForCross*z2*residEnergy/(totalEnergy*pairEnergy);
393 if (kineticEnergy <= lowestKinEnergy) {
return cross; }
398 G4double tmax = std::min(maxEnergy, maxPairEnergy);
399 G4double cut = std::max(cutEnergy, minPairEnergy);
400 if (cut >= tmax)
return cross;
403 if(tmax < kineticEnergy) {
411void G4MuPairProductionModel::MakeSamplingTables()
413 for (
G4int iz=0; iz<nzdat; ++iz)
418 for (
G4int it=0; it<ntdat; ++it) {
426 if(maxPairEnergy > minPairEnergy) {
434 G4double c = log(maxPairEnergy/minPairEnergy);
436 for (
G4int i=0 ; i<nbiny; ++i) {
441 G4double ep = minPairEnergy*exp(c*x) ;
446 proba[iz][it][i] = xSec;
450 for (
G4int i=0 ; i<nbiny; ++i) {
451 proba[iz][it][i] = xSec;
456 proba[iz][it][nbiny] = xSec;
460 samplingTablesAreFilled =
true;
480 for(it=1; it<ntdat; ++it) {
if(kineticEnergy <= tdat[it]) {
break; } }
481 if(it == ntdat) { --it; }
482 G4double dt = log(kineticEnergy/tdat[it-1])/log(tdat[it]/tdat[it-1]);
486 SelectRandomAtom(kineticEnergy, dt, it, couple, tmin);
491 G4double maxEnergy = std::min(tmax, maxPairEnergy);
492 G4double minEnergy = std::max(tmin, minPairEnergy);
494 if(minEnergy >= maxEnergy) {
return; }
499 G4double logmaxmin = log(maxPairEnergy/minPairEnergy);
503 G4int iymax = nbiny-1;
504 if( minEnergy > minPairEnergy)
506 G4double xc = log(minEnergy/minPairEnergy)/logmaxmin;
507 iymin = (
G4int)((log(xc) - ymin)/dy);
508 if(iymin >= nbiny) iymin = nbiny-1;
509 else if(iymin < 0) iymin = 0;
510 xc = log(maxEnergy/minPairEnergy)/logmaxmin;
511 iymax = (
G4int)((log(xc) - ymin)/dy) + 1;
512 if(iymax >= nbiny) iymax = nbiny-1;
513 else if(iymax < 0) iymax = 0;
519 for(iz=1; iz<nzdat; ++iz) {
if(
currentZ <= zdat[iz]) {
break; } }
520 if(iz == nzdat) { --iz; }
524 G4double pmin = InterpolatedIntegralCrossSection(dt,dz,iz,it,iymin,
currentZ);
525 G4double pmax = InterpolatedIntegralCrossSection(dt,dz,iz,it,iymax,
currentZ);
532 for(iy=iymin+1; iy<=iymax; ++iy) {
534 p2 = InterpolatedIntegralCrossSection(dt, dz, iz, it, iy,
currentZ);
535 if(p <= p2) {
break; }
539 G4double y = ya[iy-1] + dy*(p - p1)/(p2 - p1);
541 G4double PairEnergy = minPairEnergy*exp( exp(y)*logmaxmin );
543 if(PairEnergy < minEnergy) { PairEnergy = minEnergy; }
544 if(PairEnergy > maxEnergy) { PairEnergy = maxEnergy; }
549 *sqrt(1.-minPairEnergy/PairEnergy);
553 G4double ElectronEnergy = (1.-r)*PairEnergy*0.5;
554 G4double PositronEnergy = PairEnergy - ElectronEnergy;
560 G4double gmax = gam*std::min(1.0, totalEnergy/PairEnergy - 1.0);
564 G4double theta = sqrt(x/(1.0 - x))/gam;
567 G4double dirx = sint*cos(phi), diry = sint*sin(phi), dirz = cos(theta) ;
577 ElectronEnergy - electron_mass_c2);
582 PositronEnergy - electron_mass_c2);
585 kineticEnergy -= (ElectronEnergy + PositronEnergy);
588 partDirection *= totalMomentum;
590 partDirection = partDirection.
unit();
594 vdp->push_back(aParticle1);
595 vdp->push_back(aParticle2);
600const G4Element* G4MuPairProductionModel::SelectRandomAtom(
609 if (nElements == 1) {
return (*theElementVector)[0]; }
611 if(nElements > nmaxElements) {
612 nmaxElements = nElements;
613 partialSum.resize(nmaxElements);
622 for (i=0; i<nElements; ++i) {
623 G4double Z = ((*theElementVector)[i])->GetZ();
626 G4double minEnergy = std::max(tmin, minPairEnergy);
628 if(minEnergy < maxPairEnergy) {
631 for(iz=1; iz<nzdat; ++iz) {
if(Z <= zdat[iz]) {
break; } }
632 if(iz == nzdat) { --iz; }
633 G4double dz = log(Z/zdat[iz-1])/log(zdat[iz]/zdat[iz-1]);
636 if(minEnergy <= minPairEnergy)
640 G4double xc = log(minEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy);
642 if(iy < 0) { iy = 0; }
643 if(iy >= nbiny) { iy = nbiny-1; }
644 sigcut = InterpolatedIntegralCrossSection(dt,dz,iz,it,iy, Z);
647 G4double sigtot = InterpolatedIntegralCrossSection(dt,dz,iz,it,nbiny,Z);
648 dl = (sigtot - sigcut)*theAtomNumDensityVector[i];
651 if(dl < 0.0) { dl = 0.0; }
657 for (i=0; i<nElements; ++i) {
658 if(rval<=partialSum[i]) {
return (*theElementVector)[i]; }
661 return (*theElementVector)[nElements - 1];
std::vector< G4Element * > G4ElementVector
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
static G4Electron * Electron()
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetAtomicNumDensityVector() const
G4double ComputeMicroscopicCrossSection(G4double tkin, G4double Z, G4double cut)
void SetParticle(const G4ParticleDefinition *)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut, G4double tmax)
void SetCurrentElement(G4double Z)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
virtual G4double ComputeDMicroscopicCrossSection(G4double tkin, G4double Z, G4double pairEnergy)
virtual G4double MinEnergyCut(const G4ParticleDefinition *, const G4MaterialCutsCouple *)
const G4ParticleDefinition * particle
G4MuPairProductionModel(const G4ParticleDefinition *p=0, const G4String &nam="muPairProd")
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy)
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kineticEnergy)
virtual ~G4MuPairProductionModel()
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kineticEnergy, G4double Z, G4double A, G4double cutEnergy, G4double maxEnergy)
static G4NistManager * Instance()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
static G4Positron * Positron()
void SetLowEnergyLimit(G4double)
G4ParticleChangeForLoss * GetParticleChangeForLoss()