261{
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276 if (fVerboseLevel > 3)
277 G4cout <<
"Calling SamplingSecondaries() of G4PenelopePhotoElectricModel" <<
G4endl;
278
280
281
284
285 if (photonEnergy <= fIntrinsicLowEnergyLimit)
286 {
288 return ;
289 }
290
292
293
294 if (fVerboseLevel > 2)
296
297
301 if (fVerboseLevel > 2)
303
304
305
306
307
308
309
310 std::size_t shellIndex = SelectRandomShell(Z,photonEnergy);
311
312 if (fVerboseLevel > 2)
313 G4cout <<
"Selected shell " << shellIndex <<
" of element " << anElement->
GetName() <<
G4endl;
314
315
317
318
319
320
321
322
323
324 std::size_t numberOfShells = (std::size_t) transitionManager->
NumberOfShells(Z);
325 if (shellIndex >= numberOfShells)
326 shellIndex = numberOfShells-1;
327
330
331
332
333
334
335
336 if (shellIndex == 9)
338
341
342
344
345
346
347 if (eKineticEnergy > 0.)
348 {
349
350
351 cosTheta = SampleElectronDirection(eKineticEnergy);
352 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
354 G4double dirx = sinTheta * std::cos(phi);
355 G4double diry = sinTheta * std::sin(phi);
358 electronDirection.rotateUz(photonDirection);
360 electronDirection,
361 eKineticEnergy);
362 fvect->push_back(electron);
363 }
364 else
366
369
370
371
372
373 if (fAtomDeexcitation && shellIndex<9)
374 {
377 {
378 std::size_t nBefore = fvect->size();
380 std::size_t nAfter = fvect->size();
381
382 if (nAfter > nBefore)
383 {
384 for (std::size_t j=nBefore;j<nAfter;++j)
385 {
386 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy();
387 if (itsEnergy < bindingEnergy)
388 {
391 energyInFluorescence += itsEnergy;
393 energyInAuger += itsEnergy;
394 }
395 else
396 {
397 delete (*fvect)[j];
398 (*fvect)[j] = nullptr;
399 }
400 }
401 }
402 }
403 }
404
405
407
408 if (localEnergyDeposit < 0)
409 {
410 G4Exception(
"G4PenelopePhotoElectricModel::SampleSecondaries()",
411 "em2099",
JustWarning,
"WARNING: Negative local energy deposit");
412 localEnergyDeposit = 0;
413 }
414
416
417 if (fVerboseLevel > 1)
418 {
419 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
420 G4cout <<
"Energy balance from G4PenelopePhotoElectric" <<
G4endl;
421 G4cout <<
"Selected shell: " << WriteTargetShell(shellIndex) <<
" of element " <<
423 G4cout <<
"Incoming photon energy: " << photonEnergy/keV <<
" keV" <<
G4endl;
424 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
425 if (eKineticEnergy)
426 G4cout <<
"Outgoing electron " << eKineticEnergy/keV <<
" keV" <<
G4endl;
427 if (energyInFluorescence)
428 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/keV <<
" keV" <<
G4endl;
429 if (energyInAuger)
430 G4cout <<
"Auger electrons: " << energyInAuger/keV <<
" keV" <<
G4endl;
431 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
432 G4cout <<
"Total final state: " <<
433 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/keV <<
435 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
436 }
437 if (fVerboseLevel > 0)
438 {
440 std::fabs(eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger-photonEnergy);
441 if (energyDiff > 0.05*keV)
442 {
443 G4cout <<
"Warning from G4PenelopePhotoElectric: problem with energy conservation: " <<
444 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/keV
445 << " keV (final) vs. " <<
446 photonEnergy/keV <<
" keV (initial)" <<
G4endl;
447 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
448 G4cout <<
"Energy balance from G4PenelopePhotoElectric" <<
G4endl;
449 G4cout <<
"Selected shell: " << WriteTargetShell(shellIndex) <<
" of element " <<
451 G4cout <<
"Incoming photon energy: " << photonEnergy/keV <<
" keV" <<
G4endl;
452 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
453 if (eKineticEnergy)
454 G4cout <<
"Outgoing electron " << eKineticEnergy/keV <<
" keV" <<
G4endl;
455 if (energyInFluorescence)
456 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/keV <<
" keV" <<
G4endl;
457 if (energyInAuger)
458 G4cout <<
"Auger electrons: " << energyInAuger/keV <<
" keV" <<
G4endl;
459 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
460 G4cout <<
"Total final state: " <<
461 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/keV <<
463 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
464 }
465 }
466}
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)