306{
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339 if (verboseLevel > 3)
340 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeIonisationModel" <<
G4endl;
341
344
345 if (kineticEnergy0 <= fIntrinsicLowEnergyLimit)
346 {
349 return ;
350 }
351
354
356
357
358
359 kineticEnergy1=kineticEnergy0;
360 cosThetaPrimary=1.0;
361 energySecondary=0.0;
362 cosThetaSecondary=1.0;
363 targetOscillator = -1;
364
366 SampleFinalStateElectron(material,cutE,kineticEnergy0);
368 SampleFinalStatePositron(material,cutE,kineticEnergy0);
369 else
370 {
373 G4Exception(
"G4PenelopeIonisationModel::SamplingSecondaries()",
375
376 }
377 if (energySecondary == 0) return;
378
379 if (verboseLevel > 3)
380 {
381 G4cout <<
"G4PenelopeIonisationModel::SamplingSecondaries() for " <<
383 G4cout <<
"Final eKin = " << kineticEnergy1 <<
" keV" <<
G4endl;
384 G4cout <<
"Final cosTheta = " << cosThetaPrimary <<
G4endl;
385 G4cout <<
"Delta-ray eKin = " << energySecondary <<
" keV" <<
G4endl;
386 G4cout <<
"Delta-ray cosTheta = " << cosThetaSecondary <<
G4endl;
388 }
389
390
391 G4double sint = std::sqrt(1. - cosThetaPrimary*cosThetaPrimary);
393 G4double dirx = sint * std::cos(phiPrimary);
394 G4double diry = sint * std::sin(phiPrimary);
396
398 electronDirection1.rotateUz(particleDirection0);
399
400 if (kineticEnergy1 > 0)
401 {
404 }
405 else
407
408
409
410 G4double ionEnergyInPenelopeDatabase =
411 (*theTable)[targetOscillator]->GetIonisationEnergy();
412
413
414
415 G4int shFlag = (*theTable)[targetOscillator]->GetShellFlag();
416 G4int Z = (
G4int) (*theTable)[targetOscillator]->GetParentZ();
417
418
421
422
424
425 if (Z > 0 && shFlag<30)
426 {
427 shell = transitionManager->
Shell(Z,shFlag-1);
429
430 }
431
432
433
434
435 energySecondary += ionEnergyInPenelopeDatabase-
bindingEnergy;
436
438
441
442 if (energySecondary < 0)
443 {
444
445
446
447
448 localEnergyDeposit += energySecondary;
449 energySecondary = 0.0;
450 }
451
452
453
454 if (fAtomDeexcitation && shell)
455 {
458 {
459 size_t nBefore = fvect->size();
461 size_t nAfter = fvect->size();
462
463 if (nAfter > nBefore)
464 {
465 for (size_t j=nBefore;j<nAfter;j++)
466 {
467 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy();
468 localEnergyDeposit -= itsEnergy;
470 energyInFluorescence += itsEnergy;
472 energyInAuger += itsEnergy;
473 }
474 }
475 }
476 }
477
478
479 if (energySecondary > cutE)
480 {
482 G4double sinThetaE = std::sqrt(1.-cosThetaSecondary*cosThetaSecondary);
484 G4double xEl = sinThetaE * std::cos(phiEl);
485 G4double yEl = sinThetaE * std::sin(phiEl);
488 eDirection.rotateUz(particleDirection0);
490 eDirection,energySecondary) ;
491 fvect->push_back(electron);
492 }
493 else
494 {
495 localEnergyDeposit += energySecondary;
496 energySecondary = 0;
497 }
498
499 if (localEnergyDeposit < 0)
500 {
502 << "G4PenelopeIonisationModel::SampleSecondaries - Negative energy deposit"
504 localEnergyDeposit=0.;
505 }
507
508 if (verboseLevel > 1)
509 {
510 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
511 G4cout <<
"Energy balance from G4PenelopeIonisation" <<
G4endl;
512 G4cout <<
"Incoming primary energy: " << kineticEnergy0/keV <<
" keV" <<
G4endl;
513 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
514 G4cout <<
"Outgoing primary energy: " << kineticEnergy1/keV <<
" keV" <<
G4endl;
515 G4cout <<
"Delta ray " << energySecondary/keV <<
" keV" <<
G4endl;
516 if (energyInFluorescence)
517 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/keV <<
" keV" <<
G4endl;
518 if (energyInAuger)
519 G4cout <<
"Auger electrons: " << energyInAuger/keV <<
" keV" <<
G4endl;
520 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
521 G4cout <<
"Total final state: " << (energySecondary+energyInFluorescence+kineticEnergy1+
522 localEnergyDeposit+energyInAuger)/keV <<
524 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
525 }
526
527 if (verboseLevel > 0)
528 {
529 G4double energyDiff = std::fabs(energySecondary+energyInFluorescence+kineticEnergy1+
530 localEnergyDeposit+energyInAuger-kineticEnergy0);
531 if (energyDiff > 0.05*keV)
532 G4cout <<
"Warning from G4PenelopeIonisation: problem with energy conservation: " <<
533 (energySecondary+energyInFluorescence+kineticEnergy1+localEnergyDeposit+energyInAuger)/keV <<
534 " keV (final) vs. " <<
535 kineticEnergy0/keV <<
" keV (initial)" <<
G4endl;
536 }
537
538}
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
G4double BindingEnergy() const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
static G4AtomicTransitionManager * Instance()
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Definition()
static G4Electron * Electron()
static G4Gamma * Definition()
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4String & GetParticleName() const
G4PenelopeOscillatorTable * GetOscillatorTableIonisation(const G4Material *)
static G4Positron * Positron()
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription
G4double bindingEnergy(G4int A, G4int Z)