230{
232 G4double cut = std::min(cutEnergy, kineticEnergy);
233 G4double emax = std::min(maxEnergy, kineticEnergy);
234 if(cut >= emax) { return; }
235
237
242
244
245
246
247
248
249
253
255
256
259
260
262 ((kineticEnergy > epeaklimit) || (kineticEnergy < elowlimit))) {
263 G4double ylim = std::min(ylimit[Z],1.1*dataSB[Z]->
Value(0.97,y,idx,idy));
264 if(ylim > vmax) { vmax = ylim; }
265 }
266 if(x0 < 0.05) { vmax *= 1.2; }
267
268 do {
269
271 if(x < 0.0) { x = 0.0; }
272 gammaEnergy = sqrt(x);
273 G4double x1 = gammaEnergy/kineticEnergy;
274 v = dataSB[Z]->
Value(x1, y, idx, idy);
275
276
281 G4double e2 = kineticEnergy - gammaEnergy;
285
286 if(xxx < expnumlim) { v = 0.0; }
287 else { v *=
G4Exp(xxx); }
288 }
289
290 if (v > 1.05*vmax && nwarn < 5) {
291 ++nwarn;
293 ed << "### G4LivermoreBremsstrahlungModel Warning: Majoranta exceeded! "
294 << v << " > " << vmax << " by " << v/vmax
295 << " Egamma(MeV)= " << gammaEnergy
296 << " Ee(MeV)= " << kineticEnergy
298
299 if ( 20 == nwarn ) {
300 ed << "\n ### G4LivermoreBremsstrahlungModel Warnings stopped";
301 }
302 G4Exception(
"G4LivermoreBremsstrahlungModel::SampleScattering",
"em0044",
304
305 }
307
308
309
310
311
312
316
317
320 vdp->push_back(gamma);
321
323 - gammaEnergy*gammaDirection).
unit();
324
325
326
327
328
329
330
331
332
333 G4double finalE = kineticEnergy - gammaEnergy;
334
335
341 direction, finalE);
342 vdp->push_back(el);
343
344
345 } else {
348 }
349}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
const G4String & GetParticleName() const
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4double SecondaryThreshold() const
void ProposeTrackStatus(G4TrackStatus status)
const G4ParticleDefinition * fPrimaryParticle
G4ParticleDefinition * fGammaParticle
void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double) override
G4ParticleChangeForLoss * fParticleChange