Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4ParticleHPMadlandNixSpectrum Class Reference

#include <G4ParticleHPMadlandNixSpectrum.hh>

Inheritance diagram for G4ParticleHPMadlandNixSpectrum:
G4VParticleHPEDis

Public Member Functions

 G4ParticleHPMadlandNixSpectrum ()
 
G4double GetFractionalProbability (G4double anEnergy)
 
void Init (std::istream &aDataFile)
 
G4double Sample (G4double anEnergy)
 
 ~G4ParticleHPMadlandNixSpectrum ()
 

Private Member Functions

G4double E1 (G4double aValue)
 
G4double FissionIntegral (G4double tm, G4double anEnergy)
 
G4double Gamma05 (G4double aValue)
 
G4double Gamma15 (G4double aValue)
 
G4double Gamma25 (G4double aValue)
 
G4double GIntegral (G4double tm, G4double anEnergy, G4double aMean)
 
G4double Madland (G4double aSecEnergy, G4double tm)
 

Private Attributes

G4double expm1
 
G4double theAvarageKineticPerNucleonForHeavyFragments
 
G4double theAvarageKineticPerNucleonForLightFragments
 
G4ParticleHPVector theFractionalProb
 
G4ParticleHPVector theMaxTemp
 

Detailed Description

Definition at line 51 of file G4ParticleHPMadlandNixSpectrum.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPMadlandNixSpectrum()

G4ParticleHPMadlandNixSpectrum::G4ParticleHPMadlandNixSpectrum ( )
inline

◆ ~G4ParticleHPMadlandNixSpectrum()

G4ParticleHPMadlandNixSpectrum::~G4ParticleHPMadlandNixSpectrum ( )
inline

Definition at line 60 of file G4ParticleHPMadlandNixSpectrum.hh.

61 {
62 }

Member Function Documentation

◆ E1()

G4double G4ParticleHPMadlandNixSpectrum::E1 ( G4double  aValue)
inlineprivate

Definition at line 119 of file G4ParticleHPMadlandNixSpectrum.hh.

120 {
121 // good only for rather low aValue @@@ replace by the corresponding NAG function for the
122 // exponential integral. (<5 seems ok.
123 G4double gamma = 0.577216;
124 G4double precision = 0.000001;
125 G4double result =-gamma - G4Log(aValue);
126 G4double term = -aValue;
127 //110527TKDB Unnessary codes, Detected by gcc4.6 compiler
128 //G4double last;
129 G4int count = 1;
130 result -= term;
131 for(;;)
132 {
133 count++;
134 //110527TKDB Unnessary codes, Detected by gcc4.6 compiler
135 //last = result;
136 term = -term*aValue*(count-1)/(count*count);
137 result -=term;
138 if(std::fabs(term)/std::fabs(result)<precision) break;
139 }
140// NagError *fail; @
141// result = nag_exp_integral(aValue, fail); @
142 return result;
143 }
G4double G4Log(G4double x)
Definition: G4Log.hh:226
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85

References G4Log().

Referenced by GIntegral(), and Madland().

◆ FissionIntegral()

G4double G4ParticleHPMadlandNixSpectrum::FissionIntegral ( G4double  tm,
G4double  anEnergy 
)
inlineprivate

◆ Gamma05()

G4double G4ParticleHPMadlandNixSpectrum::Gamma05 ( G4double  aValue)
inlineprivate

Definition at line 93 of file G4ParticleHPMadlandNixSpectrum.hh.

94 {
95 G4double result;
96 // gamma(1.2,x*X) = std::sqrt(CLHEP::pi)*Erf(x)
97 G4double x = std::sqrt(aValue);
98 G4double t = 1./(1+0.47047*x);
99 result = 1- (0.3480242*t - 0.0958798*t*t + 0.7478556*t*t*t)*G4Exp(-aValue); // @ check
100 result *= std::sqrt(CLHEP::pi);
101 return result;
102 }
static constexpr double pi
Definition: SystemOfUnits.h:55

References G4Exp(), and CLHEP::pi.

Referenced by Gamma15().

◆ Gamma15()

G4double G4ParticleHPMadlandNixSpectrum::Gamma15 ( G4double  aValue)
inlineprivate

Definition at line 104 of file G4ParticleHPMadlandNixSpectrum.hh.

105 {
106 G4double result;
107 // gamma(a+1, x) = a*gamma(a,x)-x**a*std::exp(-x)
108 result = 0.5*Gamma05(aValue) - std::sqrt(aValue)*G4Exp(-aValue); // @ check
109 return result;
110 }

References G4Exp(), and Gamma05().

Referenced by Gamma25(), GIntegral(), and Madland().

◆ Gamma25()

G4double G4ParticleHPMadlandNixSpectrum::Gamma25 ( G4double  aValue)
inlineprivate

Definition at line 112 of file G4ParticleHPMadlandNixSpectrum.hh.

