82 G4double t0 = std::max(tmin, lowestE);
83 if(t0 >= tm)
return 0.0;
92 for (
size_t i=0; i<=length; i++) {
93 p.push_back(theBRparam->
Parameter(i, Z, e));
102 <<
"; tMax(MeV)= " << tmax/
MeV
105 <<
"; xp[0]= " << xp[0]
129 G4double t0 = std::max(tmin, lowestE);
130 if(t0 >= tm)
return 0.0;
140 for (
size_t i=0; i<=length; i++) {
141 p.push_back(theBRparam->
Parameter(i, Z, e));
151 x += p[0]*(t0 - zmin - c*(std::atan(t0/c) - std::atan(zmin/c)));
157 <<
"; tMax(MeV)= " << tmax/
MeV
158 <<
"; e(MeV)= " << e/
MeV
183 G4double t0 = std::max(tmin, lowestE);
184 if(t0 >= tm)
return 0.0;
191 for (
size_t i=0; i<=length; i++) {
192 p.push_back(theBRparam->
Parameter(i, Z, e));
194 G4double amaj = std::max(p[length], 1. - (p[1] - p[0])*xp[0]/(xp[1] - xp[0]) );
203 fun = Function(tgam, p);
206 G4cout <<
"WARNING in G4RDeBremsstrahlungSpectrum::SampleEnergy:"
207 <<
" Majoranta " << amaj
231 G4double k = (p[1] - p[0])/(xp[1] - xp[0]);
232 sum += (1. - k*xp[0])*std::log(x2/x1) + k*(x2 -
x1);
235 for (
size_t i=0; i<length-1; i++) {
236 x1 = std::max(xMin, xp[i]);
237 x2 = std::min(xMax, xp[i+1]);
241 sum += z2 - z1 + std::log(x2/x1)*(z1*x2 - z2*
x1)/(x2 - x1);
244 if(sum < 0.0) sum = 0.0;
252 G4double x1 = std::min(xMin, xp[0]);
253 G4double x2 = std::min(xMax, xp[0]);
259 G4double k = (p[1] - p[0])/(xp[1] - xp[0]);
260 sum += (z2 - z1)*(1. - k*xp[0]);
263 sum += 0.5*k*(z2 - z1);
266 for (
size_t i=0; i<length-1; i++) {
267 x1 = std::max(xMin, xp[i]);
268 x2 = std::min(xMax, xp[i+1]);
272 sum += 0.5*(z2 - z1)*(x2 + x1) + z1*x2 - z2*
x1;
275 if(sum < 0.0) sum = 0.0;
285 f = p[0] + (p[1] - p[0])*(x - xp[0])/(xp[1] - xp[0]);
289 for (
size_t i=0; i<length-1; i++) {
292 f = p[i] + (p[i+1] - p[i])*(x - xp[i])/(xp[i+1] - xp[i]);
312 return kineticEnergy;