531{
532 G4double eMass = CLHEP::electron_mass_c2;
534
535
540
544
545
547
548 G4double mingEnergy = std::sqrt(Q2);
550 G4double intervalgEnergy = maxgEnergy - mingEnergy;
551
552
554
555
556 G4double gMomentum = std::sqrt(gEnergy*gEnergy - Q2);
557
558
559 G4double particleFinalEnergy = kinEnergy - gEnergy;
560 G4double particleFinalMomentum = std::sqrt(particleFinalEnergy*particleFinalEnergy -
562
567
568
569
570
571
572
574
575
578 G4double maxEnergy = std::min(tmax, maxPairEnergy);
580
581 if (minEnergy >= maxEnergy) { return; }
582
583
584
585
586
587 CLHEP::HepRandomEngine* rndmEngine = G4Random::getTheEngine();
588
590
591
594
595
596
597
599
600
601
602
603 G4int iz1(0), iz2(0);
606 iz1 = iz2 = iz;
607 break;
609 iz2 = iz;
610 if(iz > 0) { iz1 = iz-1; }
611 else { iz1 = iz2; }
612 break;
613 }
614 }
615 if (0 == iz1) { iz1 = iz2 =
NZDATPAIR-1; }
616
619
620 do {
621 ++count;
622
624
626 if(iz1 != iz2) {
630
631
632 x += (x2 - x)*(
lnZ - lz1)/(lz2 - lz1);
633 }
634
635 pairEnergy = kinEnergy*
G4Exp(x*coeff);
636
637
638 } while((pairEnergy < minEnergy || pairEnergy > maxEnergy) && 50 > count);
639
640
641
644 fAngularGenerator->PhiRotation(partDirection, phi3);
645
649
651 G4double A1 = -(Q2 - 2.*kinEnergy*gEnergy);
652 G4double B1 = -(2.*gMomentum*particleMomentum);
654
656 G4double sintg = std::sqrt((1.0 - costg)*(1.0 + costg));
660
662 dirGamma.
set(sintg*cospg, sintg*sinpg, costg);
664
665 G4double Ap = particleMomentum*particleMomentum +
666 particleFinalMomentum*particleFinalMomentum + gMomentum*gMomentum;
667 G4double A = Ap - 2.*particleMomentum*gMomentum*costg;
668 G4double B = 2.*particleMomentum*gMomentum*sintg*cospg;
669 G4double C = 2.*particleFinalMomentum*gMomentum*costg -
670 2.*particleMomentum*particleFinalMomentum;
672 G4double t1interval = (1./(
A +
C + absB*mint3) - 1./(
A +
C + absB*maxt3))/absB;
676
677
679 partDirection.
set(sint1, 0., cost1);
680 fAngularGenerator->PhiRotation(partDirection, Phi);
681 kinEnergy = particleFinalEnergy;
682
685
686 G4LorentzVector eFourMomentumMQ = fAngularGenerator->eDP2(Q2, eMass2, eMass2, cost5, phi5);
687 G4LorentzVector pFourMomentumMQ = fAngularGenerator->pDP2(eMass2, eFourMomentumMQ);
688
691
692 eEnergy = eFourMomentum.
t();
693 pEnergy = pFourMomentum.
t();
694
696 G4double A3 = Q2 + 2.*gEnergy*particleFinalEnergy;
697 G4double B3 = -2.*gMomentum*particleFinalMomentum;
698
702
703 G4double sintQ3 = std::sqrt(1. - tQMG*tQMG);
706
707 G4double Ap = particleMomentum*particleMomentum +
708 particleFinalMomentum*particleFinalMomentum + gMomentum*gMomentum;
709 G4double A = Ap + 2.*particleFinalMomentum*gMomentum*tQMG;
710 G4double B = -2.*particleMomentum*gMomentum*sintQ3*cospQP;
711 G4double C = -2.*particleMomentum*gMomentum*tQMG - 2.*particleMomentum*particleFinalMomentum;
712
714 G4double t3interval = (1./(
A +
C + absB*mint3) - 1./(
A +
C + absB*maxt3))/absB;
718
719 G4double cost = -sint3*sintQ3*cospQP + cost3*tQMG;
720 G4double sint = std::sqrt((1. + cost)*(1. - cost));
721 G4double cosp = (sintQ3*cospQP*cost3 + sint3*tQMG)/sint;
723
725 dirGamma.
set(sint*cosp, sint*sinp, cost);
727
728
730 partDirection.
set(sint3, 0., cost3);
731 fAngularGenerator->PhiRotation(partDirection, Phi);
732 kinEnergy = particleFinalEnergy;
733
736
737 G4LorentzVector eFourMomentumMQ = fAngularGenerator->eDP2(Q2, eMass2, eMass2, cost5, phi5);
738 G4LorentzVector pFourMomentumMQ = fAngularGenerator->pDP2(eMass2, eFourMomentumMQ);
739
742
743 eEnergy = eFourMomentum.
t();
744 pEnergy = pFourMomentum.
t();
745
751 particleFinalMomentum = std::sqrt(particleFinalEnergy*particleFinalEnergy -
753
755 G4double maxeEnergy = kinEnergy - particleFinalEnergy - eMass;
756 G4double eEnergyinterval = maxeEnergy - mineEnergy;
757 eEnergy = mineEnergy + eEnergyinterval*
randNumbs[4];
758
765
766 G4double eMomentum = std::sqrt(eEnergy*eEnergy - eMass*eMass);
767 pEnergy = kinEnergy - particleFinalEnergy - eEnergy;
768 G4double pMomentum = std::sqrt(pEnergy*pEnergy - eMass*eMass);
769
771 G4double B3 = -2.*particleMomentum*particleFinalMomentum;
772 G4double cost3interval =
G4Log((A3 + B3*Cmax)/(A3 + B3*Cmin))/B3;
774 G4double cost3 = A3*(expanCost3r6 - 1.)/B3 + Cmin*expanCost3r6;
775 G4double sint3 = std::sqrt((1. - cost3)*(1. + cost3));
776
777 partDirection.
set(sint3, 0., cost3);
778
780 muFinalMomentumVector.
set(particleFinalMomentum*sint3, 0., particleFinalMomentum*cost3);
781
782 G4LorentzVector muFourMomentum(particleMomentum, particleMomentumVector);
783 G4LorentzVector muFinalFourMomentum(particleFinalEnergy, muFinalMomentumVector);
785 G4double A5 = auxVec1.
mag2() - 2.*eEnergy*(kinEnergy - particleFinalEnergy) +
786 2.*particleMomentumVector[2]*eMomentum - 2.*particleFinalMomentum*eMomentum*cost3;
787 G4double B5 = -2.*particleFinalMomentum*eMomentum*(sint3*cosp3*cosp5 + sint3*sinp3*sinp5);
792 G4double t5interval =
G4Log((absA5 + absB5*maxt5)/(absA5 + absB5*mint5))/absB5;
797
798 eDirection.
set(sint5*cosp5, sint5*sinp5, cost5);
800
801 G4ThreeVector auxVec2 = particleMomentumVector - muFinalMomentumVector - eMomentumVector;
803 G4double Bp = particleFinalMomentum*(sint3*cosp3*cosp6 + sint3*sinp3*sinp6) +
804 eMomentum*(sint5*cosp5*cosp6 + sint5*sinp5*sinp6);
805 G4double Cp = -particleMomentum + particleFinalMomentum*cost3 + eMomentum*cost5;
806 G4double A6 = p1mp3mp52 + pMomentum*pMomentum;
811 G4double absA6C6 = std::abs(A6 + C6);
813 G4double t6interval = (1./(absA6C6 + absB6*mint6) - 1./(absA6C6 + absB6*maxt6))/absB6;
814 G4double t6 = (-absA6C6 + 1./(1./(absA6C6 + absB6*mint6) - absB6*t6interval*
randNumbs[8]))/absB6;
817
818 pDirection.
set(sint6*cosp6, sint6*sinp6, cost6);
819
820 } else {
825 particleFinalMomentum = std::sqrt(particleFinalEnergy*particleFinalEnergy -
827
828 G4double maxpEnergy = kinEnergy - particleFinalEnergy - eMass;
829 G4double pEnergyinterval = maxpEnergy - eMass;
830 pEnergy = eMass + pEnergyinterval*
randNumbs[4];
831
838
839 G4double pMomentum = std::sqrt(pEnergy*pEnergy - eMass*eMass);
840 eEnergy = kinEnergy - particleFinalEnergy - pEnergy;
841 G4double eMomentum = std::sqrt(eEnergy*eEnergy - eMass*eMass);
842
844 G4double B3 = -2.*particleMomentum*particleFinalMomentum;
845 G4double cost3interval =
G4Log((A3 + B3*Cmax)/(A3 + B3*Cmin))/B3;
847 G4double cost3 = A3*(expanCost3r6 - 1.)/B3 + Cmin*expanCost3r6;
848 G4double sint3 = std::sqrt((1. - cost3)*(1. + cost3));
849
850 partDirection.
set(sint3*cosp3, sint3*sinp3, cost3);
851
853 muFinalMomentumVector.
set(particleFinalMomentum*sint3*cosp3,
854 particleFinalMomentum*sint3*sinp3,
855 particleFinalMomentum*cost3);
856
857 G4LorentzVector muFourMomentum(particleMomentum, particleMomentumVector);
858 G4LorentzVector muFinalFourMomentum(particleFinalEnergy, muFinalMomentumVector);
861 2.*pEnergy*(kinEnergy - particleFinalEnergy) + 2.*particleMomentumVector[2]*pMomentum -
862 2.*particleFinalMomentum*pMomentum*cost3;
863 G4double B6 = -2.*particleFinalMomentum*pMomentum*(sint3*cosp3*cosp6 + sint3*sinp3*sinp6);
868 G4double t6interval =
G4Log((absA6 + absB6*maxt6)/(absA6 + absB6*mint6))/absB6;
873
874 pDirection.
set(sint6*cosp6, sint6*sinp6, cost6);
876
877 G4ThreeVector auxVec2 = particleMomentumVector - muFinalMomentumVector - pMomentumVector;
879 G4double Bp = particleFinalMomentum*(sint3*cosp3*cosp5 + sint3*sinp3*sinp5) +
880 pMomentum*(sint6*cosp6*cosp5 + sint6*sinp6*sinp5);
881 G4double Cp = -particleMomentum + particleFinalMomentum*cost3 + pMomentum*cost6;
882 G4double A5 = p1mp3mp62 + eMomentum*eMomentum;
889 G4double t5interval = (1./(absA5C5 + absB5*mint5) - 1./(absA5C5 + absB5*maxt5))/absB5;
890 G4double t5 = (-absA5C5 + 1./(1./(absA5C5 + absB5*mint5) - absB5*t5interval*
randNumbs[8]))/absB5;
893
894 eDirection.set(sint5*cosp5, sint5*sinp5, cost5);
895 }
896
897 fAngularGenerator->Sample5DPairDirections(aDynamicParticle, eDirection, pDirection,
898 gEnergy, Q2, gMomentum,
899 particleFinalMomentum,
900 particleFinalEnergy,
902
903
904 auto aParticle1 = new G4DynamicParticle(theElectron, eDirection, eEnergy);
905 auto aParticle2 = new G4DynamicParticle(thePositron, pDirection, pEnergy);
906
907
908 vdp->push_back(aParticle1);
909 vdp->push_back(aParticle2);
910
911
912
916 auto newdp =
new G4DynamicParticle(
particle, muF);
917 vdp->push_back(newdp);
918 } else {
922 }
923
924}
G4double C(G4double temp)
G4double B(G4double temperature)
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
double dot(const Hep3Vector &) const
void set(double x, double y, double z)
HepLorentzVector & boost(double, double, double)
virtual void flatArray(const int size, double *vect)=0
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
G4double GetTotalMomentum() const
G4double FindScaledEnergy(G4int Z, G4double rand, G4double logTkin, G4double yymin, G4double yymax)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4double SecondaryThreshold() const