169 const G4double mass = std::sqrt(q.
t()*q.
t()-qq);
170 const G4double lf = ((q.
t()-mass)*pq/qq+p.
t())/mass;
174 res.
setT((p.
t()*q.
t()+pq)/mass);
190 const G4double lf = (lffac*pq+p.
t())*imass;
191 res.
setZ(p.
z()+qz*lf);
192 res.
setT((p.
t()*qt+pq)*imass);
204 return par[0] *
G4Exp((par[2]+loge*par[4])*loge)
205 / (par[1]+
G4Exp(par[3]*loge)+
G4Exp(par[5]*loge))
219 static const G4double ElectronMass2 = ElectronMass*ElectronMass;
224 static const G4double r02 = r0*r0*1.e+25;
227 static const G4double factor1 = 2.66134007899/(8.*alpha0*ElectronMass);
229 static const G4double PairInvMassMin = 2.*ElectronMass;
231 static const G4double nu[10] = { 0.0227436, 0.0582046, 3.0322675, 2.8275065,
232 -0.0034004, 1.1212766, 1.8989468, 68.3492750,
234 static const G4double tr[10] = { 0.0332350, 4.3942537, 2.8515925, 2.6351695,
235 -0.0031510, 1.5737305, 1.8104647, 20.6434021,
238 static const G4double para[3][2] = { {11., -16.},{-1.17, -2.95},{-2., -0.5} };
240 static const G4double correctionIndex = 1.4;
243 const G4double GammaEnergy2 = GammaEnergy*GammaEnergy;
247 if ( GammaEnergy <= 2.0*ElectronMass) {
return; }
256 GammaPolarization -= GammaPolarization.
dot(GammaDirection) * GammaDirection;
260 const G4double GammaPolarizationMag = GammaPolarization.
mag();
279 if ( GammaEnergy <= 4.0*ElectronMass )
return;
280 }
else if ( GammaEnergy > 4.0*ElectronMass ) {
284 if(rndmEngine->
flat()*(Z+1) < 1.) {
289 const G4double RecoilMass = itriplet ? ElectronMass : targetMass;
290 const G4double RecoilMass2 = RecoilMass*RecoilMass;
291 const G4double sCMS = 2.*RecoilMass*GammaEnergy + RecoilMass2;
292 const G4double sCMSPlusRM2 = sCMS + RecoilMass2;
293 const G4double sqrts = std::sqrt(sCMS);
294 const G4double isqrts2 = 1./(2.*sqrts);
296 const G4double PairInvMassMax = sqrts-RecoilMass;
297 const G4double PairInvMassRange = PairInvMassMax/PairInvMassMin;
305 const G4double CMSt = GammaEnergy+RecoilMass;
306 const G4double iCMSmass = 1./std::sqrt(RecoilMass*(RecoilMass+2.*GammaEnergy));
307 const G4double CMSfact = (CMSt-1./iCMSmass)/(CMSqz*CMSqz);
310 const G4double Threshold = itriplet ? 4.*ElectronMass : 2.*ElectronMass;
311 const G4double AvailableEnergy = GammaEnergy - Threshold;
314 const G4double MaxDiffCross = itriplet
321 const G4double xu1 = (LogAvailableEnergy > para[2][0])
322 ? para[0][0] + para[1][0]*LogAvailableEnergy
323 : para[0][0] + para[2][0]*para[1][0];
324 const G4double xl1 = (LogAvailableEnergy > para[2][1])
325 ? para[0][1] + para[1][1]*LogAvailableEnergy
326 : para[0][1] + para[2][1]*para[1][1];
347 }
while (cond1 < rndmv2[1]);
351 const G4double cosTheta = (x0-1.)*dum0;
352 const G4double sinTheta = std::sqrt(4.*x0)*dum0;
354 const G4double PairInvMass = PairInvMassMin*
G4Exp(X1*X1*lnPairInvMassRange);
372 const G4double cosThetaLept = std::cos(
pi*rndmv3[0]);
374 const G4double sinThetaLept = std::sqrt((1.-cosThetaLept)*(1.+cosThetaLept));
376 const G4double cosPhiLept = std::cos(twoPi*rndmv3[1]-
pi);
377 const G4double dumx0 = std::sqrt((1.-cosPhiLept)*(1.+cosPhiLept));
380 const G4double sinPhiLept = (rndmv3[1]<0.5) ? -1.*dumx0 : dumx0;
382 const G4double cosPhi = std::cos(twoPi*rndmv3[2]-
pi);
383 const G4double dumx1 = std::sqrt((1.-cosPhi)*(1.+cosPhi));
384 const G4double sinPhi = (rndmv3[2]<0.5) ? -1.*dumx1 : dumx1;
393 const G4double RecEnergyCMS = (sCMSPlusRM2-PairInvMass*PairInvMass)*isqrts2;
394 const G4double LeptonEnergy2 = PairInvMass*0.5;
395 const G4double thePRecoil = std::sqrt( (RecEnergyCMS-RecoilMass)
396 *(RecEnergyCMS+RecoilMass));
397 Recoil1.
setX( thePRecoil*sinTheta*cosPhi);
398 Recoil1.
setY( thePRecoil*sinTheta*sinPhi);
399 Recoil1.
setZ( thePRecoil*cosTheta);
400 Recoil1.
setT( RecEnergyCMS);
401 Pair1.
setX (-Recoil1.
x());
402 Pair1.
setY (-Recoil1.
y());
403 Pair1.
setZ (-Recoil1.
z());
404 Pair1.
setT ( RecEnergyCMS);
406 const G4double thePLepton = std::sqrt( (LeptonEnergy2-ElectronMass)
407 *(LeptonEnergy2+ElectronMass));
408 Positron2.
setX( thePLepton*sinThetaLept*cosPhiLept);
409 Positron2.
setY( thePLepton*sinThetaLept*sinPhiLept);
410 Positron2.
setZ( thePLepton*cosThetaLept);
411 Positron2.
setT( LeptonEnergy2);
412 Electron2.
setX(-Positron2.
x());
413 Electron2.
setY(-Positron2.
y());
414 Electron2.
setZ(-Positron2.
z());
415 Electron2.
setT( LeptonEnergy2);
417 Pair1.
setT(sqrts-RecEnergyCMS);
427 Recoil0.
setX(Recoil1.
x());
428 Recoil0.
setY(Recoil1.
y());
431 Positron0.
setX(Positron1.
x());
432 Positron0.
setY(Positron1.
y());
435 Electron0.
setX(Electron1.
x());
436 Electron0.
setY(Electron1.
y());
440 const G4double Jacob0 = x0*dum0*dum0;
441 const G4double Jacob1 = 2.*X1*lnPairInvMassRange*PairInvMass;
442 const G4double Jacob2 = std::abs(sinThetaLept);
455 const G4double dum1 = 1./std::sqrt( pPX*pPX + pPY*pPY );
456 const G4double cosPhiPlus = pPX*dum1;
457 const G4double sinPhiPlus = pPY*dum1;
461 const G4double elMassCTP = ElectronMass*cosThetaPlus;
462 const G4double ePlusSTP = EPlus*sinThetaPlus;
463 const G4double DPlus = (elMassCTP*elMassCTP + ePlusSTP*ePlusSTP)
464 /(EPlus + PPlus*cosThetaPlus);
473 const G4double dum2 = 1./std::sqrt( ePX*ePX + ePY*ePY );
474 const G4double cosPhiMinus = ePX*dum2;
475 const G4double sinPhiMinus = ePY*dum2;
477 const G4double elMassCTM = ElectronMass*cosThetaMinus;
478 const G4double eMinSTM = EMinus*sinThetaMinus;
479 const G4double DMinus = (elMassCTM*elMassCTM + eMinSTM*eMinSTM)
480 /(EMinus + PMinus*cosThetaMinus);
483 const G4double cosdPhi = cosPhiPlus*cosPhiMinus + sinPhiPlus*sinPhiMinus;
486 const G4double BigPhi = -ElectronMass2 / (GammaEnergy*GammaEnergy2 * q2*q2);
491 const G4double qun = factor1*iZ13*iZ13;
494 FormFactor = (nun < 0.01) ? (13.8-55.4*std::sqrt(nun))*nun
495 : std::sqrt(1-(nun-1)*(nun-1));
498 const G4double dum3 = 217.*PRec*iZ13;
499 const G4double AFF = 1./(1. + dum3*dum3);
500 FormFactor = (1.-AFF)*(1-AFF);
505 if (GammaPolarizationMag==0.) {
506 const G4double pPlusSTP = PPlus*sinThetaPlus;
507 const G4double pMinusSTM = PMinus*sinThetaMinus;
508 const G4double pPlusSTPperDP = pPlusSTP/DPlus;
509 const G4double pMinusSTMperDM = pMinusSTM/DMinus;
511 pPlusSTPperDP *pPlusSTPperDP *(4.*EMinus*EMinus-q2)
512 + pMinusSTMperDM*pMinusSTMperDM*(4.*EPlus*EPlus - q2)
513 + 2.*pPlusSTPperDP*pMinusSTMperDM*cosdPhi
514 *(4.*EPlus*EMinus + q2 - 2.*GammaEnergy2)
515 - 2.*GammaEnergy2*(pPlusSTP*pPlusSTP+pMinusSTM*pMinusSTM)/(DMinus*DPlus));
516 betheheitler = dunpol * factor;
518 const G4double pPlusSTP = PPlus*sinThetaPlus;
519 const G4double pMinusSTM = PMinus*sinThetaMinus;
520 const G4double pPlusSTPCPPperDP = pPlusSTP*cosPhiPlus/DPlus;
521 const G4double pMinusSTMCPMperDM = pMinusSTM*cosPhiMinus/DMinus;
522 const G4double caa = 2.*(EPlus*pMinusSTMCPMperDM+EMinus*pPlusSTPCPPperDP);
523 const G4double cbb = pMinusSTMCPMperDM-pPlusSTPCPPperDP;
524 const G4double ccc = (pPlusSTP*pPlusSTP + pMinusSTM*pMinusSTM
525 +2.*pPlusSTP*pMinusSTM*cosdPhi)/ (DMinus*DPlus);
526 const G4double dtot= 2.*BigPhi*( caa*caa - q2*cbb*cbb - GammaEnergy2*ccc);
527 betheheitler = dtot * factor;
530 const G4double cross = Norme * Jacob0 * Jacob1 * Jacob2 * betheheitler
531 * FormFactor * RecoilMass / sqrts;
532 pdf = cross * (xu1 - xl1) / cond1;
533 }
while ( pdf < ymax * rndmEngine->
flat() );
537 G4double recul = std::sqrt(Recoil0.
x()*Recoil0.
x()+Recoil0.
y()*Recoil0.
y()
538 +Recoil0.
z()*Recoil0.
z());
539 G4cout <<
"BetheHeitler5DModel GammaEnergy= " << GammaEnergy
540 <<
" PDF= " << pdf <<
" ymax= " << ymax
541 <<
" recul= " << recul <<
G4endl;
545 G4cout <<
"BetheHeitler5DModel GammaDirection " << GammaDirection <<
G4endl;
546 G4cout <<
"BetheHeitler5DModel GammaPolarization " << GammaPolarization <<
G4endl;
549 if (GammaPolarizationMag == 0.0) {
552 if (perp.
mag() == 0) {
554 perp = GammaDirection.
cross(axis);
556 perp = perp / perp.
mag();
558 perperp = perperp / perperp.
mag();
561 + Recoil0.
z()*GammaDirection;
563 Rot = Positron0.
x()*perp + Positron0.
y()*perperp
564 + Positron0.
z()*GammaDirection;
566 Rot = Electron0.
x()*perp + Electron0.
y()*perperp
567 + Electron0.
z()*GammaDirection;
574 + Recoil0.
z()*GammaDirection;
576 Rot = Positron0.
x()*GammaPolarization + Positron0.
y()*yGrec
577 + Positron0.
z()*GammaDirection;
579 Rot = Electron0.
x()*GammaPolarization + Electron0.
y()*yGrec
580 + Electron0.
z()*GammaDirection;
585 G4cout <<
"BetheHeitler5DModel Recoil0 " << Recoil0.
x() <<
" " << Recoil0.
y() <<
" " << Recoil0.
z()
586 <<
" " << Recoil0.
t() <<
" " <<
G4endl;
587 G4cout <<
"BetheHeitler5DModel Positron0 " << Positron0.
x() <<
" " << Positron0.
y() <<
" "
588 << Positron0.
z() <<
" " << Positron0.
t() <<
" " <<
G4endl;
589 G4cout <<
"BetheHeitler5DModel Electron0 " << Electron0.
x() <<
" " << Electron0.
y() <<
" "
590 << Electron0.
z() <<
" " << Electron0.
t() <<
" " <<
G4endl;
608 fvect->push_back(aParticle1);
609 fvect->push_back(aParticle2);
610 fvect->push_back(aParticle3);
void set(double x, double y, double z)
void SampleSecondaries(std::vector< G4DynamicParticle * > *fvect, const G4MaterialCutsCouple *couple, const G4DynamicParticle *aDynamicGamma, G4double, G4double) final
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
static G4IonTable * GetIonTable()
G4int SelectIsotopeNumber(const G4Element *)
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * fTheGamma
G4int GetConversionType() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
virtual void flatArray(const int size, double *vect)=0
double dot(const Hep3Vector &) const
void setVect(const Hep3Vector &)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4BetheHeitler5DModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="BetheHeitler5D")
static constexpr double classic_electr_radius
G4double G4Log(G4double x)
G4double LowEnergyLimit() const
static constexpr double electron_mass_c2
G4double MaxDiffCrossSection(const G4double *par, G4double eZ, G4double e, G4double loge) const
double A(double temperature)
static G4double GetNuclearMass(const G4double A, const G4double Z)
void BoostG4LorentzVector(const G4LorentzVector &p, const G4LorentzVector &q, G4LorentzVector &res) const
double howOrthogonal(const Hep3Vector &v) const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) final
Hep3Vector cross(const Hep3Vector &) const
static constexpr double twopi
G4ParticleChangeForGamma * fParticleChange
const G4ThreeVector & GetPolarization() const
G4IonisParamElm * GetIonisation() const
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4ParticleDefinition * fThePositron
G4ParticleDefinition * fTheElectron
virtual ~G4BetheHeitler5DModel()
static constexpr double pi
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
static constexpr double fine_structure_const
void ProposeTrackStatus(G4TrackStatus status)
static G4EmParameters * Instance()