113 {
114 G4double result;
115 result = 1.5*Gamma15(aValue) - G4Pow::GetInstance()->powA(aValue,1.5)*G4Exp(aValue); // @ check
116 return result;
117 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:230

References G4Exp(), Gamma15(), G4Pow::GetInstance(), and G4Pow::powA().

Referenced by GIntegral().

◆ GetFractionalProbability()

G4double G4ParticleHPMadlandNixSpectrum::GetFractionalProbability ( G4double  anEnergy)
inlinevirtual

Implements G4VParticleHPEDis.

Definition at line 74 of file G4ParticleHPMadlandNixSpectrum.hh.

75 {
76 return theFractionalProb.GetY(anEnergy);
77 }
G4double GetY(G4double x)

References G4ParticleHPVector::GetY(), and theFractionalProb.

◆ GIntegral()

G4double G4ParticleHPMadlandNixSpectrum::GIntegral ( G4double  tm,
G4double  anEnergy,
G4double  aMean 
)
private

Definition at line 111 of file G4ParticleHPMadlandNixSpectrum.cc.

113 {
115 if(aMean<1*eV) return 0;
116 G4double b = anEnergy/eV;
117 G4double sb = std::sqrt(b);
118 G4double EF = aMean/eV;
119
120 G4double alpha = std::sqrt(tm);
121 G4double beta = std::sqrt(EF);
122 G4double A = EF/tm;
123 G4double B = (sb+beta)*(sb+beta)/tm;
124 G4double Ap = A;
125 G4double Bp = (sb-beta)*(sb-beta)/tm;
126
127 G4double result;
129 G4double alphabeta = alpha*beta;
130 if(b<EF)
131 {
132 result =
133 (
134 (0.4*alpha2*Pow->powA(B,2.5) - 0.5*alphabeta*B*B)*E1(B) -
135 (0.4*alpha2*Pow->powA(A,2.5) - 0.5*alphabeta*A*A)*E1(A)
136 )
137 -
138 (
139 (0.4*alpha2*Pow->powA(Bp,2.5) + 0.5*alphabeta*Bp*Bp)*E1(Bp) -
140 (0.4*alpha2*Pow->powA(Ap,2.5) + 0.5*alphabeta*Ap*Ap)*E1(Ap)
141 )
142 +
143 (
144 (alpha2*B-2*alphabeta*std::sqrt(B))*Gamma15(B) -
145 (alpha2*A-2*alphabeta*std::sqrt(A))*Gamma15(A)
146 )
147 -
148 (
149 (alpha2*Bp-2*alphabeta*std::sqrt(Bp))*Gamma15(Bp) -
150 (alpha2*Ap-2*alphabeta*std::sqrt(Ap))*Gamma15(Ap)
151 )
152 - 0.6*alpha2*(Gamma25(B) - Gamma25(A) - Gamma25(Bp) + Gamma25(Ap))
153 - 1.5*alphabeta*(G4Exp(-B)*(1+B) - G4Exp(-A)*(1+A) + G4Exp(-Bp)*(1+Bp) + G4Exp(-Ap)*(1+Ap)) ;
154 }
155 else
156 {
157 result =
158 (
159 (0.4*alpha2*Pow->powA(B,2.5) - 0.5*alphabeta*B*B)*E1(B) -
160 (0.4*alpha2*Pow->powA(A,2.5) - 0.5*alphabeta*A*A)*E1(A)
161 );
162 result -=
163 (
164 (0.4*alpha2*Pow->powA(Bp,2.5) + 0.5*alphabeta*Bp*Bp)*E1(Bp) -
165 (0.4*alpha2*Pow->powA(Ap,2.5) + 0.5*alphabeta*Ap*Ap)*E1(Ap)
166 );
167 result +=
168 (
169 (alpha2*B-2*alphabeta*std::sqrt(B))*Gamma15(B) -
170 (alpha2*A-2*alphabeta*std::sqrt(A))*Gamma15(A)
171 );
172 result -=
173 (
174 (alpha2*Bp+2*alphabeta*std::sqrt(Bp))*Gamma15(Bp) -
175 (alpha2*Ap+2*alphabeta*std::sqrt(Ap))*Gamma15(Ap)
176 );
177 result -= 0.6*alpha2*(Gamma25(B) - Gamma25(A) - Gamma25(Bp) + Gamma25(Ap));
178 result -= 1.5*alphabeta*(G4Exp(-B)*(1+B) - G4Exp(-A)*(1+A) + G4Exp(-Bp)*(1+Bp) + G4Exp(-Ap)*(1+Ap) - 2.) ;
179 }
180 result = result / (3.*std::sqrt(tm*EF));
181 return result;
182 }
G4double B(G4double temperature)
static const G4double alpha
static constexpr double eV
Definition: G4SIunits.hh:201
const G4double A[17]
const G4double alpha2
Definition: G4Pow.hh:49

References A, alpha, alpha2, B(), anonymous_namespace{G4PionRadiativeDecayChannel.cc}::beta, E1(), eV, G4Exp(), Gamma15(), Gamma25(), G4Pow::GetInstance(), G4Pow::powA(), and G4InuclParticleNames::tm.

Referenced by FissionIntegral().

◆ Init()

void G4ParticleHPMadlandNixSpectrum::Init ( std::istream &  aDataFile)
inlinevirtual

◆ Madland()

G4double G4ParticleHPMadlandNixSpectrum::Madland ( G4double  aSecEnergy,
G4double  tm 
)
private

Definition at line 34 of file G4ParticleHPMadlandNixSpectrum.cc.

35 {
37 G4double result;
38 G4double energy = aSecEnergy/eV;
39 G4double EF;
40
42 G4double lightU1 = std::sqrt(energy)-std::sqrt(EF);
43 lightU1 *= lightU1/tm;
44 G4double lightU2 = std::sqrt(energy)+std::sqrt(EF);
45 lightU2 *= lightU2/tm;
46 G4double lightTerm=0;
48 {
49 lightTerm = Pow->powA(lightU2, 1.5)*E1(lightU2);
50 lightTerm -= Pow->powA(lightU1, 1.5)*E1(lightU1);
51 lightTerm += Gamma15(lightU2)-Gamma15(lightU1);
52 lightTerm /= 3.*std::sqrt(tm*EF);
53 }
54
56 G4double heavyU1 = std::sqrt(energy)-std::sqrt(EF);
57 heavyU1 *= heavyU1/tm;
58 G4double heavyU2 = std::sqrt(energy)+std::sqrt(EF);
59 heavyU2 *= heavyU2/tm;
60 G4double heavyTerm=0 ;
62 {
63 heavyTerm = Pow->powA(heavyU2, 1.5)*E1(heavyU2);
64 heavyTerm -= Pow->powA(heavyU1, 1.5)*E1(heavyU1);
65 heavyTerm += Gamma15(heavyU2)-Gamma15(heavyU1);
66 heavyTerm /= 3.*std::sqrt(tm*EF);
67 }
68
69 result = 0.5*(lightTerm+heavyTerm);
70
71 return result;
72 }
G4double energy(const ThreeVector &p, const G4double m)

References E1(), G4INCL::KinematicsUtils::energy(), eV, Gamma15(), G4Pow::GetInstance(), G4Pow::powA(), theAvarageKineticPerNucleonForHeavyFragments, theAvarageKineticPerNucleonForLightFragments, and G4InuclParticleNames::tm.

◆ Sample()

G4double G4ParticleHPMadlandNixSpectrum::Sample ( G4double  anEnergy)
virtual

Implements G4VParticleHPEDis.

Definition at line 74 of file G4ParticleHPMadlandNixSpectrum.cc.

75 {
76 G4double tm = theMaxTemp.GetY(anEnergy);
77 G4double last=0, buff, current = 100*MeV;
78 G4double precision = 0.001;
79 G4double newValue = 0., oldValue=0.;
80 G4double random = G4UniformRand();
81
82 G4int icounter=0;
83 G4int icounter_max=1024;
84 do
85 {
86 icounter++;
87 if ( icounter > icounter_max ) {
88 G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
89 break;
90 }
91 oldValue = newValue;
92 newValue = FissionIntegral(tm, current);
93 if(newValue < random)
94 {
95 buff = current;
96 current+=std::abs(current-last)/2.;
97 last = buff;
98 if(current>190*MeV) throw G4HadronicException(__FILE__, __LINE__, "Madland-Nix Spectrum has not converged in sampling");
99 }
100 else
101 {
102 buff = current;
103 current-=std::abs(current-last)/2.;
104 last = buff;
105 }
106 }
107 while (std::abs(oldValue-newValue)>precision*newValue); // Loop checking, 11.05.2015, T. Koi
108 return current;
109 }
static constexpr double MeV
Definition: G4SIunits.hh:200
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:52
G4double FissionIntegral(G4double tm, G4double anEnergy)

References FissionIntegral(), G4cout, G4endl, G4UniformRand, G4ParticleHPVector::GetY(), MeV, theMaxTemp, and G4InuclParticleNames::tm.

Field Documentation

◆ expm1

G4double G4ParticleHPMadlandNixSpectrum::expm1
private

Definition at line 147 of file G4ParticleHPMadlandNixSpectrum.hh.

Referenced by G4ParticleHPMadlandNixSpectrum().

◆ theAvarageKineticPerNucleonForHeavyFragments

G4double G4ParticleHPMadlandNixSpectrum::theAvarageKineticPerNucleonForHeavyFragments
private

◆ theAvarageKineticPerNucleonForLightFragments

G4double G4ParticleHPMadlandNixSpectrum::theAvarageKineticPerNucleonForLightFragments
private

◆ theFractionalProb

G4ParticleHPVector G4ParticleHPMadlandNixSpectrum::theFractionalProb
private

Definition at line 151 of file G4ParticleHPMadlandNixSpectrum.hh.

Referenced by GetFractionalProbability(), and Init().

◆ theMaxTemp

G4ParticleHPVector G4ParticleHPMadlandNixSpectrum::theMaxTemp
private

Definition at line 156 of file G4ParticleHPMadlandNixSpectrum.hh.

Referenced by Init(), and Sample().


The documentation for this class was generated from the following files: