Geant4  10.01.p03
G4ParticleHPMadlandNixSpectrum.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // neutron_hp -- source file
27 // J.P. Wellisch, Nov-1996
28 // A prototype of the low energy neutron transport model.
29 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
30 //
32 #include "G4SystemOfUnits.hh"
33 
35  {
36  G4double result;
37  G4double energy = aSecEnergy/eV;
38  G4double EF;
39 
41  G4double lightU1 = std::sqrt(energy)-std::sqrt(EF);
42  lightU1 *= lightU1/tm;
43  G4double lightU2 = std::sqrt(energy)+std::sqrt(EF);
44  lightU2 *= lightU2/tm;
45  G4double lightTerm=0;
47  {
48  lightTerm = std::pow(lightU2, 1.5)*E1(lightU2);
49  lightTerm -= std::pow(lightU1, 1.5)*E1(lightU1);
50  lightTerm += Gamma15(lightU2)-Gamma15(lightU1);
51  lightTerm /= 3.*std::sqrt(tm*EF);
52  }
53 
55  G4double heavyU1 = std::sqrt(energy)-std::sqrt(EF);
56  heavyU1 *= heavyU1/tm;
57  G4double heavyU2 = std::sqrt(energy)+std::sqrt(EF);
58  heavyU2 *= heavyU2/tm;
59  G4double heavyTerm=0 ;
61  {
62  heavyTerm = std::pow(heavyU2, 1.5)*E1(heavyU2);
63  heavyTerm -= std::pow(heavyU1, 1.5)*E1(heavyU1);
64  heavyTerm += Gamma15(heavyU2)-Gamma15(heavyU1);
65  heavyTerm /= 3.*std::sqrt(tm*EF);
66  }
67 
68  result = 0.5*(lightTerm+heavyTerm);
69 
70  return result;
71  }
72 
74  {
75  G4double tm = theMaxTemp.GetY(anEnergy);
76  G4double last=0, buff, current = 100*MeV;
77  G4double precision = 0.001;
78  G4double newValue = 0., oldValue=0.;
79  G4double random = G4UniformRand();
80 
81  do
82  {
83  oldValue = newValue;
84  newValue = FissionIntegral(tm, current);
85  if(newValue < random)
86  {
87  buff = current;
88  current+=std::abs(current-last)/2.;
89  last = buff;
90  if(current>190*MeV) throw G4HadronicException(__FILE__, __LINE__, "Madland-Nix Spectrum has not converged in sampling");
91  }
92  else
93  {
94  buff = current;
95  current-=std::abs(current-last)/2.;
96  last = buff;
97  }
98  }
99  while (std::abs(oldValue-newValue)>precision*newValue);
100  return current;
101  }
102 
105  {
106  if(aMean<1*eV) return 0;
107  G4double b = anEnergy/eV;
108  G4double sb = std::sqrt(b);
109  G4double EF = aMean/eV;
110 
111  G4double alpha = std::sqrt(tm);
112  G4double beta = std::sqrt(EF);
113  G4double A = EF/tm;
114  G4double B = (sb+beta)*(sb+beta)/tm;
115  G4double Ap = A;
116  G4double Bp = (sb-beta)*(sb-beta)/tm;
117 
118  G4double result;
119  G4double alpha2 = alpha*alpha;
120  G4double alphabeta = alpha*beta;
121  if(b<EF)
122  {
123  result =
124  (
125  (0.4*alpha2*std::pow(B,2.5) - 0.5*alphabeta*B*B)*E1(B) -
126  (0.4*alpha2*std::pow(A,2.5) - 0.5*alphabeta*A*A)*E1(A)
127  )
128  -
129  (
130  (0.4*alpha2*std::pow(Bp,2.5) + 0.5*alphabeta*Bp*Bp)*E1(Bp) -
131  (0.4*alpha2*std::pow(Ap,2.5) + 0.5*alphabeta*Ap*Ap)*E1(Ap)
132  )
133  +
134  (
135  (alpha2*B-2*alphabeta*std::sqrt(B))*Gamma15(B) -
136  (alpha2*A-2*alphabeta*std::sqrt(A))*Gamma15(A)
137  )
138  -
139  (
140  (alpha2*Bp-2*alphabeta*std::sqrt(Bp))*Gamma15(Bp) -
141  (alpha2*Ap-2*alphabeta*std::sqrt(Ap))*Gamma15(Ap)
142  )
143  - 0.6*alpha2*(Gamma25(B) - Gamma25(A) - Gamma25(Bp) + Gamma25(Ap))
144  - 1.5*alphabeta*(std::exp(-B)*(1+B) - std::exp(-A)*(1+A) + std::exp(-Bp)*(1+Bp) + std::exp(-Ap)*(1+Ap)) ;
145  }
146  else
147  {
148  result =
149  (
150  (0.4*alpha2*std::pow(B,2.5) - 0.5*alphabeta*B*B)*E1(B) -
151  (0.4*alpha2*std::pow(A,2.5) - 0.5*alphabeta*A*A)*E1(A)
152  );
153  result -=
154  (
155  (0.4*alpha2*std::pow(Bp,2.5) + 0.5*alphabeta*Bp*Bp)*E1(Bp) -
156  (0.4*alpha2*std::pow(Ap,2.5) + 0.5*alphabeta*Ap*Ap)*E1(Ap)
157  );
158  result +=
159  (
160  (alpha2*B-2*alphabeta*std::sqrt(B))*Gamma15(B) -
161  (alpha2*A-2*alphabeta*std::sqrt(A))*Gamma15(A)
162  );
163  result -=
164  (
165  (alpha2*Bp+2*alphabeta*std::sqrt(Bp))*Gamma15(Bp) -
166  (alpha2*Ap+2*alphabeta*std::sqrt(Ap))*Gamma15(Ap)
167  );
168  result -= 0.6*alpha2*(Gamma25(B) - Gamma25(A) - Gamma25(Bp) + Gamma25(Ap));
169  result -= 1.5*alphabeta*(std::exp(-B)*(1+B) - std::exp(-A)*(1+A) + std::exp(-Bp)*(1+Bp) + std::exp(-Ap)*(1+Ap) - 2.) ;
170  }
171  result = result / (3.*std::sqrt(tm*EF));
172  return result;
173  }
static const double MeV
Definition: G4SIunits.hh:193
#define G4UniformRand()
Definition: Randomize.hh:93
G4double GetY(G4double x)
static const G4double A[nN]
G4double Madland(G4double aSecEnergy, G4double tm)
static const double eV
Definition: G4SIunits.hh:194
G4double energy(const ThreeVector &p, const G4double m)
G4double GIntegral(G4double tm, G4double anEnergy, G4double aMean)
G4double FissionIntegral(G4double tm, G4double anEnergy)
double G4double
Definition: G4Types.hh:76
static const G4double alpha