File indexing completed on 2025-01-18 09:58:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef G4ParticleHPMadlandNixSpectrum_h
0030 #define G4ParticleHPMadlandNixSpectrum_h 1
0031
0032 #include "G4Exp.hh"
0033 #include "G4Log.hh"
0034 #include "G4ParticleHPVector.hh"
0035 #include "G4Pow.hh"
0036 #include "G4VParticleHPEDis.hh"
0037 #include "G4ios.hh"
0038 #include "Randomize.hh"
0039 #include "globals.hh"
0040
0041 #include <CLHEP/Units/PhysicalConstants.h>
0042
0043 #include <cmath>
0044 #include <fstream>
0045
0046
0047
0048
0049
0050
0051 class G4ParticleHPMadlandNixSpectrum : public G4VParticleHPEDis
0052 {
0053 public:
0054 G4ParticleHPMadlandNixSpectrum()
0055 {
0056 expm1 = G4Exp(-1.);
0057 theAvarageKineticPerNucleonForLightFragments = 0.0;
0058 theAvarageKineticPerNucleonForHeavyFragments = 0.0;
0059 }
0060 ~G4ParticleHPMadlandNixSpectrum() override = default;
0061
0062 inline void Init(std::istream& aDataFile) override
0063 {
0064 theFractionalProb.Init(aDataFile);
0065 aDataFile >> theAvarageKineticPerNucleonForLightFragments;
0066 theAvarageKineticPerNucleonForLightFragments *= CLHEP::eV;
0067 aDataFile >> theAvarageKineticPerNucleonForHeavyFragments;
0068 theAvarageKineticPerNucleonForHeavyFragments *= CLHEP::eV;
0069 theMaxTemp.Init(aDataFile);
0070 }
0071
0072 inline G4double GetFractionalProbability(G4double anEnergy) override
0073 {
0074 return theFractionalProb.GetY(anEnergy);
0075 }
0076
0077 G4double Sample(G4double anEnergy) override;
0078
0079 private:
0080 G4double Madland(G4double aSecEnergy, G4double tm);
0081
0082 inline G4double FissionIntegral(G4double tm, G4double anEnergy)
0083 {
0084 return 0.5
0085 * (GIntegral(tm, anEnergy, theAvarageKineticPerNucleonForLightFragments)
0086 + GIntegral(tm, anEnergy, theAvarageKineticPerNucleonForHeavyFragments));
0087 }
0088
0089 G4double GIntegral(G4double tm, G4double anEnergy, G4double aMean);
0090
0091 inline G4double Gamma05(G4double aValue)
0092 {
0093 G4double result;
0094
0095 G4double x = std::sqrt(aValue);
0096 G4double t = 1. / (1 + 0.47047 * x);
0097 result =
0098 1
0099 - (0.3480242 * t - 0.0958798 * t * t + 0.7478556 * t * t * t) * G4Exp(-aValue);
0100 result *= std::sqrt(CLHEP::pi);
0101 return result;
0102 }
0103
0104 inline G4double Gamma15(G4double aValue)
0105 {
0106 G4double result;
0107
0108 result = 0.5 * Gamma05(aValue) - std::sqrt(aValue) * G4Exp(-aValue);
0109 return result;
0110 }
0111
0112 inline G4double Gamma25(G4double aValue)
0113 {
0114 G4double result;
0115 result =
0116 1.5 * Gamma15(aValue) - G4Pow::GetInstance()->powA(aValue, 1.5) * G4Exp(aValue);
0117 return result;
0118 }
0119
0120 inline G4double E1(G4double aValue)
0121 {
0122
0123
0124 G4double gamma = 0.577216;
0125 G4double precision = 0.000001;
0126 G4double result = -gamma - G4Log(aValue);
0127 G4double term = -aValue;
0128
0129
0130 G4int count = 1;
0131 result -= term;
0132 for (;;) {
0133 count++;
0134
0135
0136 term = -term * aValue * (count - 1) / (count * count);
0137 result -= term;
0138 if (std::fabs(term) / std::fabs(result) < precision) break;
0139 }
0140
0141
0142 return result;
0143 }
0144
0145 private:
0146 G4double expm1;
0147
0148 private:
0149 G4ParticleHPVector theFractionalProb;
0150
0151 G4double theAvarageKineticPerNucleonForLightFragments;
0152 G4double theAvarageKineticPerNucleonForHeavyFragments;
0153
0154 G4ParticleHPVector theMaxTemp;
0155 };
0156
0157 #endif