326{
327
328
329
330
331
332
333
334 theDecayRateVector.clear();
335
336 G4int nGeneration = 0;
337
338 std::vector<G4double> taos;
339
340
341 std::vector<G4double> Acoeffs;
342
343
344 Acoeffs.push_back(-1.);
345
346 const G4Ions* ion =
static_cast<const G4Ions*
>(&theParentNucleus);
351 if (tao < 0.) tao = 1e-100;
352 taos.push_back(tao);
354
355
356
358
359
360 theDecayRateVector.push_back(ratesToDaughter);
361 ++nEntry;
362
363
368
377
385 std::vector<G4double> TP;
386 std::vector<G4double> RP;
390 G4int nearestLevelIndex = 0;
400
402
404 while (!stable) {
405 loop++;
406 if (loop > 10000) {
407 G4Exception(
"G4Radioactivation::CalculateChainsFromParent()",
"HAD_RDM_100",
409 break;
410 }
411 nGeneration++;
412 for (j = nS; j < nT; ++j) {
413
414 ZP = theDecayRateVector[j].GetZ();
415 AP = theDecayRateVector[j].GetA();
416 EP = theDecayRateVector[j].GetE();
417 RP = theDecayRateVector[j].GetDecayRateC();
418 TP = theDecayRateVector[j].GetTaos();
420 G4cout <<
"G4RadioactiveDecay::CalculateChainsFromParent: daughters of ("
421 << ZP << ", " << AP << ", " << EP
422 << ") are being calculated, generation = " << nGeneration
424 }
425
426
427
428
429 aParentNucleus = theIonTable->
GetIon(ZP,AP,EP);
431 if (nullptr == parentDecayTable) { continue; }
432
434
435
436
437
438
439
440
441
442
443 for (
G4int k = 0; k < nMode; ++k) brs[k] = 0.0;
444
445
446 for (
G4int i = 0; i < parentDecayTable->
entries(); ++i) {
448 theNuclearDecayChannel =
static_cast<G4NuclearDecay*
>(theChannel);
453 ZD = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
456
457
458
459
462 if ((std::abs(daughterExcitation - nearestEnergy) <
levelTolerance) && (std::abs(daughterExcitation - nearestEnergy) >
DBL_EPSILON)) {
463
464
466 if (levelManager->
LifeTime(nearestLevelIndex)*ns >= halflifethreshold){
467
468 summedDecayTable->
Insert(theChannel);
469 } else {
470 brs[theDecayMode] += theChannel->
GetBR();
471 }
472 } else {
473 brs[theDecayMode] += theChannel->
GetBR();
474 }
475 } else {
476 brs[theDecayMode] += theChannel->
GetBR();
477 }
478
479 }
480
483 for (
G4int i = 0; i < nMode; ++i) {
484 if (brs[i] > 0.) {
485 switch (i) {
487
488 theITChannel =
new G4ITDecay(aParentNucleus, brs[
IT], 0.0, 0.0);
489
490 summedDecayTable->
Insert(theITChannel);
491 break;
492
494
496 0.*MeV, 0.*MeV,
498 summedDecayTable->
Insert(theBetaMinusChannel);
499 break;
500
502
504 0.*MeV, 0.*MeV,
506 summedDecayTable->
Insert(theBetaPlusChannel);
507 break;
508
510
513 summedDecayTable->
Insert(theAlphaChannel);
514 break;
515
517
520 summedDecayTable->
Insert(theProtonChannel);
521 break;
522
524
527 summedDecayTable->
Insert(theNeutronChannel);
528 break;
529
531
534 summedDecayTable->
Insert(theFissionChannel);
535 break;
536
538
539 break;
540
542
543 break;
544
546
547 break;
548
550
551 break;
552
554
555 break;
556
558
559 break;
560
562
565 summedDecayTable->
Insert(theTritonChannel);
566 break;
567
568 default:
569 break;
570 }
571 }
572 }
573
574
575
576 for (
G4int i = 0; i < summedDecayTable->
entries(); ++i){
578 theNuclearDecayChannel =
static_cast<G4NuclearDecay*
>(theChannel);
579 theBR = theChannel->
GetBR();
581
582
583
584 if (theNuclearDecayChannel->
GetDecayMode() ==
IT && nGeneration == 1) {
585
586 A = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicMass();
587 Z = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
588 theDaughterNucleus=theIonTable->
GetIon(Z,
A,0.);
589 }
591 aParentNucleus != theDaughterNucleus) {
592
594 if (
nullptr != parentDecayTable && parentDecayTable->
entries() > 0) {
595 A = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicMass();
596 Z = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
597 E = ((
const G4Ions*)(theDaughterNucleus))->GetExcitationEnergy();
598
600 if (TaoPlus <= 0.) TaoPlus = 1e-100;
601
602
603 taos.clear();
604 taos = TP;
605 std::size_t k;
606
607
608
609
610 taos.push_back(TaoPlus);
611
612
613
614
615 Acoeffs.clear();
616 long double ta1,ta2;
617 ta2 = (long double)TaoPlus;
618 for (k = 0; k < RP.size(); ++k){
619 ta1 = (long double)TP[k];
620 if (ta1 == ta2) {
621 theRate = 1.e100;
622 } else {
623 theRate = ta1/(ta1-ta2);
624 }
625 theRate = theRate * theBR * RP[k];
626 Acoeffs.push_back(theRate);
627 }
628
629
630
631
632 theRate = 0.;
633 long double aRate, aRate1;
634 aRate1 = 0.L;
635 for (k = 0; k < RP.size(); ++k){
636 ta1 = (long double)TP[k];
637 if (ta1 == ta2 ) {
638 aRate = 1.e100;
639 } else {
640 aRate = ta2/(ta1-ta2);
641 }
642 aRate = aRate * (long double)(theBR * RP[k]);
643 aRate1 += aRate;
644 }
645 theRate = -aRate1;
646 Acoeffs.push_back(theRate);
648 theDecayRateVector.push_back(ratesToDaughter);
649 nEntry++;
650 }
651 }
652 }
653
654 delete summedDecayTable;
655
656 }
657 nS = nT;
658 nT = nEntry;
659 if (nS == nT) stable = true;
660 }
661
662
663
664
665
666
667
669
670
672
673
674 theParentChainTable.push_back(chainsFromParent);
675}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
@ G4RadioactiveDecayModeSize
G4VDecayChannel * GetDecayChannel(G4int index) const
void Insert(G4VDecayChannel *aChannel)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4double GetExcitationEnergy() const
std::size_t NearestLevelIndex(const G4double energy, const std::size_t index=0) const
std::size_t NumberOfTransitions() const
G4double LifeTime(const std::size_t i) const
G4double NearestLevelEnergy(const G4double energy, const std::size_t index=0) const
G4RadioactiveDecayMode GetDecayMode() const
G4double GetDaughterExcitation() const
G4ParticleDefinition * GetDaughterNucleus()
const G4LevelManager * GetLevelManager(G4int Z, G4int A)
static G4NuclearLevelData * GetInstance()
G4int GetAtomicNumber() const
G4int GetAtomicMass() const
const G4String & GetParticleName() const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
void SetDecayRate(G4int, G4int, G4double, G4int, std::vector< G4double > &, std::vector< G4double > &)
void SetIonName(G4String name)
void SetItsRates(G4RadioactiveDecayRates arate)
G4bool IsApplicable(const G4ParticleDefinition &) override
G4DecayTable * GetDecayTable(const G4ParticleDefinition *)
static const G4double levelTolerance