280{
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295 if (verboseLevel > 3)
296 G4cout <<
"Calling SamplingSecondaries() of G4PenelopePhotoElectricModel" <<
G4endl;
297
299
300
303
304 if (photonEnergy <= fIntrinsicLowEnergyLimit)
305 {
307 return ;
308 }
309
311
312
313 if (verboseLevel > 2)
315
316
320 if (verboseLevel > 2)
322
323
324
325
326
327
328
329 size_t shellIndex = SelectRandomShell(Z,photonEnergy);
330
331 if (verboseLevel > 2)
332 G4cout <<
"Selected shell " << shellIndex <<
" of element " << anElement->
GetName() <<
G4endl;
333
334
336
337
338
339
340
341
342
343 size_t numberOfShells = (size_t) transitionManager->
NumberOfShells(Z);
344 if (shellIndex >= numberOfShells)
345 shellIndex = numberOfShells-1;
346
349
350
351
352
353
354
355
356 if (shellIndex == 9)
358
359
362
363
365
366
367
368 if (eKineticEnergy > 0.)
369 {
370
371
372 cosTheta = SampleElectronDirection(eKineticEnergy);
373 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
375 G4double dirx = sinTheta * std::cos(phi);
376 G4double diry = sinTheta * std::sin(phi);
379 electronDirection.rotateUz(photonDirection);
381 electronDirection,
382 eKineticEnergy);
383 fvect->push_back(electron);
384 }
385 else
387
388
391
392
393
394
395 if (fAtomDeexcitation && shellIndex<9)
396 {
399 {
400 size_t nBefore = fvect->size();
402 size_t nAfter = fvect->size();
403
404 if (nAfter > nBefore)
405 {
406 for (size_t j=nBefore;j<nAfter;j++)
407 {
408 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy();
409 if (itsEnergy < bindingEnergy)
410 {
413 energyInFluorescence += itsEnergy;
415 energyInAuger += itsEnergy;
416 }
417 else
418 {
419 delete (*fvect)[j];
420 (*fvect)[j] = nullptr;
421 }
422 }
423 }
424 }
425 }
426
427
429
430 if (localEnergyDeposit < 0)
431 {
432 G4Exception(
"G4PenelopePhotoElectricModel::SampleSecondaries()",
433 "em2099",
JustWarning,
"WARNING: Negative local energy deposit");
434 localEnergyDeposit = 0;
435 }
436
438
439 if (verboseLevel > 1)
440 {
441 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
442 G4cout <<
"Energy balance from G4PenelopePhotoElectric" <<
G4endl;
443 G4cout <<
"Selected shell: " << WriteTargetShell(shellIndex) <<
" of element " <<
445 G4cout <<
"Incoming photon energy: " << photonEnergy/keV <<
" keV" <<
G4endl;
446 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
447 if (eKineticEnergy)
448 G4cout <<
"Outgoing electron " << eKineticEnergy/keV <<
" keV" <<
G4endl;
449 if (energyInFluorescence)
450 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/keV <<
" keV" <<
G4endl;
451 if (energyInAuger)
452 G4cout <<
"Auger electrons: " << energyInAuger/keV <<
" keV" <<
G4endl;
453 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
454 G4cout <<
"Total final state: " <<
455 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/keV <<
457 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
458 }
459 if (verboseLevel > 0)
460 {
462 std::fabs(eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger-photonEnergy);
463 if (energyDiff > 0.05*keV)
464 {
465 G4cout <<
"Warning from G4PenelopePhotoElectric: problem with energy conservation: " <<
466 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/keV
467 << " keV (final) vs. " <<
468 photonEnergy/keV <<
" keV (initial)" <<
G4endl;
469 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
470 G4cout <<
"Energy balance from G4PenelopePhotoElectric" <<
G4endl;
471 G4cout <<
"Selected shell: " << WriteTargetShell(shellIndex) <<
" of element " <<
473 G4cout <<
"Incoming photon energy: " << photonEnergy/keV <<
" keV" <<
G4endl;
474 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
475 if (eKineticEnergy)
476 G4cout <<
"Outgoing electron " << eKineticEnergy/keV <<
" keV" <<
G4endl;
477 if (energyInFluorescence)
478 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/keV <<
" keV" <<
G4endl;
479 if (energyInAuger)
480 G4cout <<
"Auger electrons: " << energyInAuger/keV <<
" keV" <<
G4endl;
481 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
482 G4cout <<
"Total final state: " <<
483 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/keV <<
485 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
486 }
487 }
488}
G4double BindingEnergy() const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
G4int NumberOfShells(G4int Z) const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * Definition()
static G4Electron * Electron()
const G4String & GetName() const
static G4Gamma * GammaDefinition()
static G4Gamma * Definition()
const G4String & GetName() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double bindingEnergy(G4int A, G4int Z)