00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // $Id$ 00027 // 00028 // ------------------------------------------------------------------- 00029 // GEANT 4 class file 00030 // 00031 // CERN, Geneva, Switzerland 00032 // 00033 // File name: G4DiscreteGammaTransition 00034 // 00035 // Author: Maria Grazia Pia (pia@genova.infn.it) 00036 // 00037 // Creation date: 23 October 1998 00038 // 00039 // Modifications: 00040 // 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it) 00041 // Added creation time evaluation for products of evaporation 00042 // 00043 // 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com) 00044 // i) added G4int _nucleusZ initialise it through the constructor 00045 // ii) modified SelectGamma() to allow the generation of conversion electrons 00046 // iii) added #include G4AtomicShells.hh 00047 // 00048 // 09 Sep. 2002, Fan Lei (flei@space.qinetiq.com) 00049 // Added renormalization to determine whether transition leads to 00050 // electron or gamma in SelectGamma() 00051 // 00052 // 19 April 2010, J. M. Quesada. 00053 // Corrections added for taking into account mismatch between tabulated 00054 // gamma energies and level energy differences (fake photons eliminated) 00055 // 00056 // 9 May 2010, V.Ivanchenko 00057 // Removed unphysical corretions of gamma energy; fixed default particle 00058 // as gamma; do not subtract bounding energy in case of electron emmision 00059 // 00060 // 03 November 2011, L. Desorgher 00061 // Extend the use of the code for Z>100 by not calling G4AtomicShells::GetBindingEnergy for Z>100 00062 // For Z>100 the binding energy is set to 0, the atomic relaxation is not simulated in G4RadDecay 00063 // 00064 // ------------------------------------------------------------------- 00065 00066 #include "G4DiscreteGammaTransition.hh" 00067 #include "G4SystemOfUnits.hh" 00068 #include "Randomize.hh" 00069 #include "G4RandGeneralTmp.hh" 00070 #include "G4AtomicShells.hh" 00071 #include "G4NuclearLevel.hh" 00072 #include "G4NuclearLevelStore.hh" 00073 #include "G4Pow.hh" 00074 00075 G4DiscreteGammaTransition::G4DiscreteGammaTransition(const G4NuclearLevel& level, G4int Z, G4int A): 00076 _nucleusZ(Z), _orbitE(-1), _bondE(0.), _aGamma(true), _icm(false), _gammaEnergy(0.), 00077 _level(level), _excitation(0.), _gammaCreationTime(0.),_A(A),_Z(Z) 00078 { 00079 _levelManager = 0; 00080 _verbose = 0; 00081 //JMQ: added tolerence in the mismatch 00082 //VI: increased tolerence 00083 _tolerance = 10*CLHEP::keV; 00084 } 00085 00086 G4DiscreteGammaTransition::~G4DiscreteGammaTransition() 00087 {} 00088 00089 void G4DiscreteGammaTransition::SelectGamma() 00090 { 00091 // default gamma 00092 _aGamma = true; 00093 _gammaEnergy = 0.; 00094 00095 G4int nGammas = _level.NumberOfGammas(); 00096 if (nGammas > 0) 00097 { 00098 G4int iGamma = 0; 00099 if(1 < nGammas) { 00100 G4double random = G4UniformRand(); 00101 00102 //G4cout << "G4DiscreteGammaTransition::SelectGamma N= " 00103 // << nGammas << " rand= " << random << G4endl; 00104 for(iGamma=0; iGamma<nGammas; ++iGamma) 00105 { 00106 //G4cout << iGamma << " prob= " 00107 // << (_level.GammaCumulativeProbabilities())[iGamma] << G4endl; 00108 if(random <= (_level.GammaCumulativeProbabilities())[iGamma]) 00109 { break; } 00110 } 00111 } 00112 /* 00113 G4cout << "Elevel(MeV)= " << _level.Energy()/MeV 00114 << " Etran(MeV)= " << (_level.GammaEnergies())[iGamma]/MeV 00115 << " Eexc(MeV)= " << _excitation/MeV << G4endl; 00116 */ 00117 00118 // VI: do not apply correction here in order do not make 00119 // double correction 00120 //G4double eCorrection = _level.Energy() - _excitation; 00121 //_gammaEnergy = (_level.GammaEnergies())[iGamma] - eCorrection; 00122 _gammaEnergy = (_level.GammaEnergies())[iGamma]; 00123 00124 //JMQ: 00125 //1)If chosen gamma energy is close enough to excitation energy, 00126 // the later is used instead for gamma dacey to gs (it guarantees 00127 // energy conservation) 00128 //2)For energy conservation, level energy differences instead of 00129 // tabulated gamma energies must be used (origin of final fake photons) 00130 00131 // VI: remove fake photons - applied only for the last transition 00132 // do not applied on each transition 00133 if(std::fabs(_excitation - _gammaEnergy) < _tolerance) { 00134 _gammaEnergy =_excitation; 00135 } 00136 00137 // JMQ: Warning: the following check is needed to avoid loops: 00138 // Due essentially to missing nuclear levels in data files, it is 00139 // possible that _gammaEnergy is so low as the nucleus doesn't change 00140 // its level after the transition. 00141 // When such case is found, force the full deexcitation of the nucleus. 00142 // 00143 // NOTE: you should force the transition to the next lower level, 00144 // but this change needs a more complex revision of actual 00145 // design. 00146 // I leave this for a later revision. 00147 00148 // VI: the check has no sence and we make this very simple 00149 if (_gammaEnergy < _tolerance) { 00150 _gammaEnergy = _excitation; 00151 } 00152 00153 //G4cout << "G4DiscreteGammaTransition::SelectGamma: " << _gammaEnergy 00154 // << " _icm: " << _icm << G4endl; 00155 00156 // now decide whether Internal Coversion electron should be emitted instead 00157 if (_icm) { 00158 G4double random = G4UniformRand(); 00159 if ( random <= (_level.TotalConvertionProbabilities())[iGamma] 00160 *(_level.GammaWeights())[iGamma] 00161 /((_level.TotalConvertionProbabilities())[iGamma]*(_level.GammaWeights())[iGamma] 00162 +(_level.GammaWeights())[iGamma])) 00163 { 00164 G4int iShell = 9; 00165 random = G4UniformRand() ; 00166 if ( random <= (_level.KConvertionProbabilities())[iGamma]) 00167 { iShell = 0;} 00168 else if ( random <= (_level.L1ConvertionProbabilities())[iGamma]) 00169 { iShell = 1;} 00170 else if ( random <= (_level.L2ConvertionProbabilities())[iGamma]) 00171 { iShell = 2;} 00172 else if ( random <= (_level.L3ConvertionProbabilities())[iGamma]) 00173 { iShell = 3;} 00174 else if ( random <= (_level.M1ConvertionProbabilities())[iGamma]) 00175 { iShell = 4;} 00176 else if ( random <= (_level.M2ConvertionProbabilities())[iGamma]) 00177 { iShell = 5;} 00178 else if ( random <= (_level.M3ConvertionProbabilities())[iGamma]) 00179 { iShell = 6;} 00180 else if ( random <= (_level.M4ConvertionProbabilities())[iGamma]) 00181 { iShell = 7;} 00182 else if ( random <= (_level.M5ConvertionProbabilities())[iGamma]) 00183 { iShell = 8;} 00184 // the following is needed to match the ishell to that used in G4AtomicShells 00185 if ( iShell == 9) { 00186 if ( (_nucleusZ < 28) && (_nucleusZ > 20)) { 00187 iShell--; 00188 } else if ( _nucleusZ == 20 || _nucleusZ == 19 ) { 00189 iShell = iShell -2; 00190 } 00191 } 00192 //L.Desorgher 02/11/2011 00193 //Atomic shell information is available in Geant4 only up top Z=100 00194 //To extend the photo evaporation code to Z>100 the call 00195 // to G4AtomicShells::GetBindingEnergy should be forbidden for Z>100 00196 _bondE = 0.; 00197 if (_nucleusZ <=100) 00198 _bondE = G4AtomicShells::GetBindingEnergy(_nucleusZ, iShell); 00199 if (_verbose > 0) { 00200 G4cout << "G4DiscreteGammaTransition: _nucleusZ = " <<_nucleusZ 00201 << " , iShell = " << iShell 00202 << " , Shell binding energy = " << _bondE/keV 00203 << " keV " << G4endl; 00204 } 00205 00206 // 09.05.2010 VI : it is an error - cannot subtract bond energy from 00207 // transition energy here 00208 //_gammaEnergy = _gammaEnergy - _bondE; 00209 //G4cout << "_gammaEnergy = " << _gammaEnergy << G4endl; 00210 00211 _orbitE = iShell; 00212 _aGamma = false ; // emitted is not a gamma now 00213 } 00214 } 00215 00216 G4double tau = _level.HalfLife() / G4Pow::GetInstance()->logZ(2); 00217 00218 //09.05.2010 VI rewrite samling of decay time 00219 // assuming ordinary exponential low 00220 _gammaCreationTime = 0.; 00221 if(tau > 0.0) { _gammaCreationTime = -tau*std::log(G4UniformRand()); } 00222 00223 } 00224 return; 00225 } 00226 00227 G4double G4DiscreteGammaTransition::GetGammaEnergy() 00228 { 00229 return _gammaEnergy; 00230 } 00231 00232 G4double G4DiscreteGammaTransition::GetGammaCreationTime() 00233 { 00234 return _gammaCreationTime; 00235 } 00236 00237 void G4DiscreteGammaTransition::SetEnergyFrom(G4double energy) 00238 { 00239 _excitation = energy; 00240 } 00241 00242 00243 00244 00245 00246