152using namespace CLHEP;
154const G4double G4RadioactiveDecay::levelTolerance = 10.0*eV;
157#ifdef G4MULTITHREADED
162G4int& G4RadioactiveDecay::NumberOfInstances()
164 static G4int numberOfInstances = 0;
165 return numberOfInstances;
171 forceDecayDirection(0.,0.,0.), forceDecayHalfAngle(0.*deg), dirPath(
""),
176 G4cout <<
"G4RadioactiveDecay constructor: processName = " << processName
181 G4cout <<
" G4RadioactiveDecay is deprecated and will be removed in Geant4 version 11. " <<
G4endl;
182 G4cout <<
" Please replace it with G4RadioactiveDecayBase if you want the unbiased radioactive deacy process." <<
G4endl;
183 G4cout <<
" If you want the general process, with optional biasing, use G4Radioactivation. " <<
G4endl;
194 photonEvaporation->
SetICM(
true);
197 char* path_var = std::getenv(
"G4RADIOACTIVEDATA");
200 "Environment variable G4RADIOACTIVEDATA is not set");
203 std::ostringstream os;
204 os << dirPath <<
"/z1.a3";
205 std::ifstream testFile;
206 testFile.open(os.str() );
207 if (!testFile.is_open() )
209 "Environment variable G4RADIOACTIVEDATA is set, but does not point to correct directory");
213 theUserRadioactiveDataFiles.clear();
216#ifdef G4MULTITHREADED
217 G4AutoLock lk(&G4RadioactiveDecay::radioactiveDecayMutex);
218 NumberOfInstances()++;
236 theRadioactivityTables.push_back(rTable);
243 halflifethreshold = nanosecond;
246 isAllVolumesMode =
true;
254 outFile <<
"The radioactive decay process (G4RadioactiveDecay) handles the\n"
255 <<
"alpha, beta+, beta-, electron capture and isomeric transition\n"
256 <<
"decays of nuclei (G4GenericIon) with masses A > 4.\n"
257 <<
"The required half-lives and decay schemes are retrieved from\n"
258 <<
"the RadioactiveDecay database which was derived from ENSDF.\n";
264 delete theRadioactiveDecaymessenger;
265 delete photonEvaporation;
266 for (DecayTableMap::iterator i = dkmap->begin(); i != dkmap->end(); i++) {
271#ifdef G4MULTITHREADED
272 G4AutoLock lk(&G4RadioactiveDecay::radioactiveDecayMutex);
273 --NumberOfInstances();
274 if(NumberOfInstances()==0)
276 for (DecayTableMap::iterator i = master_dkmap->begin(); i != master_dkmap->end(); i++) {
279 master_dkmap->clear();
289 if (((
const G4Ions*)(&aParticle))->GetExcitationEnergy() > 0.) {
302 G4int A = ((
const G4Ions*) (&aParticle))->GetAtomicMass();
303 G4int Z = ((
const G4Ions*) (&aParticle))->GetAtomicNumber();
307 else if (Z > theNucleusLimits.
GetZMax() || Z < theNucleusLimits.
GetZMin())
315 DecayTableMap::iterator table_ptr = dkmap->find(key);
318 if (table_ptr == dkmap->end() ) {
320 if(theDecayTable) (*dkmap)[key] = theDecayTable;
322 theDecayTable = table_ptr->second;
325 return theDecayTable;
334 for (
size_t i = 0; i < theLogicalVolumes->size(); i++) {
335 volume=(*theLogicalVolumes)[i];
336 if (volume->
GetName() == aVolume) {
337 ValidVolumes.push_back(aVolume);
338 std::sort(ValidVolumes.begin(), ValidVolumes.end());
344 }
else if(i == theLogicalVolumes->size()) {
346 ed << aVolume <<
" is not a valid logical volume name. Decay not activated for it."
348 G4Exception(
"G4RadioactiveDecayBase::SelectAVolume()",
"HAD_RDM_300",
360 for (
size_t i = 0; i < theLogicalVolumes->size(); i++){
361 volume=(*theLogicalVolumes)[i];
362 if (volume->
GetName() == aVolume) {
363 std::vector<G4String>::iterator location;
364 location = std::find(ValidVolumes.begin(),ValidVolumes.end(),aVolume);
365 if (location != ValidVolumes.end()) {
366 ValidVolumes.erase(location);
367 std::sort(ValidVolumes.begin(), ValidVolumes.end());
368 isAllVolumesMode =
false;
371 ed << aVolume <<
" is not in the list " <<
G4endl;
372 G4Exception(
"G4RadioactiveDecayBase::DeselectAVolume()",
"HAD_RDM_300",
377 G4cout <<
" DeselectVolume: " << aVolume <<
" is removed from list "
380 }
else if (i == theLogicalVolumes->size()) {
382 ed << aVolume <<
" is not a valid logical volume name " <<
G4endl;
383 G4Exception(
"G4RadioactiveDecayBase::SelectAVolume()",
"HAD_RDM_300",
395 ValidVolumes.clear();
400 for (
size_t i = 0; i < theLogicalVolumes->size(); i++){
401 volume = (*theLogicalVolumes)[i];
402 ValidVolumes.push_back(volume->
GetName());
408 std::sort(ValidVolumes.begin(), ValidVolumes.end());
410 isAllVolumesMode=
true;
416 ValidVolumes.clear();
417 isAllVolumesMode=
false;
430 for (
size_t i = 0; i < theParentChainTable.size(); i++) {
431 if (theParentChainTable[i].GetIonName() == aParticleName)
return true;
442 for (
size_t i = 0; i < theParentChainTable.size(); i++) {
443 if (theParentChainTable[i].GetIonName() == aParticleName) {
444 theDecayRateVector = theParentChainTable[i].GetItsRates();
449 G4cout <<
"The DecayRate Table for " << aParticleName <<
" is selected."
524 if ( t > SBin[NSourceBin]) {
530 while (t > SBin[nbin]) {
533 G4Exception(
"G4RadioactiveDecay::ConvolveSourceTimeProfile()",
534 "HAD_RDM_100",
JustWarning,
"While loop count exceeded");
546 for (
G4int i = 0; i < nbin; i++) {
547 earg = (SBin[i+1] - SBin[i])/tau;
549 convolvedTime += SProfile[i] * std::exp((SBin[i] - t)/tau) *
552 convolvedTime += SProfile[i] *
553 (std::exp(-(t-SBin[i+1])/tau)-std::exp(-(t-SBin[i])/tau));
557 convolvedTime -= SProfile[nbin] * std::expm1((SBin[nbin] - t)/tau);
560 if (convolvedTime < 0.) {
561 G4cout <<
" Convolved time =: " << convolvedTime <<
" reset to zero! " <<
G4endl;
568 G4cout <<
" Convolved time: " << convolvedTime <<
G4endl;
570 return convolvedTime;
589 while ( DProfile[i] < rand) {
593 G4Exception(
"G4RadioactiveDecay::GetDecayTime()",
"HAD_RDM_100",
600 decaytime = DBin[i] + rand*(DBin[i+1]-DBin[i]);
603 G4cout <<
" Decay time: " <<decaytime/s <<
"[s]" <<
G4endl;
614 while ( aDecayTime > DBin[i] ) {
618 G4Exception(
"G4RadioactiveDecay::GetDecayTimeBin()",
"HAD_RDM_100",
647 G4cout <<
"G4RadioactiveDecay::GetMeanLifeTime() " <<
G4endl;
649 <<
" GeV, Mass: " << theParticle->
GetMass()/GeV
650 <<
" GeV, Life time: " << theLife/
ns <<
" ns " <<
G4endl;
654 else if (theLife < 0.0) {meanlife =
DBL_MAX;}
655 else {meanlife = theLife;}
658 if (((
const G4Ions*)(theParticleDef))->GetExcitationEnergy() > 0. &&
659 meanlife ==
DBL_MAX) {meanlife = 0.;}
663 G4cout <<
" mean life time: " << meanlife/s <<
" s " <<
G4endl;
685 G4cout <<
"G4RadioactiveDecay::GetMeanFreePath() " <<
G4endl;
687 <<
" GeV, Mass: " << aMass/GeV <<
" GeV, tau: " << tau <<
" ns "
698 }
else if (tau < 0.0) {
701 ed <<
"Ion has negative lifetime " << tau
702 <<
" but is not stable. Setting mean free path to DBL_MAX" <<
G4endl;
703 G4Exception(
"G4RadioactiveDecay::GetMeanFreePath()",
"HAD_RDM_011",
710 pathlength = c_light*tau*betaGamma;
716 G4cout <<
"G4Decay::GetMeanFreePath: "
718 <<
" stops, kinetic energy = "
728 G4cout <<
"mean free path: "<< pathlength/m <<
" m" <<
G4endl;
742 if (!isInitialised) {
743 isInitialised =
true;
759void G4RadioactiveDecay::StreamInfo(std::ostream& os,
const G4String& endline)
765 G4int prec = os.precision(5);
766 os <<
"======================================================================="
768 os <<
"====== Radioactive Decay Physics Parameters ========"
770 os <<
"======================================================================="
772 os <<
"Max life time "
774 os <<
"Internal e- conversion flag "
776 os <<
"Stored internal conversion coefficients "
778 os <<
"Enable correlated gamma emission "
780 os <<
"Max 2J for sampling of angular correlations "
782 os <<
"Atomic de-excitation enabled "
783 << emparam->
Fluo() << endline;
784 os <<
"Auger electron emission enabled "
785 << emparam->
Auger() << endline;
786 os <<
"Auger cascade enabled "
788 os <<
"Check EM cuts disabled for atomic de-excitation "
790 os <<
"Use Bearden atomic level energies "
792 os <<
"======================================================================="
809 G4int A = ((
const G4Ions*)(&theParentNucleus))->GetAtomicMass();
810 G4int Z = ((
const G4Ions*)(&theParentNucleus))->GetAtomicNumber();
812 G4double levelEnergy = ((
const G4Ions*)(&theParentNucleus))->GetExcitationEnergy();
814 ((
const G4Ions*)(&theParentNucleus))->GetFloatLevelBase();
816#ifdef G4MULTITHREADED
817 G4AutoLock lk(&G4RadioactiveDecay::radioactiveDecayMutex);
820 DecayTableMap::iterator master_table_ptr = master_dkmap->find(key);
822 if (master_table_ptr != master_dkmap->end() ) {
823 return master_table_ptr->second;
828 G4String file = theUserRadioactiveDataFiles[1000*
A+Z];
831 std::ostringstream os;
832 os << dirPath <<
"/z" << Z <<
".a" <<
A <<
'\0';
839 std::ifstream DecaySchemeFile;
840 DecaySchemeFile.open(file);
842 if (DecaySchemeFile.good()) {
845 const G4int nMode = 12;
846 G4double modeTotalBR[nMode] = {0.0};
848 for (
G4int i = 0; i < nMode; i++) {
852 char inputChars[120]={
' '};
873 while (!complete && !DecaySchemeFile.getline(inputChars, 120).eof()) {
876 G4Exception(
"G4RadioactiveDecay::LoadDecayTable()",
"HAD_RDM_100",
881 inputLine = inputChars;
882 inputLine = inputLine.
strip(1);
883 if (inputChars[0] !=
'#' && inputLine.length() != 0) {
884 std::istringstream tmpStream(inputLine);
886 if (inputChars[0] ==
'P') {
889 tmpStream >> recordType >> parentExcitation >> floatingFlag >> dummy;
897 found = (std::abs(parentExcitation*keV - levelEnergy) < levelTolerance);
898 if (floatingLevel !=
noFloat) {
901 if (!floatMatch) found =
false;
910 if (inputLine.length() < 72) {
911 tmpStream >> theDecayMode >> dummy >> decayModeTotal;
912 switch (theDecayMode) {
916 0.0, 0.0, photonEvaporation);
918 anITChannel->
SetARM(applyARM);
919 theDecayTable->
Insert(anITChannel);
924 modeTotalBR[1] = decayModeTotal;
break;
926 modeTotalBR[2] = decayModeTotal;
break;
928 modeTotalBR[3] = decayModeTotal;
break;
930 modeTotalBR[4] = decayModeTotal;
break;
932 modeTotalBR[5] = decayModeTotal;
break;
934 modeTotalBR[6] = decayModeTotal;
break;
936 modeTotalBR[7] = decayModeTotal;
break;
938 modeTotalBR[8] = decayModeTotal;
break;
940 modeTotalBR[9] = decayModeTotal;
break;
954 modeTotalBR[10] = decayModeTotal;
break;
956 modeTotalBR[11] = decayModeTotal;
break;
960 G4Exception(
"G4RadioactiveDecay::LoadDecayTable()",
"HAD_RDM_000",
965 if (inputLine.length() < 84) {
966 tmpStream >> theDecayMode >> a >> daughterFloatFlag >> b >> c;
969 tmpStream >> theDecayMode >> a >> daughterFloatFlag >> b >> c >> betaType;
979 switch (theDecayMode) {
984 daughterFloatLevel, betaType);
987 theDecayTable->
Insert(aBetaMinusChannel);
996 daughterFloatLevel, betaType);
999 theDecayTable->
Insert(aBetaPlusChannel);
1007 new G4ECDecay(&theParentNucleus, b, c*MeV, a*MeV,
1011 aKECChannel->
SetARM(applyARM);
1012 theDecayTable->
Insert(aKECChannel);
1020 new G4ECDecay(&theParentNucleus, b, c*MeV, a*MeV,
1024 aLECChannel->
SetARM(applyARM);
1025 theDecayTable->
Insert(aLECChannel);
1033 new G4ECDecay(&theParentNucleus, b, c*MeV, a*MeV,
1037 aMECChannel->
SetARM(applyARM);
1038 theDecayTable->
Insert(aMECChannel);
1046 new G4ECDecay(&theParentNucleus, b, c*MeV, a*MeV,
1050 aNECChannel->
SetARM(applyARM);
1051 theDecayTable->
Insert(aNECChannel);
1060 daughterFloatLevel);
1063 theDecayTable->
Insert(anAlphaChannel);
1072 daughterFloatLevel);
1075 theDecayTable->
Insert(aProtonChannel);
1084 daughterFloatLevel);
1087 theDecayTable->
Insert(aNeutronChannel);
1120 new G4SFDecay(&theParentNucleus, b, c*MeV, a*MeV,
1121 daughterFloatLevel);
1122 theDecayTable->
Insert(aSpontFissChannel);
1130 daughterFloatLevel);
1133 theDecayTable->
Insert(aTritonChannel);
1141 G4Exception(
"G4RadioactiveDecay::LoadDecayTable()",
"HAD_RDM_000",
1159 theNuclearDecayChannel =
static_cast<G4NuclearDecay*
>(theChannel);
1162 if (theDecayMode !=
IT) {
1163 theBR = theChannel->
GetBR();
1164 theChannel->
SetBR(theBR*modeTotalBR[theDecayMode]/modeSumBR[theDecayMode]);
1169 DecaySchemeFile.close();
1171 if (!found && levelEnergy > 0) {
1177 anITChannel->
SetARM(applyARM);
1178 theDecayTable->
Insert(anITChannel);
1185#ifdef G4MULTITHREADED
1188 return theDecayTable;
1194 if (Z < 1 ||
A < 2)
G4cout <<
"Z and A not valid!" <<
G4endl;
1196 std::ifstream DecaySchemeFile(filename);
1197 if (DecaySchemeFile) {
1198 G4int ID_ion =
A*1000 + Z;
1199 theUserRadioactiveDataFiles[ID_ion] = filename;
1201 G4cout <<
"The file " << filename <<
" does not exist!" <<
G4endl;
1208 G4int theG, std::vector<G4double> theCoefficients,
1209 std::vector<G4double> theTaos)
1213 ratesToDaughter.
SetZ(theZ);
1214 ratesToDaughter.
SetA(theA);
1215 ratesToDaughter.
SetE(theE);
1218 ratesToDaughter.
SetTaos(theTaos);
1232 theDecayRateVector.clear();
1234 G4int nGeneration = 0;
1236 std::vector<G4double> taos;
1239 std::vector<G4double> Acoeffs;
1242 Acoeffs.push_back(-1.);
1244 G4int A = ((
const G4Ions*)(&theParentNucleus))->GetAtomicMass();
1245 G4int Z = ((
const G4Ions*)(&theParentNucleus))->GetAtomicNumber();
1246 G4double E = ((
const G4Ions*)(&theParentNucleus))->GetExcitationEnergy();
1248 if (tao < 0.) tao = 1e-100;
1249 taos.push_back(tao);
1257 theDecayRateVector.push_back(ratesToDaughter);
1283 std::vector<G4double> TP;
1284 std::vector<G4double> RP;
1288 G4int nearestLevelIndex = 0;
1296 const G4int nMode = 12;
1308 G4Exception(
"G4RadioactiveDecay::CalculateChainsFromParent()",
"HAD_RDM_100",
1313 for (j = nS; j < nT; j++) {
1315 ZP = theDecayRateVector[j].GetZ();
1316 AP = theDecayRateVector[j].GetA();
1317 EP = theDecayRateVector[j].GetE();
1318 RP = theDecayRateVector[j].GetDecayRateC();
1319 TP = theDecayRateVector[j].GetTaos();
1321 G4cout <<
"G4RadioactiveDecay::CalculateChainsFromParent: daughters of ("
1322 << ZP <<
", " << AP <<
", " << EP
1323 <<
") are being calculated, generation = " << nGeneration
1330 aParentNucleus = theIonTable->
GetIon(ZP,AP,EP);
1343 for (
G4int k = 0; k < nMode; k++) brs[k] = 0.0;
1346 for (i = 0; i < parentDecayTable->
entries(); i++) {
1348 theNuclearDecayChannel =
static_cast<G4NuclearDecay*
>(theChannel);
1353 AD = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicMass();
1354 ZD = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
1360 if (std::abs(daughterExcitation - nearestEnergy) < levelTolerance) {
1364 if (levelManager->
LifeTime(nearestLevelIndex)*
ns >= halflifethreshold){
1366 summedDecayTable->
Insert(theChannel);
1368 brs[theDecayMode] += theChannel->
GetBR();
1371 brs[theDecayMode] += theChannel->
GetBR();
1374 brs[theDecayMode] += theChannel->
GetBR();
1378 brs[2] = brs[2]+brs[3]+brs[4]+brs[5]+brs[6];
1379 brs[3] = brs[4] = brs[5] = brs[6] = 0.0;
1380 for (i = 0; i < nMode; i++) {
1385 theITChannel =
new G4ITDecay(aParentNucleus, brs[0], 0.0, 0.0,
1388 summedDecayTable->
Insert(theITChannel);
1396 summedDecayTable->
Insert(theBetaMinusChannel);
1404 summedDecayTable->
Insert(theBetaPlusChannel);
1409 theAlphaChannel =
new G4AlphaDecay(aParentNucleus, brs[7], 0.*MeV,
1411 summedDecayTable->
Insert(theAlphaChannel);
1416 theProtonChannel =
new G4ProtonDecay(aParentNucleus, brs[8], 0.*MeV,
1418 summedDecayTable->
Insert(theProtonChannel);
1423 theNeutronChannel =
new G4NeutronDecay(aParentNucleus, brs[9], 0.*MeV,
1425 summedDecayTable->
Insert(theNeutronChannel);
1430 theFissionChannel =
new G4SFDecay(aParentNucleus, brs[10], 0.*MeV,
1432 summedDecayTable->
Insert(theFissionChannel);
1436 theTritonChannel =
new G4TritonDecay(aParentNucleus, brs[11], 0.*MeV,
1438 summedDecayTable->
Insert(theTritonChannel);
1448 for (i = 0; i < summedDecayTable->
entries(); i++){
1450 theNuclearDecayChannel =
static_cast<G4NuclearDecay*
>(theChannel);
1451 theBR = theChannel->
GetBR();
1456 if (theNuclearDecayChannel->
GetDecayMode() ==
IT && nGeneration == 1) {
1458 A = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicMass();
1459 Z = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
1460 theDaughterNucleus=theIonTable->
GetIon(Z,
A,0.);
1463 aParentNucleus != theDaughterNucleus) {
1467 if (parentDecayTable->
entries() ) {
1468 A = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicMass();
1469 Z = ((
const G4Ions*)(theDaughterNucleus))->GetAtomicNumber();
1470 E = ((
const G4Ions*)(theDaughterNucleus))->GetExcitationEnergy();
1473 if (TaoPlus <= 0.) TaoPlus = 1e-100;
1483 taos.push_back(TaoPlus);
1489 long double ta1,ta2;
1490 ta2 = (
long double)TaoPlus;
1491 for (k = 0; k < RP.size(); k++){
1492 ta1 = (
long double)TP[k];
1496 theRate = ta1/(ta1-ta2);
1498 theRate = theRate * theBR * RP[k];
1499 Acoeffs.push_back(theRate);
1506 long double aRate, aRate1;
1508 for (k = 0; k < RP.size(); k++){
1509 ta1 = (
long double)TP[k];
1513 aRate = ta2/(ta1-ta2);
1515 aRate = aRate * (
long double)(theBR * RP[k]);
1519 Acoeffs.push_back(theRate);
1521 theDecayRateVector.push_back(ratesToDaughter);
1527 delete summedDecayTable;
1532 if (nS == nT) stable =
true;
1547 theParentChainTable.push_back(chainsFromParent);
1559 std::ifstream infile ( filename, std::ios::in );
1562 ed <<
" Could not open file " << filename <<
G4endl;
1563 G4Exception(
"G4RadioactiveDecay::SetSourceTimeProfile()",
"HAD_RDM_001",
1571 while (infile >> bin >> flux) {
1574 G4Exception(
"G4RadioactiveDecay::SetSourceTimeProfile()",
"HAD_RDM_100",
1580 if (NSourceBin > 99) {
1581 G4Exception(
"G4RadioactiveDecay::SetSourceTimeProfile()",
"HAD_RDM_002",
1585 SBin[NSourceBin] = bin * s;
1586 SProfile[NSourceBin] = flux;
1594 G4cout <<
" Source Timeprofile Nbin = " << NSourceBin <<
G4endl;
1608 std::ifstream infile(filename, std::ios::in);
1609 if (!infile)
G4Exception(
"G4RadioactiveDecay::SetDecayBias()",
"HAD_RDM_003",
1616 theRadioactivityTables.clear();
1621 while (infile >> bin >> flux ) {
1625 G4Exception(
"G4RadioactiveDecay::SetDecayBias()",
"HAD_RDM_100",
1630 if (NDecayBin > 99) {
1631 G4Exception(
"G4RadioactiveDecay::SetDecayBias()",
"HAD_RDM_004",
1634 DBin[NDecayBin] = bin * s;
1635 DProfile[NDecayBin] = flux;
1637 decayWindows[NDecayBin] = dWindows;
1640 theRadioactivityTables.push_back(rTable);
1644 for ( i = 1; i<= NDecayBin; i++) DProfile[i] += DProfile[i-1];
1645 for ( i = 0; i<= NDecayBin; i++) DProfile[i] /= DProfile[NDecayBin];
1653 G4cout <<
" Decay Bias Profile Nbin = " << NDecayBin <<
G4endl;
1668 fParticleChangeForRadDecay.
Initialize(theTrack);
1674 if (!isAllVolumesMode) {
1675 if (!std::binary_search(ValidVolumes.begin(), ValidVolumes.end(),
1679 G4cout <<
"G4RadioactiveDecay::DecayIt : "
1681 <<
" is not selected for the RDM"<<
G4endl;
1682 G4cout <<
" There are " << ValidVolumes.size() <<
" volumes" <<
G4endl;
1684 for (
size_t i = 0; i< ValidVolumes.size(); i++)
1694 return &fParticleChangeForRadDecay;
1703 G4cout <<
" G4RadioactiveDecay::DecayIt : "
1705 <<
" is not a valid nucleus for the RDM. "<<
G4endl;
1706 G4cout <<
" Set particle change accordingly. " <<
G4endl;
1715 return &fParticleChangeForRadDecay;
1719 if (theDecayTable == 0 || theDecayTable->
entries() == 0) {
1724 G4cout <<
" G4RadioactiveDecay::DecayIt : decay table not defined for ";
1726 G4cout <<
" Set particle change to indicate this. " <<
G4endl;
1735 return &fParticleChangeForRadDecay;
1757 if ( products->
entries() == 1) {
1762 return &fParticleChangeForRadDecay;
1786 if (temptime < 0.) temptime = 0.;
1787 finalGlobalTime += temptime;
1788 finalLocalTime += temptime;
1791 products->
Boost(ParentEnergy, ParentDirection);
1798 G4cout <<
"G4RadioactiveDecay::DecayIt : Decay vertex :";
1799 G4cout <<
" Time: " <<finalGlobalTime/
ns <<
"[ns]";
1804 G4cout <<
"G4Decay::DecayIt : decay products in Lab. Frame" <<
G4endl;
1809 for (index=0; index < numberOfSecondaries; index++) {
1811 finalGlobalTime, currentPosition);
1815 if (theRadDecayMode ==
IT && index>0){
1820 && index <numberOfSecondaries-1){
1834 G4cout <<
"DecayIt: Variance Reduction version " <<
G4endl;
1847 std::vector<G4double> PT;
1848 std::vector<G4double> PR;
1850 long double decayRate;
1854 G4int numberOfSecondaries;
1855 G4int totalNumberOfSecondaries = 0;
1859 std::vector<G4DynamicParticle*> secondaryparticles;
1860 std::vector<G4double> pw;
1861 std::vector<G4double> ptime;
1866 for (
G4int n = 0; n < NSplit; n++) {
1875 weight1 = 1./DProfile[nbin-1]
1876 *(DBin[nbin]-DBin[nbin-1])/NSplit;
1877 }
else if (nbin > 1) {
1878 weight1 = 1./(DProfile[nbin]-DProfile[nbin-2])
1879 *(DBin[nbin]-DBin[nbin-1])/NSplit;
1887 for (i = 0; i < theDecayRateVector.size(); i++) {
1888 PZ = theDecayRateVector[i].GetZ();
1889 PA = theDecayRateVector[i].GetA();
1890 PE = theDecayRateVector[i].GetE();
1891 PT = theDecayRateVector[i].GetTaos();
1892 PR = theDecayRateVector[i].GetDecayRateC();
1940 for (
G4int j = 0; j <
G4int(PT.size()); j++) {
1943 decayRate -= PR[j] * (
long double)tauprob;
1955 if (decayRate < 0.0) decayRate = 0.0;
1979 theRadioactivityTables[decayWindows[nbin-1]]
1980 ->AddIsotope(PZ,PA,PE,weight1*decayRate,theTrack.
GetWeight());
1989 parentNucleus = theIonTable->
GetIon(PZ,PA,PE);
2001 if (theDecayChannel == 0) {
2005 G4cout <<
" G4RadioactiveDecay::DoIt : cannot determine decay ";
2006 G4cout <<
" channel for this nucleus; decay as if no biasing active ";
2011 tempprods =
DoDecay(*parentNucleus);
2016 tempprods = theDecayChannel->
DecayIt(tempmass);
2017 weight *= (theDecayChannel->
GetBR())*(decayTable->
entries());
2020 tempprods =
DoDecay(*parentNucleus);
2024 numberOfSecondaries = tempprods->
entries();
2025 currentTime = finalGlobalTime + theDecayTime;
2026 for (index = 0; index < numberOfSecondaries; index++) {
2029 pw.push_back(weight);
2030 ptime.push_back(currentTime);
2031 secondaryparticles.push_back(asecondaryparticle);
2032 }
else if (((
const G4Ions*)(asecondaryparticle->
GetDefinition()))->GetExcitationEnergy() > 0.
2047 totalNumberOfSecondaries = pw.size();
2049 for (index=0; index < totalNumberOfSecondaries; index++) {
2051 ptime[index], currentPosition);
2071 return &fParticleChangeForRadDecay;
2088 if (theDecayChannel == 0) {
2092 G4Exception(
"G4RadioactiveDecay::DoDecay",
"HAD_RDM_013",
2098 G4cout <<
"G4RadioactiveDecay::DoIt : selected decay channel address:";
2102 theRadDecayMode = (
static_cast<G4NuclearDecay*
>(theDecayChannel))->GetDecayMode();
2116 if (origin == forceDecayDirection)
return;
2117 if (180.*deg == forceDecayHalfAngle)
return;
2118 if (0 == products || 0 == products->
entries())
return;
2138 if (daughterType == electron || daughterType == positron ||
2139 daughterType == neutron || daughterType == gamma ||
2140 daughterType == alpha || daughterType == triton || daughterType == proton)
CollimateDecayProduct(daughter);
2147 G4cout <<
"CollimateDecayProduct for daughter "
2160 if (origin == forceDecayDirection)
return origin;
2161 if (forceDecayHalfAngle == 180.*deg)
return origin;
2166 if (forceDecayHalfAngle > 0.) {
2169 G4double cosMin = std::cos(forceDecayHalfAngle);
2178 G4cout <<
" ChooseCollimationDirection returns " << dir <<
G4endl;
2188 std::vector<double>& weights_v,
2189 std::vector<double>& times_v,
2190 std::vector<G4DynamicParticle*>& secondaries_v)
2192 G4double elevel = ((
const G4Ions*)(apartDef))->GetExcitationEnergy();
2196 while (life_time < halflifethreshold && elevel > 0.) {
2197 anITChannel =
new G4ITDecay(apartDef, 100., elevel, elevel, photonEvaporation);
2203 for (
G4int ind = 0; ind < nb_pevapSecondaries; ind++) {
2204 a_pevap_secondary = pevap_products->
PopProducts();
2208 elevel = ((
const G4Ions*)(secDef))->GetExcitationEnergy();
2212 weights_v.push_back(weight);
2213 times_v.push_back(currentTime);
2214 secondaries_v.push_back(a_pevap_secondary);
2217 weights_v.push_back(weight);
2218 times_v.push_back(currentTime);
2219 secondaries_v.push_back(a_pevap_secondary);
double A(double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
std::map< G4String, G4DecayTable * > DecayTableMap
std::map< G4String, G4DecayTable * > DecayTableMap
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
static G4Alpha * Definition()
G4DynamicParticle * PopProducts()
void Boost(G4double totalEnergy, const G4ThreeVector &momentumDirection)
G4VDecayChannel * GetDecayChannel(G4int index) const
void Insert(G4VDecayChannel *aChannel)
G4VDecayChannel * SelectADecayChannel(G4double parentMass=-1.)
G4bool CorrelatedGamma() const
G4bool StoreICLevelData() const
G4double GetMaxLifeTime() const
G4bool GetInternalConversionFlag() const
void SetMomentumDirection(const G4ThreeVector &aDirection)
const G4ThreeVector & GetMomentumDirection() const
const G4ParticleDefinition * GetParticleDefinition() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetTotalMomentum() const
void SetARM(G4bool onoff)
static G4Electron * Definition()
static G4EmParameters * Instance()
G4bool BeardenFluoDir() const
G4bool AugerCascade() const
G4bool DeexcitationIgnoreCut() const
static G4Gamma * Definition()
static G4GenericIon * GenericIon()
static G4HadronicParameters * Instance()
void RegisterExtraProcess(G4VProcess *)
void RegisterParticleForExtraProcess(G4VProcess *, const G4ParticleDefinition *)
static G4HadronicProcessStore * Instance()
virtual G4DecayProducts * DecayIt(G4double)
void SetARM(G4bool onoff)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
static G4Ions::G4FloatLevelBase FloatLevelBase(char flbChar)
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
static G4LogicalVolumeStore * GetInstance()
const G4String & GetName() const
static G4Neutron * Definition()
void SetHLThreshold(G4double HLT)
G4double GetDaughterExcitation()
G4ParticleDefinition * GetDaughterNucleus()
G4RadioactiveDecayMode GetDecayMode()
G4DeexPrecoParameters * GetParameters()
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
const G4String & GetParticleType() const
G4double GetPDGMass() const
G4int GetBaryonNumber() const
G4double GetPDGLifeTime() const
const G4String & GetParticleName() const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
virtual void SetICM(G4bool)
virtual void RDMForced(G4bool)
static G4Positron * Definition()
static G4Proton * Definition()
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)
void DeselectAVolume(const G4String aVolume)
void SetSourceTimeProfile(G4String filename)
void BuildPhysicsTable(const G4ParticleDefinition &)
void SetDecayBias(G4String filename)
G4DecayTable * LoadDecayTable(const G4ParticleDefinition &theParentNucleus)
G4RadioactiveDecay(const G4String &processName="RadioactiveDecay")
G4double GetMeanLifeTime(const G4Track &theTrack, G4ForceCondition *condition)
G4DecayProducts * DoDecay(const G4ParticleDefinition &theParticleDef)
void CollimateDecayProduct(G4DynamicParticle *product)
G4DecayTable * GetDecayTable(const G4ParticleDefinition *)
void SelectAVolume(const G4String aVolume)
G4int GetVerboseLevel() const
G4double GetMeanFreePath(const G4Track &theTrack, G4double previousStepSize, G4ForceCondition *condition)
G4ThreeVector ChooseCollimationDirection() const
G4int GetDecayTimeBin(const G4double aDecayTime)
G4VParticleChange * DecayIt(const G4Track &theTrack, const G4Step &theStep)
void SetAnalogueMonteCarlo(G4bool r)
void SetDecayRate(G4int, G4int, G4double, G4int, std::vector< G4double >, std::vector< G4double >)
G4bool IsApplicable(const G4ParticleDefinition &)
void CalculateChainsFromParent(const G4ParticleDefinition &)
virtual void ProcessDescription(std::ostream &outFile) const
G4bool IsRateTableReady(const G4ParticleDefinition &)
void DeselectAllVolumes()
void AddUserDecayDataFile(G4int Z, G4int A, G4String filename)
G4double ConvolveSourceTimeProfile(const G4double, const G4double)
void AddDeexcitationSpectrumForBiasMode(G4ParticleDefinition *apartDef, G4double weight, G4double currenTime, std::vector< double > &weights_v, std::vector< double > ×_v, std::vector< G4DynamicParticle * > &secondaries_v)
void CollimateDecay(G4DecayProducts *products)
void GetChainsFromParent(const G4ParticleDefinition &)
G4String strip(G4int strip_Type=trailing, char c=' ')
G4TrackStatus GetTrackStatus() const
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 SetCreatorModelIndex(G4int idx)
void SetGoodForTrackingFlag(G4bool value=true)
static G4Triton * Definition()
void SetBR(G4double value)
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()
void SetProcessSubType(G4int)
G4VParticleChange * pParticleChange