328{
329 if (fVerboseLevel > 3)
330 G4cout <<
"Calling SampleSecondaries() of G4PenelopeBremsstrahlungModel" <<
G4endl;
331
333 const G4Material* material = couple->
GetMaterial();
334
335 if (kineticEnergy <= fIntrinsicLowEnergyLimit)
336 {
339 return ;
340 }
341
343
345
346
347 if (kineticEnergy < cutG)
348 return;
349
350 if (fVerboseLevel > 3)
351 G4cout <<
"Going to sample gamma energy for: " <<material->
GetName() <<
" " <<
352 "energy = " << kineticEnergy/keV <<
", cut = " << cutG/keV <<
G4endl;
353
354
356 fPenelopeFSHelper->SampleGammaEnergy(kineticEnergy,material,cutG);
357
358 if (fVerboseLevel > 3)
359 G4cout <<
"Sampled gamma energy: " << gammaEnergy/keV <<
" keV" <<
G4endl;
360
361
362
364 fPenelopeAngular->SampleDirection(aDynamicParticle,gammaEnergy,0,material);
365
366 if (fVerboseLevel > 3)
368
369 G4double residualPrimaryEnergy = kineticEnergy-gammaEnergy;
370 if (residualPrimaryEnergy < 0)
371 {
372
373 gammaEnergy += residualPrimaryEnergy;
374 residualPrimaryEnergy = 0.0;
375 }
376
377
378 G4ThreeVector particleDirection1 = initialMomentum - gammaEnergy*gammaDirection1;
379 particleDirection1 = particleDirection1.
unit();
380
381
382 if (residualPrimaryEnergy > 0.)
383 {
386 }
387 else
388 {
390 }
391
392
393 G4DynamicParticle* theGamma =
new G4DynamicParticle(
G4Gamma::Gamma(),
394 gammaDirection1,
395 gammaEnergy);
396 fvect->push_back(theGamma);
397
398 if (fVerboseLevel > 1)
399 {
400 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
401 G4cout <<
"Energy balance from G4PenelopeBremsstrahlung" <<
G4endl;
402 G4cout <<
"Incoming primary energy: " << kineticEnergy/keV <<
" keV" <<
G4endl;
403 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
404 G4cout <<
"Outgoing primary energy: " << residualPrimaryEnergy/keV <<
" keV" <<
G4endl;
405 G4cout <<
"Bremsstrahlung photon " << gammaEnergy/keV <<
" keV" <<
G4endl;
406 G4cout <<
"Total final state: " << (residualPrimaryEnergy+gammaEnergy)/keV
408 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
409 }
410
411 if (fVerboseLevel > 0)
412 {
413 G4double energyDiff = std::fabs(residualPrimaryEnergy+gammaEnergy-kineticEnergy);
414 if (energyDiff > 0.05*keV)
415 G4cout <<
"Warning from G4PenelopeBremsstrahlung: problem with energy conservation: "
416 <<
417 (residualPrimaryEnergy+gammaEnergy)/keV <<
418 " keV (final) vs. " <<
419 kineticEnergy/keV <<
" keV (initial)" <<
G4endl;
420 }
421 return;
422}
G4ThreeVector G4ParticleMomentum
CLHEP::Hep3Vector G4ThreeVector
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const