80 G4double t0 = std::max(tmin, lowestE);
81 if(t0 >= tm)
return 0.0;
90 for (
size_t i=0; i<=length; i++) {
91 p.push_back(theBRparam->
Parameter(i, Z, e));
95 G4double y = IntSpectrum(z0, 1.0, p);
99 G4cout <<
"tcut(MeV)= " << tmin/MeV
100 <<
"; tMax(MeV)= " << tmax/MeV
103 <<
"; xp[0]= " << xp[0]
127 G4double t0 = std::max(tmin, lowestE);
128 if(t0 >= tm)
return 0.0;
138 for (
size_t i=0; i<=length; i++) {
139 p.push_back(theBRparam->
Parameter(i, Z, e));
142 G4double x = AverageValue(t0, tm, p);
143 G4double y = IntSpectrum(z0, 1.0, p);
149 x += p[0]*(t0 - zmin - c*(std::atan(t0/c) - std::atan(zmin/c)));
154 G4cout <<
"tcut(MeV)= " << tmin/MeV
155 <<
"; tMax(MeV)= " << tmax/MeV
156 <<
"; e(MeV)= " << e/MeV
181 G4double t0 = std::max(tmin, lowestE);
182 if(t0 >= tm)
return 0.0;
189 for (
size_t i=0; i<=length; i++) {
190 p.push_back(theBRparam->
Parameter(i, Z, e));
192 G4double amaj = std::max(p[length], 1. - (p[1] - p[0])*xp[0]/(xp[1] - xp[0]) );
201 fun = Function(tgam, p);
204 G4cout <<
"WARNING in G4eBremsstrahlungSpectrum::SampleEnergy:"
205 <<
" Majoranta " << amaj
224 G4double x1 = std::min(xMin, xp[0]);
225 G4double x2 = std::min(xMax, xp[0]);
229 G4double k = (p[1] - p[0])/(xp[1] - xp[0]);
230 sum += (1. - k*xp[0])*std::log(x2/x1) + k*(x2 - x1);
233 for (
size_t i=0; i<length-1; i++) {
234 x1 = std::max(xMin, xp[i]);
235 x2 = std::min(xMax, xp[i+1]);
239 sum += z2 - z1 + std::log(x2/x1)*(z1*x2 - z2*x1)/(x2 - x1);
242 if(sum < 0.0) sum = 0.0;
250 G4double x1 = std::min(xMin, xp[0]);
251 G4double x2 = std::min(xMax, xp[0]);
257 G4double k = (p[1] - p[0])/(xp[1] - xp[0]);
258 sum += (z2 - z1)*(1. - k*xp[0]);
261 sum += 0.5*k*(z2 - z1);
264 for (
size_t i=0; i<length-1; i++) {
265 x1 = std::max(xMin, xp[i]);
266 x2 = std::min(xMax, xp[i+1]);
270 sum += 0.5*(z2 - z1)*(x2 + x1) + z1*x2 - z2*x1;
273 if(sum < 0.0) sum = 0.0;
283 f = p[0] + (p[1] - p[0])*(x - xp[0])/(xp[1] - xp[0]);
287 for (
size_t i=0; i<length-1; i++) {
290 f = p[i] + (p[i+1] - p[i])*(x - xp[i])/(xp[i+1] - xp[i]);
310 return kineticEnergy;
G4DLLIMPORT std::ostream G4cout
G4double Parameter(G4int parameterIndex, G4int Z, G4double energy) const
G4double ParameterC(G4int index) const
G4eBremsstrahlungSpectrum(const G4DataVector &bins, const G4String &name)
G4double MaxEnergyOfSecondaries(G4double kineticEnergy, G4int Z=0, const G4ParticleDefinition *pd=0) const
G4double Probability(G4int Z, G4double tMin, G4double tMax, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const
G4double AverageEnergy(G4int Z, G4double tMin, G4double tMax, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const
~G4eBremsstrahlungSpectrum()
G4double SampleEnergy(G4int Z, G4double tMin, G4double tMax, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const
G4double Excitation(G4int Z, G4double kineticEnergy) const