98 G4cout <<
"G4Radioactivation constructor: processName = " << processName
119 theRadioactivityTables.push_back(rTable);
123 halflifethreshold = 1000.*nanosecond;
129 outFile <<
"The G4Radioactivation process performs radioactive decay of\n"
130 <<
"nuclides (G4GenericIon) in biased mode which includes nucleus\n"
131 <<
"duplication, branching ratio biasing, source time convolution\n"
132 <<
"and detector time convolution. It is designed for use in\n"
133 <<
"activation physics.\n"
134 <<
"The required half-lives and decay schemes are retrieved from\n"
135 <<
"the RadioactiveDecay database which was derived from ENSDF.\n";
147 DecayTableMap::iterator table_ptr =
dkmap->find(key);
150 if (table_ptr ==
dkmap->end() ) {
152 if(theDecayTable) (*dkmap)[key] = theDecayTable;
154 theDecayTable = table_ptr->second;
156 return theDecayTable;
165 for (
size_t i = 0; i < theParentChainTable.size(); i++) {
166 if (theParentChainTable[i].GetIonName() == aParticleName)
return true;
178 for (
size_t i = 0; i < theParentChainTable.size(); i++) {
179 if (theParentChainTable[i].GetIonName() == aParticleName) {
180 theDecayRateVector = theParentChainTable[i].GetItsRates();
185 G4cout <<
"The DecayRate Table for " << aParticleName <<
" is selected."
202 if ( t > SBin[NSourceBin]) {
208 while (t > SBin[nbin]) {
211 G4Exception(
"G4Radioactivation::ConvolveSourceTimeProfile()",
212 "HAD_RDM_100",
JustWarning,
"While loop count exceeded");
224 for (
G4int i = 0; i < nbin; i++) {
225 earg = (SBin[i+1] - SBin[i])/tau;
227 convolvedTime += SProfile[i] * std::exp((SBin[i] - t)/tau) *
230 convolvedTime += SProfile[i] *
231 (std::exp(-(t-SBin[i+1])/tau)-std::exp(-(t-SBin[i])/tau));
235 convolvedTime -= SProfile[nbin] * std::expm1((SBin[nbin] - t)/tau);
238 if (convolvedTime < 0.) {
239 G4cout <<
" Convolved time =: " << convolvedTime <<
" reset to zero! " <<
G4endl;
246 G4cout <<
" Convolved time: " << convolvedTime <<
G4endl;
248 return convolvedTime;
267 while (DProfile[i] < rand) {
273 G4Exception(
"G4Radioactivation::GetDecayTime()",
"HAD_RDM_100",
280 decaytime = DBin[i] + rand*(DBin[i+1]-DBin[i]);
283 G4cout <<
" Decay time: " <<decaytime/s <<
"[s]" <<
G4endl;
294 while (aDecayTime > DBin[i] ) {
298 G4Exception(
"G4Radioactivation::GetDecayTimeBin()",
"HAD_RDM_100",
327 G4int theG, std::vector<G4double> theCoefficients,
328 std::vector<G4double> theTaos)
332 ratesToDaughter.
SetZ(theZ);
333 ratesToDaughter.
SetA(theA);
334 ratesToDaughter.
SetE(theE);
337 ratesToDaughter.
SetTaos(theTaos);
351 theDecayRateVector.clear();
353 G4int nGeneration = 0;
355 std::vector<G4double> taos;
358 std::vector<G4double> Acoeffs;
361 Acoeffs.push_back(-1.);
363 G4int A = ((
const G4Ions*)(&theParentNucleus))->GetAtomicMass();
364 G4int Z = ((
const G4Ions*)(&theParentNucleus))->GetAtomicNumber();
365 G4double E = ((
const G4Ions*)(&theParentNucleus))->GetExcitationEnergy();
367 if (tao < 0.) tao = 1e-100;
376 theDecayRateVector.push_back(ratesToDaughter);
402 std::vector<G4double> TP;
403 std::vector<G4double> RP;
407 G4int nearestLevelIndex = 0;
415 const G4int nMode = 12;
425 G4Exception(
"G4Radioactivation::CalculateChainsFromParent()",
"HAD_RDM_100",
430 for (j = nS; j < nT; j++) {
432 ZP = theDecayRateVector[j].GetZ();
433 AP = theDecayRateVector[j].GetA();
434 EP = theDecayRateVector[j].GetE();
435 RP = theDecayRateVector[j].GetDecayRateC();
436 TP = theDecayRateVector[j].GetTaos();
438 G4cout <<
"G4RadioactiveDecay::CalculateChainsFromParent: daughters of ("
439 << ZP <<
", " << AP <<
", " << EP
440 <<
") are being calculated, generation = " << nGeneration
447 aParentNucleus = theIonTable->
GetIon(ZP,AP,EP);
460 for (
G4int k = 0; k < nMode; k++) brs[k] = 0.0;
463 for (
G4int i = 0; i < parentDecayTable->
entries(); i++) {
465 theNuclearDecayChannel =
static_cast<G4NuclearDecay*
>(theChannel);
469 AD = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicMass();
470 ZD = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
479 if (std::abs(daughterExcitation - nearestEnergy) <
levelTolerance) {
483 if (levelManager->
LifeTime(nearestLevelIndex)*
ns >= halflifethreshold){
485 summedDecayTable->
Insert(theChannel);
487 brs[theDecayMode] += theChannel->
GetBR();
490 brs[theDecayMode] += theChannel->
GetBR();
493 brs[theDecayMode] += theChannel->
GetBR();
498 brs[2] = brs[2]+brs[3]+brs[4]+brs[5]+brs[6];
499 brs[3] = brs[4] = brs[5] = brs[6] = 0.0;
500 for (
G4int i = 0; i < nMode; i++) {
505 theITChannel =
new G4ITDecay(aParentNucleus, brs[0], 0.0, 0.0,
508 summedDecayTable->
Insert(theITChannel);
516 summedDecayTable->
Insert(theBetaMinusChannel);
524 summedDecayTable->
Insert(theBetaPlusChannel);
529 theAlphaChannel =
new G4AlphaDecay(aParentNucleus, brs[7], 0.*MeV,
531 summedDecayTable->
Insert(theAlphaChannel);
536 theProtonChannel =
new G4ProtonDecay(aParentNucleus, brs[8], 0.*MeV,
538 summedDecayTable->
Insert(theProtonChannel);
543 theNeutronChannel =
new G4NeutronDecay(aParentNucleus, brs[9], 0.*MeV,
545 summedDecayTable->
Insert(theNeutronChannel);
550 theFissionChannel =
new G4SFDecay(aParentNucleus, brs[10], 0.*MeV,
552 summedDecayTable->
Insert(theFissionChannel);
556 theTritonChannel =
new G4TritonDecay(aParentNucleus, brs[9], 0.*MeV,
558 summedDecayTable->
Insert(theTritonChannel);
569 for (
G4int i = 0; i < summedDecayTable->
entries(); i++){
571 theNuclearDecayChannel =
static_cast<G4NuclearDecay*
>(theChannel);
572 theBR = theChannel->
GetBR();
577 if (theNuclearDecayChannel->
GetDecayMode() ==
IT && nGeneration == 1) {
579 A = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicMass();
580 Z = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
581 theDaughterNucleus=theIonTable->
GetIon(Z,
A,0.);
584 aParentNucleus != theDaughterNucleus) {
587 if (parentDecayTable->
entries() ) {
588 A = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicMass();
589 Z = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
590 E = ((
const G4Ions*)(theDaughterNucleus))->GetExcitationEnergy();
593 if (TaoPlus <= 0.) TaoPlus = 1e-100;
603 taos.push_back(TaoPlus);
610 ta2 = (
long double)TaoPlus;
611 for (k = 0; k < RP.size(); k++){
612 ta1 = (
long double)TP[k];
616 theRate = ta1/(ta1-ta2);
618 theRate = theRate * theBR * RP[k];
619 Acoeffs.push_back(theRate);
626 long double aRate, aRate1;
628 for (k = 0; k < RP.size(); k++){
629 ta1 = (
long double)TP[k];
633 aRate = ta2/(ta1-ta2);
635 aRate = aRate * (
long double)(theBR * RP[k]);
639 Acoeffs.push_back(theRate);
641 theDecayRateVector.push_back(ratesToDaughter);
647 delete summedDecayTable;
652 if (nS == nT) stable =
true;
667 theParentChainTable.push_back(chainsFromParent);
679 std::ifstream infile ( filename, std::ios::in );
682 ed <<
" Could not open file " << filename <<
G4endl;
683 G4Exception(
"G4Radioactivation::SetSourceTimeProfile()",
"HAD_RDM_001",
691 while (infile >> bin >> flux) {
694 G4Exception(
"G4Radioactivation::SetSourceTimeProfile()",
"HAD_RDM_100",
700 if (NSourceBin > 99) {
701 G4Exception(
"G4Radioactivation::SetSourceTimeProfile()",
"HAD_RDM_002",
705 SBin[NSourceBin] = bin * s;
706 SProfile[NSourceBin] = flux;
715 G4cout <<
" Source Timeprofile Nbin = " << NSourceBin <<
G4endl;
728 std::ifstream infile(filename, std::ios::in);
729 if (!infile)
G4Exception(
"G4Radioactivation::SetDecayBias()",
"HAD_RDM_001",
736 theRadioactivityTables.clear();
741 while (infile >> bin >> flux ) {
745 G4Exception(
"G4Radioactivation::SetDecayBias()",
"HAD_RDM_100",
750 if (NDecayBin > 99) {
751 G4Exception(
"G4Radioactivation::SetDecayBias()",
"HAD_RDM_002",
754 DBin[NDecayBin] = bin * s;
755 DProfile[NDecayBin] = flux;
757 decayWindows[NDecayBin] = dWindows;
760 theRadioactivityTables.push_back(rTable);
764 for ( i = 1; i<= NDecayBin; i++) DProfile[i] += DProfile[i-1];
765 for ( i = 0; i<= NDecayBin; i++) DProfile[i] /= DProfile[NDecayBin];
774 G4cout <<
" Decay Bias Profile Nbin = " << NDecayBin <<
G4endl;
799 G4cout <<
"G4RadioactiveDecay::DecayIt : "
801 <<
" is not selected for the RDM"<<
G4endl;
823 G4cout <<
"G4RadioactiveDecay::DecayIt : "
825 <<
" is not an ion or is outside (Z,A) limits set for the decay. "
826 <<
" Set particle change accordingly. "
841 if (theDecayTable == 0 || theDecayTable->
entries() == 0) {
846 G4cout <<
"G4RadioactiveDecay::DecayIt : "
847 <<
"decay table not defined for "
849 <<
". Set particle change accordingly. "
887 std::vector<G4double> PT;
888 std::vector<G4double> PR;
890 long double decayRate;
893 G4int numberOfSecondaries;
894 G4int totalNumberOfSecondaries = 0;
898 std::vector<G4DynamicParticle*> secondaryparticles;
899 std::vector<G4double> pw;
900 std::vector<G4double> ptime;
905 for (
G4int n = 0; n < NSplit; n++) {
914 weight1 = 1./DProfile[nbin-1]
915 *(DBin[nbin]-DBin[nbin-1])/NSplit;
916 }
else if (nbin > 1) {
918 weight1 = 1./(DProfile[nbin]-DProfile[nbin-2])
919 *(DBin[nbin]-DBin[nbin-1])/NSplit;
927 for (i = 0; i < theDecayRateVector.size(); i++) {
928 PZ = theDecayRateVector[i].GetZ();
929 PA = theDecayRateVector[i].GetA();
930 PE = theDecayRateVector[i].GetE();
931 PT = theDecayRateVector[i].GetTaos();
932 PR = theDecayRateVector[i].GetDecayRateC();
980 for (
G4int j = 0; j <
G4int(PT.size() ); j++) {
982 decayRate -= PR[j] * (
long double)taotime;
994 if (decayRate < 0.0) decayRate = 0.0;
1003 theRadioactivityTables[decayWindows[nbin-1]]
1004 ->AddIsotope(PZ,PA,PE,weight1*decayRate,theTrack.
GetWeight());
1013 parentNucleus = theIonTable->
GetIon(PZ,PA,PE);
1025 if (theDecayChannel == 0) {
1029 G4cout <<
" G4RadioactiveDecay::DoIt : cannot determine decay channel ";
1030 G4cout <<
" for this nucleus; decay as if no biasing active. ";
1035 tempprods =
DoDecay(*parentNucleus);
1040 tempprods = theDecayChannel->
DecayIt(tempmass);
1041 weight *= (theDecayChannel->
GetBR())*(decayTable->
entries());
1044 tempprods =
DoDecay(*parentNucleus);
1048 numberOfSecondaries = tempprods->
entries();
1049 currentTime = finalGlobalTime + theDecayTime;
1050 for (index = 0; index < numberOfSecondaries; index++) {
1053 pw.push_back(weight);
1054 ptime.push_back(currentTime);
1055 secondaryparticles.push_back(asecondaryparticle);
1059 ->GetExcitationEnergy() > 0. && weight > 0.) {
1062 ptime,secondaryparticles);
1072 totalNumberOfSecondaries = pw.size();
1074 for (index=0; index < totalNumberOfSecondaries; index++) {
1076 ptime[index], currentPosition);
1100 std::vector<double>& weights_v,
1101 std::vector<double>& times_v,
1102 std::vector<G4DynamicParticle*>& secondaries_v)
1104 G4double elevel=((
const G4Ions*)(apartDef))->GetExcitationEnergy();
1108 while (life_time < halflifethreshold && elevel > 0.) {
1115 for (
G4int ind = 0; ind < nb_pevapSecondaries; ind++) {
1120 elevel = ((
const G4Ions*)(secDef))->GetExcitationEnergy();
1124 weights_v.push_back(weight);
1125 times_v.push_back(currentTime);
1126 secondaries_v.push_back(a_pevap_secondary);
1129 weights_v.push_back(weight);
1130 times_v.push_back(currentTime);
1131 secondaries_v.push_back(a_pevap_secondary);
1136 delete pevap_products;
double A(double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
G4DynamicParticle * PopProducts()
G4VDecayChannel * GetDecayChannel(G4int index) const
void Insert(G4VDecayChannel *aChannel)
G4ParticleDefinition * GetDefinition() const
virtual G4DecayProducts * DecayIt(G4double)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4double LifeTime(size_t i) const
size_t NearestLevelIndex(G4double energy, size_t index=0) const
G4double NearestLevelEnergy(G4double energy, size_t index=0) const
size_t NumberOfTransitions() const
const G4String & GetName() const
G4double GetDaughterExcitation()
G4ParticleDefinition * GetDaughterNucleus()
G4RadioactiveDecayMode GetDecayMode()
const G4LevelManager * GetLevelManager(G4int Z, G4int A)
static G4NuclearLevelData * GetInstance()
void ProposeLocalTime(G4double t)
virtual void Initialize(const G4Track &)
void AddSecondary(G4Track *aSecondary)
G4bool GetPDGStable() const
G4double GetPDGMass() const
G4int GetBaryonNumber() const
G4double GetPDGLifeTime() const
const G4String & GetParticleName() const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
G4int GetDecayTimeBin(const G4double aDecayTime)
void AddDeexcitationSpectrumForBiasMode(G4ParticleDefinition *apartDef, G4double weight, G4double currenTime, std::vector< double > &weights_v, std::vector< double > ×_v, std::vector< G4DynamicParticle * > &secondaries_v)
void SetDecayBias(G4String filename)
G4bool IsRateTableReady(const G4ParticleDefinition &)
virtual void ProcessDescription(std::ostream &outFile) const
G4Radioactivation(const G4String &processName="Radioactivation")
G4VParticleChange * DecayIt(const G4Track &theTrack, const G4Step &theStep)
G4double ConvolveSourceTimeProfile(const G4double, const G4double)
void CalculateChainsFromParent(const G4ParticleDefinition &)
void SetDecayRate(G4int, G4int, G4double, G4int, std::vector< G4double >, std::vector< G4double >)
G4DecayTable * GetDecayTable1(const G4ParticleDefinition *)
void SetSourceTimeProfile(G4String filename)
void GetChainsFromParent(const G4ParticleDefinition &)
G4double GetMeanLifeTime(const G4Track &theTrack, G4ForceCondition *condition)
G4RadioactivationMessenger * theRadioactivationMessenger
std::vector< G4String > ValidVolumes
G4int GetVerboseLevel() const
G4bool IsApplicable(const G4ParticleDefinition &)
G4double GetMeanLifeTime(const G4Track &theTrack, G4ForceCondition *condition)
G4DecayTable * LoadDecayTable(const G4ParticleDefinition &theParentNucleus)
void DecayAnalog(const G4Track &theTrack)
static const G4double levelTolerance
G4DecayProducts * DoDecay(const G4ParticleDefinition &theParticleDef)
G4ParticleChangeForRadDecay fParticleChangeForRadDecay
G4PhotonEvaporation * photonEvaporation
void SetIonName(G4String name)
void SetItsRates(G4RadioactiveDecayRates arate)
void SetE(G4double value)
void SetTaos(std::vector< G4double > value)
void SetDecayRateC(std::vector< G4double > value)
void SetGeneration(G4int value)
G4VPhysicalVolume * GetVolume() const
G4double GetWeight() const
void SetWeight(G4double aValue)
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
G4double GetLocalTime() const
const G4DynamicParticle * GetDynamicParticle() const
const G4TouchableHandle & GetTouchableHandle() const
void SetGoodForTrackingFlag(G4bool value=true)
virtual G4DecayProducts * DecayIt(G4double parentMass=-1.0)=0
void ProposeTrackStatus(G4TrackStatus status)
void ProposeWeight(G4double finalWeight)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
G4LogicalVolume * GetLogicalVolume() const
void ClearNumberOfInteractionLengthLeft()