Geant4  10.02.p03
G4ParticleHPMadlandNixSpectrum Class Reference

#include <G4ParticleHPMadlandNixSpectrum.hh>

Inheritance diagram for G4ParticleHPMadlandNixSpectrum:
Collaboration diagram for G4ParticleHPMadlandNixSpectrum:

Public Member Functions

 G4ParticleHPMadlandNixSpectrum ()
 
 ~G4ParticleHPMadlandNixSpectrum ()
 
void Init (std::istream &aDataFile)
 
G4double GetFractionalProbability (G4double anEnergy)
 
G4double Sample (G4double anEnergy)
 
- Public Member Functions inherited from G4VParticleHPEDis
 G4VParticleHPEDis ()
 
virtual ~G4VParticleHPEDis ()
 

Private Member Functions

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

Private Attributes

G4double expm1
 
G4ParticleHPVector theFractionalProb
 
G4double theAvarageKineticPerNucleonForLightFragments
 
G4double theAvarageKineticPerNucleonForHeavyFragments
 
G4ParticleHPVector theMaxTemp
 

Detailed Description

Definition at line 51 of file G4ParticleHPMadlandNixSpectrum.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPMadlandNixSpectrum()

G4ParticleHPMadlandNixSpectrum::G4ParticleHPMadlandNixSpectrum ( )
inline

Definition at line 54 of file G4ParticleHPMadlandNixSpectrum.hh.

55  {
56  expm1 = G4Exp(-1.);
57  }
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
Here is the call graph for this function:

◆ ~G4ParticleHPMadlandNixSpectrum()

G4ParticleHPMadlandNixSpectrum::~G4ParticleHPMadlandNixSpectrum ( )
inline

Definition at line 58 of file G4ParticleHPMadlandNixSpectrum.hh.

59  {
60  }

Member Function Documentation

◆ E1()

G4double G4ParticleHPMadlandNixSpectrum::E1 ( G4double  aValue)
inlineprivate

Definition at line 117 of file G4ParticleHPMadlandNixSpectrum.hh.

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

◆ FissionIntegral()

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

Definition at line 83 of file G4ParticleHPMadlandNixSpectrum.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gamma05()

G4double G4ParticleHPMadlandNixSpectrum::Gamma05 ( G4double  aValue)
inlineprivate

Definition at line 91 of file G4ParticleHPMadlandNixSpectrum.hh.

92  {
93  G4double result;
94  // gamma(1.2,x*X) = std::sqrt(CLHEP::pi)*Erf(x)
95  G4double x = std::sqrt(aValue);
96  G4double t = 1./(1+0.47047*x);
97  result = 1- (0.3480242*t - 0.0958798*t*t + 0.7478556*t*t*t)*G4Exp(-aValue); // @ check
98  result *= std::sqrt(CLHEP::pi);
99  return result;
100  }
static const double pi
Definition: SystemOfUnits.h:53
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gamma15()

G4double G4ParticleHPMadlandNixSpectrum::Gamma15 ( G4double  aValue)
inlineprivate

Definition at line 102 of file G4ParticleHPMadlandNixSpectrum.hh.

103  {
104  G4double result;
105  // gamma(a+1, x) = a*gamma(a,x)-x**a*std::exp(-x)
106  result = 0.5*Gamma05(aValue) - std::sqrt(aValue)*G4Exp(-aValue); // @ check
107  return result;
108  }
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Gamma25()

G4double G4ParticleHPMadlandNixSpectrum::Gamma25 ( G4double  aValue)
inlineprivate

Definition at line 110 of file G4ParticleHPMadlandNixSpectrum.hh.

111  {
112  G4double result;
113  result = 1.5*Gamma15(aValue) - G4Pow::GetInstance()->powA(aValue,1.5)*G4Exp(aValue); // @ check
114  return result;
115  }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFractionalProbability()

G4double G4ParticleHPMadlandNixSpectrum::GetFractionalProbability ( G4double  anEnergy)
inlinevirtual

Implements G4VParticleHPEDis.

Definition at line 72 of file G4ParticleHPMadlandNixSpectrum.hh.

73  {
74  return theFractionalProb.GetY(anEnergy);
75  }
G4double GetY(G4double x)
Here is the call graph for this function:

◆ GIntegral()

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

Definition at line 112 of file G4ParticleHPMadlandNixSpectrum.cc.

113  {
114  G4Pow* Pow=G4Pow::GetInstance();
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;
128  G4double alpha2 = alpha*alpha;
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  }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
Definition: G4Pow.hh:56
double A(double temperature)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
static const double eV
Definition: G4SIunits.hh:212
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
double G4double
Definition: G4Types.hh:76
static const G4double alpha
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

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

Implements G4VParticleHPEDis.

Definition at line 62 of file G4ParticleHPMadlandNixSpectrum.hh.

63  {
64  theFractionalProb.Init(aDataFile);
66  theAvarageKineticPerNucleonForLightFragments*=CLHEP::eV;
68  theAvarageKineticPerNucleonForHeavyFragments*=CLHEP::eV;
69  theMaxTemp.Init(aDataFile);
70  }
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
static const double eV
Here is the call graph for this function:

◆ 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  }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
Definition: G4Pow.hh:56
double energy
Definition: plottest35.C:25
static const double eV
Definition: G4SIunits.hh:212
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 const double MeV
Definition: G4SIunits.hh:211
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
G4double GetY(G4double x)
G4double FissionIntegral(G4double tm, G4double anEnergy)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ expm1

G4double G4ParticleHPMadlandNixSpectrum::expm1
private

Definition at line 145 of file G4ParticleHPMadlandNixSpectrum.hh.

◆ theAvarageKineticPerNucleonForHeavyFragments

G4double G4ParticleHPMadlandNixSpectrum::theAvarageKineticPerNucleonForHeavyFragments
private

Definition at line 152 of file G4ParticleHPMadlandNixSpectrum.hh.

◆ theAvarageKineticPerNucleonForLightFragments

G4double G4ParticleHPMadlandNixSpectrum::theAvarageKineticPerNucleonForLightFragments
private

Definition at line 151 of file G4ParticleHPMadlandNixSpectrum.hh.

◆ theFractionalProb

G4ParticleHPVector G4ParticleHPMadlandNixSpectrum::theFractionalProb
private

Definition at line 149 of file G4ParticleHPMadlandNixSpectrum.hh.

◆ theMaxTemp

G4ParticleHPVector G4ParticleHPMadlandNixSpectrum::theMaxTemp
private

Definition at line 154 of file G4ParticleHPMadlandNixSpectrum.hh.


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