00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #include <fstream>
00058 #include <sstream>
00059
00060 #include "G4DiscreteGammaDeexcitation.hh"
00061 #include "G4DiscreteGammaTransition.hh"
00062 #include "G4NuclearLevelManager.hh"
00063 #include "G4NuclearLevelStore.hh"
00064 #include "G4SystemOfUnits.hh"
00065 #include "G4ios.hh"
00066
00067 G4DiscreteGammaDeexcitation::G4DiscreteGammaDeexcitation():
00068 _nucleusZ(0), _nucleusA(0), _max_hl(1e-6*second), _icm(false),
00069 _rdm(false), _levelManager(0)
00070 {
00071 _tolerance = CLHEP::keV;
00072 }
00073
00074 G4DiscreteGammaDeexcitation::~G4DiscreteGammaDeexcitation()
00075 {}
00076
00077 G4VGammaTransition* G4DiscreteGammaDeexcitation::CreateTransition()
00078 {
00079 G4Fragment* nucleus = GetNucleus();
00080 G4int A = nucleus->GetA_asInt();
00081 G4int Z = nucleus->GetZ_asInt();
00082
00083
00084 if (_nucleusA != A || _nucleusZ != Z)
00085 {
00086 _nucleusA = A;
00087 _nucleusZ = Z;
00088 _levelManager = G4NuclearLevelStore::GetInstance()->GetManager(Z,A);
00089 }
00090
00091 if (_levelManager->IsValid())
00092 {
00093 if (_verbose > 1)
00094 {
00095 G4cout
00096 << "G4DiscreteGammaDeexcitation::CreateTransition - (A,Z) is valid "
00097 << G4endl;
00098 }
00099
00100 G4double excitation = nucleus->GetExcitationEnergy();
00101 const G4NuclearLevel* level =_levelManager->NearestLevel(excitation);
00102
00103 if (level != 0)
00104 {
00105 if (_verbose > 0) {
00106 G4cout
00107 << "G4DiscreteGammaDeexcitation::CreateTransition - Created from level energy "
00108 << level->Energy() << ", excitation is "
00109 << excitation << G4endl;
00110 }
00111 G4DiscreteGammaTransition* dtransit = new G4DiscreteGammaTransition(*level,Z,A);
00112 dtransit->SetICM(_icm);
00113 return dtransit;
00114 }
00115 else
00116 {
00117 if (_verbose > 0) {
00118 G4cout
00119 << "G4DiscreteGammaDeexcitation::CreateTransition - No transition created from "
00120 << excitation << " within tolerance " << _tolerance << G4endl;
00121 }
00122 return 0;
00123 }
00124 }
00125 return 0;
00126 }
00127
00128
00129 G4bool G4DiscreteGammaDeexcitation::CanDoTransition()
00130 {
00131
00132 G4bool canDo = true;
00133
00134 if (_transition == 0) {
00135 canDo = false;
00136
00137 if (_verbose > 0)
00138 G4cout
00139 << "G4DiscreteGammaDeexcitation::CanDoTransition - Null transition "
00140 << G4endl;
00141 }
00142 if (canDo) {
00143
00144
00145 if (_nucleusZ<2 || _nucleusA<3 )
00146 {
00147 canDo = false;
00148 if (_verbose > 0)
00149 G4cout
00150 << "G4DiscreteGammaDeexcitation::CanDoTransition - n/p/H/>Cf"
00151 << G4endl;
00152 }
00153 }
00154
00155 G4Fragment* nucleus = GetNucleus();
00156 G4double excitation = nucleus->GetExcitationEnergy();
00157
00158
00159 if (canDo) {
00160 if (excitation <= _tolerance) {
00161 canDo = false;
00162 if (_verbose > 0) {
00163 G4cout
00164 << "G4DiscreteGammaDeexcitation::CanDoTransition - Excitation <= 0"
00165 << excitation << " " << excitation - _tolerance
00166 << G4endl;
00167 }
00168 } else {
00169 if (excitation > _levelManager->MaxLevelEnergy() + _tolerance) { canDo = false; }
00170
00171
00172
00173
00174
00175 if (_verbose > 0) {
00176 G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition - Excitation "
00177 << excitation << ", Min-Max are "
00178 << _levelManager->MinLevelEnergy() << " "
00179 << _levelManager->MaxLevelEnergy() << G4endl;
00180 }
00181 }
00182 }
00183
00184 if (canDo) {
00185 const G4NuclearLevel* level = _levelManager->NearestLevel(excitation);
00186 if (!level) {
00187 canDo = false;
00188
00189 } else {
00190 if (level->HalfLife() > _max_hl && !_rdm ) { canDo = false; }
00191
00192 if (_verbose > 0) {
00193 G4cout << "G4DiscreteGammaDeexcitation::CanDoTransition - Halflife "
00194 << level->HalfLife() << ", Calling from RDM "
00195 << (_rdm ? " True " : " False ") << ", Max-HL = " << _max_hl
00196 << G4endl;
00197 }
00198 }
00199 }
00200 if (_verbose > 0) {
00201 G4cout <<"G4DiscreteGammaDeexcitation::CanDoTransition - CanDo: "
00202 << (canDo ? " True " : " False ") << G4endl;
00203 }
00204
00205 return canDo;
00206
00207 }
00208