839{
840 static const G4double minLoss = 1.*eV ;
841 static const G4double probLim = 0.01 ;
842 static const G4double sumaLim = -std::log(probLim) ;
845 static const G4double factor = twopi_mc2_rcl2 ;
847
848
849
851 {
863 }
865 beta2,suma,e0,loss,lossc,w;
869 G4double Corrfac, na,alfa,rfac,namean,sa,alfa1,ea,sea;
870
873
874
875 if(MeanLoss < minLoss) return MeanLoss ;
876
877
879
880
881
883 ->GetEnergyCutsVector(1)))[
imat];
886 G4double Tm = 2.*electron_mass_c2*tau2/(1.+2.*tau1*rmass+rmass*rmass);
887
888
889
890 if(Tm > threshold) Tm = threshold;
891 beta2 = tau2/(tau1*tau1);
892
893
894 if(MeanLoss >= kappa*Tm || MeanLoss <= kappa*
ipotFluct)
895 {
897 siga = std::sqrt(Tm*(1.0-0.5*beta2)*step*
898 factor*electronDensity/beta2) ;
899 do {
900 loss = G4RandGauss::shoot(MeanLoss,siga) ;
901 } while (loss < 0. || loss > 2.0*MeanLoss);
902 return loss ;
903 }
904
906 w2 = std::log(2.*electron_mass_c2*tau2);
907
909
913
914 suma = a1+a2+a3;
915
916 loss = 0. ;
917
918 if(suma < sumaLim)
919 {
921
922
924 {
925 a3 = MeanLoss/e0;
926
927 if(a3>alim)
928 {
929 siga=std::sqrt(a3) ;
930 p3 = std::max(0,
G4int(G4RandGauss::shoot(a3,siga)+0.5));
931 }
933
934 loss = p3*e0 ;
935
937
938 }
939 else
940 {
941
943
944
945 if (Tm <= 0.)
946 {
947 loss = MeanLoss;
948 p3 = 0;
949
950 }
951 else
952 {
953 a3 = MeanLoss*(Tm-e0)/(Tm*e0*std::log(Tm/e0));
954
955
956
957 if(a3>alim)
958 {
959 siga=std::sqrt(a3) ;
960 p3 = std::max(0,
G4int(G4RandGauss::shoot(a3,siga)+0.5));
961 }
962 else
964
965
966 }
967
968 if(p3 > 0)
969 {
970 w = (Tm-e0)/Tm ;
972 {
973
977 }
978 else
979 Corrfac = 1. ;
980
982 loss *= e0*Corrfac ;
983
984 }
985 }
986 }
987
988 else
989 {
990
991 if(a1>alim)
992 {
993 siga=std::sqrt(a1) ;
994 p1 = std::max(0,int(G4RandGauss::shoot(a1,siga)+0.5));
995 }
996 else
998
999
1000 if(a2>alim)
1001 {
1002 siga=std::sqrt(a2) ;
1003 p2 = std::max(0,int(G4RandGauss::shoot(a2,siga)+0.5));
1004 }
1005 else
1007
1009
1010
1011 if(p2 > 0)
1013 else if (loss>0.)
1015
1016
1017 if(a3 > 0.)
1018 {
1019 if(a3>alim)
1020 {
1021 siga=std::sqrt(a3) ;
1022 p3 = std::max(0,int(G4RandGauss::shoot(a3,siga)+0.5));
1023 }
1024 else
1026
1027 lossc = 0.;
1028 if(p3 > 0)
1029 {
1030 na = 0.;
1031 alfa = 1.;
1033 {
1038 na = G4RandGauss::shoot(namean,sa);
1039 if (na > 0.)
1040 {
1042 alfa1 = alfa*std::log(alfa)/(alfa-1.);
1044 sea =
ipotFluct*std::sqrt(na*(alfa-alfa1*alfa1));
1045 lossc += G4RandGauss::shoot(ea,sea);
1046 }
1047 }
1048
1050 if (nb > 0)
1051 {
1053 w = (Tm-w2)/Tm;
1055 }
1056 }
1057
1058 loss += lossc;
1059 }
1060 }
1061
1062 return loss ;
1063}
G4long G4Poisson(G4double mean)
G4double GetKineticEnergy() const
G4double GetF2fluct() const
G4double GetLogEnergy1fluct() const
G4double GetLogEnergy2fluct() const
G4double GetMeanExcitationEnergy() const
G4double GetF1fluct() const
G4double GetEnergy2fluct() const
G4double GetEnergy1fluct() const
G4double GetRateionexcfluct() const
G4double GetEnergy0fluct() const
G4double GetLogMeanExcEnergy() const
const G4Material * GetMaterial() const
G4IonisParamMat * GetIonisation() const
G4double GetElectronDensity() const
static G4double ParticleMass