Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // >> 27 // $Id: G4StatMFMicroCanonical.cc,v 1.7 2008/07/25 11:20:47 vnivanch Exp $ >> 28 // GEANT4 tag $Name: geant4-09-02 $ 27 // 29 // 28 // Hadronic Process: Nuclear De-excitations 30 // Hadronic Process: Nuclear De-excitations 29 // by V. Lara 31 // by V. Lara 30 32 31 #include <numeric> << 32 33 33 #include "G4StatMFMicroCanonical.hh" 34 #include "G4StatMFMicroCanonical.hh" 34 #include "G4PhysicalConstants.hh" << 35 #include "G4SystemOfUnits.hh" << 36 #include "G4HadronicException.hh" 35 #include "G4HadronicException.hh" 37 #include "G4Pow.hh" << 36 #include <numeric> >> 37 >> 38 >> 39 // Copy constructor >> 40 G4StatMFMicroCanonical::G4StatMFMicroCanonical(const G4StatMFMicroCanonical & >> 41 ) : G4VStatMFEnsemble() >> 42 { >> 43 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroCanonical::copy_constructor meant to not be accessable"); >> 44 } >> 45 >> 46 // Operators >> 47 >> 48 G4StatMFMicroCanonical & G4StatMFMicroCanonical:: >> 49 operator=(const G4StatMFMicroCanonical & ) >> 50 { >> 51 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroCanonical::operator= meant to not be accessable"); >> 52 return *this; >> 53 } >> 54 >> 55 >> 56 G4bool G4StatMFMicroCanonical::operator==(const G4StatMFMicroCanonical & ) const >> 57 { >> 58 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroCanonical::operator== meant to not be accessable"); >> 59 return false; >> 60 } >> 61 >> 62 >> 63 G4bool G4StatMFMicroCanonical::operator!=(const G4StatMFMicroCanonical & ) const >> 64 { >> 65 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroCanonical::operator!= meant to not be accessable"); >> 66 return true; >> 67 } >> 68 >> 69 38 70 39 // constructor 71 // constructor 40 G4StatMFMicroCanonical::G4StatMFMicroCanonical 72 G4StatMFMicroCanonical::G4StatMFMicroCanonical(G4Fragment const & theFragment) 41 { 73 { 42 // Perform class initialization << 74 // Perform class initialization 43 Initialize(theFragment); << 75 Initialize(theFragment); >> 76 44 } 77 } 45 78 >> 79 46 // destructor 80 // destructor 47 G4StatMFMicroCanonical::~G4StatMFMicroCanonica 81 G4StatMFMicroCanonical::~G4StatMFMicroCanonical() 48 { 82 { 49 // garbage collection 83 // garbage collection 50 if (!_ThePartitionManagerVector.empty()) { 84 if (!_ThePartitionManagerVector.empty()) { 51 std::for_each(_ThePartitionManagerVector.b 85 std::for_each(_ThePartitionManagerVector.begin(), 52 _ThePartitionManagerVector.end(), 86 _ThePartitionManagerVector.end(), 53 DeleteFragment()); 87 DeleteFragment()); 54 } 88 } 55 } 89 } 56 90 >> 91 >> 92 >> 93 // Initialization method >> 94 57 void G4StatMFMicroCanonical::Initialize(const 95 void G4StatMFMicroCanonical::Initialize(const G4Fragment & theFragment) 58 { 96 { 59 97 60 std::vector<G4StatMFMicroManager*>::iterator 98 std::vector<G4StatMFMicroManager*>::iterator it; 61 99 62 // Excitation Energy 100 // Excitation Energy 63 G4double U = theFragment.GetExcitationEnergy 101 G4double U = theFragment.GetExcitationEnergy(); 64 << 102 65 G4int A = theFragment.GetA_asInt(); << 103 G4double A = theFragment.GetA(); 66 G4int Z = theFragment.GetZ_asInt(); << 104 G4double Z = theFragment.GetZ(); 67 G4double x = 1.0 - 2.0*Z/G4double(A); << 105 68 G4Pow* g4calc = G4Pow::GetInstance(); << 69 << 70 // Configuration temperature 106 // Configuration temperature 71 G4double TConfiguration = std::sqrt(8.0*U/G4 << 107 G4double TConfiguration = std::sqrt(8.0*U/A); 72 108 73 // Free internal energy at Temperature T = 0 109 // Free internal energy at Temperature T = 0 74 __FreeInternalE0 = A*( 110 __FreeInternalE0 = A*( 75 // Volume term (for T = 0) 111 // Volume term (for T = 0) 76 -G4StatMFParameters::GetE0() + 112 -G4StatMFParameters::GetE0() + 77 // Symmetry term 113 // Symmetry term 78 G4StatMFParameters::GetGamma0()*x*x << 114 G4StatMFParameters::GetGamma0()*(1.0-2.0*Z/A)*(1.0-2.0*Z/A) 79 ) + 115 ) + 80 // Surface term (for T = 0) 116 // Surface term (for T = 0) 81 G4StatMFParameters::GetBeta0()*g4calc->Z23 << 117 G4StatMFParameters::GetBeta0()*std::pow(A,2.0/3.0) + 82 // Coulomb term 118 // Coulomb term 83 elm_coupling*0.6*Z*Z/(G4StatMFParameters:: << 119 elm_coupling*(3.0/5.0)*Z*Z/(G4StatMFParameters::Getr0()*std::pow(A,1.0/3.0)); 84 120 85 // Statistical weight 121 // Statistical weight 86 G4double W = 0.0; 122 G4double W = 0.0; 87 123 >> 124 88 // Mean breakup multiplicity 125 // Mean breakup multiplicity 89 __MeanMultiplicity = 0.0; 126 __MeanMultiplicity = 0.0; 90 127 91 // Mean channel temperature 128 // Mean channel temperature 92 __MeanTemperature = 0.0; 129 __MeanTemperature = 0.0; 93 130 94 // Mean channel entropy 131 // Mean channel entropy 95 __MeanEntropy = 0.0; 132 __MeanEntropy = 0.0; 96 133 97 // Calculate entropy of compound nucleus 134 // Calculate entropy of compound nucleus 98 G4double SCompoundNucleus = CalcEntropyOfCom 135 G4double SCompoundNucleus = CalcEntropyOfCompoundNucleus(theFragment,TConfiguration); 99 136 100 // Statistical weight of compound nucleus 137 // Statistical weight of compound nucleus 101 _WCompoundNucleus = 1.0; << 138 _WCompoundNucleus = 1.0; // std::exp(SCompoundNucleus - SCompoundNucleus); 102 139 103 W += _WCompoundNucleus; 140 W += _WCompoundNucleus; 104 << 141 >> 142 >> 143 105 // Maximal fragment multiplicity allowed in 144 // Maximal fragment multiplicity allowed in direct simulation 106 G4int MaxMult = G4StatMFMicroCanonical::MaxA 145 G4int MaxMult = G4StatMFMicroCanonical::MaxAllowedMultiplicity; 107 if (A > 110) MaxMult -= 1; 146 if (A > 110) MaxMult -= 1; 108 147 109 for (G4int im = 2; im <= MaxMult; im++) { << 148 >> 149 >> 150 for (G4int m = 2; m <= MaxMult; m++) { 110 G4StatMFMicroManager * aMicroManager = 151 G4StatMFMicroManager * aMicroManager = 111 new G4StatMFMicroManager(theFragment,im, << 152 new G4StatMFMicroManager(theFragment,m,__FreeInternalE0,SCompoundNucleus); 112 _ThePartitionManagerVector.push_back(aMicr 153 _ThePartitionManagerVector.push_back(aMicroManager); 113 } 154 } 114 155 115 // W is the total probability 156 // W is the total probability 116 W = std::accumulate(_ThePartitionManagerVect 157 W = std::accumulate(_ThePartitionManagerVector.begin(), 117 _ThePartitionManagerVector.end(), << 158 _ThePartitionManagerVector.end(), 118 W, [](const G4double& running_total, << 159 W,SumProbabilities()); 119 G4StatMFMicroManag << 120 { << 121 return running_total + manager- << 122 } ); << 123 160 124 // Normalization of statistical weights 161 // Normalization of statistical weights 125 for (it = _ThePartitionManagerVector.begin( 162 for (it = _ThePartitionManagerVector.begin(); it != _ThePartitionManagerVector.end(); ++it) 126 { 163 { 127 (*it)->Normalize(W); 164 (*it)->Normalize(W); 128 } 165 } 129 166 130 _WCompoundNucleus /= W; 167 _WCompoundNucleus /= W; 131 168 132 __MeanMultiplicity += 1.0 * _WCompoundNucleu 169 __MeanMultiplicity += 1.0 * _WCompoundNucleus; 133 __MeanTemperature += TConfiguration * _WComp 170 __MeanTemperature += TConfiguration * _WCompoundNucleus; 134 __MeanEntropy += SCompoundNucleus * _WCompou 171 __MeanEntropy += SCompoundNucleus * _WCompoundNucleus; 135 172 >> 173 136 for (it = _ThePartitionManagerVector.begin( 174 for (it = _ThePartitionManagerVector.begin(); it != _ThePartitionManagerVector.end(); ++it) 137 { 175 { 138 __MeanMultiplicity += (*it)->GetMeanMult 176 __MeanMultiplicity += (*it)->GetMeanMultiplicity(); 139 __MeanTemperature += (*it)->GetMeanTempe 177 __MeanTemperature += (*it)->GetMeanTemperature(); 140 __MeanEntropy += (*it)->GetMeanEntropy() 178 __MeanEntropy += (*it)->GetMeanEntropy(); 141 } 179 } 142 180 143 return; 181 return; 144 } 182 } 145 183 >> 184 >> 185 >> 186 >> 187 146 G4double G4StatMFMicroCanonical::CalcFreeInter 188 G4double G4StatMFMicroCanonical::CalcFreeInternalEnergy(const G4Fragment & theFragment, 147 G4double T) << 189 const G4double T) 148 { 190 { 149 G4int A = theFragment.GetA_asInt(); << 191 G4double A = theFragment.GetA(); 150 G4int Z = theFragment.GetZ_asInt(); << 192 G4double Z = theFragment.GetZ(); 151 G4double A13 = G4Pow::GetInstance()->Z13(A); << 193 G4double A13 = std::pow(A,1.0/3.0); 152 194 153 G4double InvLevelDensityPar = G4StatMFParame << 195 G4double InvLevelDensityPar = G4StatMFParameters::GetEpsilon0()*(1.0 + 3.0/(A-1.0)); 154 *(1.0 + 3.0/G4double(A-1)); << 155 196 156 G4double VolumeTerm = (-G4StatMFParameters:: 197 G4double VolumeTerm = (-G4StatMFParameters::GetE0()+T*T/InvLevelDensityPar)*A; 157 198 158 G4double SymmetryTerm = G4StatMFParameters:: << 199 G4double SymmetryTerm = G4StatMFParameters::GetGamma0()*(A - 2.0*Z)*(A - 2.0*Z)/A; 159 *(A - 2*Z)*(A - 2*Z)/G4double(A); << 160 200 161 G4double SurfaceTerm = (G4StatMFParameters:: << 201 G4double SurfaceTerm = (G4StatMFParameters::Beta(T)-T*G4StatMFParameters::DBetaDT(T))*A13*A13; 162 - T*G4StatMFParameters::DBetaDT(T))*A1 << 163 202 164 G4double CoulombTerm = elm_coupling*0.6*Z*Z/ << 203 G4double CoulombTerm = elm_coupling*(3.0/5.0)*Z*Z/(G4StatMFParameters::Getr0()*A13); 165 204 166 return VolumeTerm + SymmetryTerm + SurfaceTe 205 return VolumeTerm + SymmetryTerm + SurfaceTerm + CoulombTerm; 167 } 206 } 168 207 169 G4double << 208 170 G4StatMFMicroCanonical::CalcEntropyOfCompoundN << 209 171 G4double & TConf) << 210 G4double G4StatMFMicroCanonical::CalcEntropyOfCompoundNucleus(const G4Fragment & theFragment,G4double & TConf) 172 // Calculates Temperature and Entropy of com 211 // Calculates Temperature and Entropy of compound nucleus 173 { 212 { 174 G4int A = theFragment.GetA_asInt(); << 213 const G4double A = theFragment.GetA(); 175 G4double U = theFragment.GetExcitationEnergy << 214 // const G4double Z = theFragment.GetZ(); 176 G4double A13 = G4Pow::GetInstance()->Z13(A); << 215 const G4double U = theFragment.GetExcitationEnergy(); >> 216 const G4double A13 = std::pow(A,1.0/3.0); 177 217 178 G4double Ta = std::max(std::sqrt(U/(0.125*A) 218 G4double Ta = std::max(std::sqrt(U/(0.125*A)),0.0012*MeV); 179 G4double Tb = Ta; 219 G4double Tb = Ta; 180 220 181 G4double ECompoundNucleus = CalcFreeInternal 221 G4double ECompoundNucleus = CalcFreeInternalEnergy(theFragment,Ta); 182 G4double Da = (U+__FreeInternalE0-ECompoundN 222 G4double Da = (U+__FreeInternalE0-ECompoundNucleus)/U; 183 G4double Db = 0.0; 223 G4double Db = 0.0; 184 << 224 185 G4double InvLevelDensity = CalcInvLevelDensi << 225 >> 226 G4double InvLevelDensity = CalcInvLevelDensity(static_cast<G4int>(A)); >> 227 186 228 187 // bracketing the solution 229 // bracketing the solution 188 if (Da == 0.0) { 230 if (Da == 0.0) { 189 TConf = Ta; 231 TConf = Ta; 190 return 2*Ta*A/InvLevelDensity - G4StatMFPa 232 return 2*Ta*A/InvLevelDensity - G4StatMFParameters::DBetaDT(Ta)*A13*A13; 191 } else if (Da < 0.0) { 233 } else if (Da < 0.0) { 192 do { 234 do { 193 Tb -= 0.5*Tb; 235 Tb -= 0.5*Tb; 194 ECompoundNucleus = CalcFreeInternalEnerg 236 ECompoundNucleus = CalcFreeInternalEnergy(theFragment,Tb); 195 Db = (U+__FreeInternalE0-ECompoundNucleu 237 Db = (U+__FreeInternalE0-ECompoundNucleus)/U; 196 } while (Db < 0.0); 238 } while (Db < 0.0); 197 } else { 239 } else { 198 do { 240 do { 199 Tb += 0.5*Tb; 241 Tb += 0.5*Tb; 200 ECompoundNucleus = CalcFreeInternalEnerg 242 ECompoundNucleus = CalcFreeInternalEnergy(theFragment,Tb); 201 Db = (U+__FreeInternalE0-ECompoundNucleu 243 Db = (U+__FreeInternalE0-ECompoundNucleus)/U; 202 } while (Db > 0.0); 244 } while (Db > 0.0); 203 } 245 } 204 246 >> 247 205 G4double eps = 1.0e-14 * std::abs(Tb-Ta); 248 G4double eps = 1.0e-14 * std::abs(Tb-Ta); 206 249 207 for (G4int i = 0; i < 1000; i++) { 250 for (G4int i = 0; i < 1000; i++) { 208 G4double Tc = (Ta+Tb)*0.5; << 251 G4double Tc = (Ta+Tb)/2.0; 209 if (std::abs(Ta-Tb) <= eps) { 252 if (std::abs(Ta-Tb) <= eps) { 210 TConf = Tc; 253 TConf = Tc; 211 return 2*Tc*A/InvLevelDensity - G4StatMF 254 return 2*Tc*A/InvLevelDensity - G4StatMFParameters::DBetaDT(Tc)*A13*A13; 212 } 255 } 213 ECompoundNucleus = CalcFreeInternalEnergy( 256 ECompoundNucleus = CalcFreeInternalEnergy(theFragment,Tc); 214 G4double Dc = (U+__FreeInternalE0-ECompoun 257 G4double Dc = (U+__FreeInternalE0-ECompoundNucleus)/U; 215 258 216 if (Dc == 0.0) { 259 if (Dc == 0.0) { 217 TConf = Tc; 260 TConf = Tc; 218 return 2*Tc*A/InvLevelDensity - G4StatMF 261 return 2*Tc*A/InvLevelDensity - G4StatMFParameters::DBetaDT(Tc)*A13*A13; 219 } 262 } 220 263 221 if (Da*Dc < 0.0) { 264 if (Da*Dc < 0.0) { 222 Tb = Tc; 265 Tb = Tc; 223 Db = Dc; 266 Db = Dc; 224 } else { 267 } else { 225 Ta = Tc; 268 Ta = Tc; 226 Da = Dc; 269 Da = Dc; 227 } 270 } 228 } 271 } 229 272 230 G4cout << << 273 G4cerr << 231 "G4StatMFMicrocanoncal::CalcEntropyOfCompo 274 "G4StatMFMicrocanoncal::CalcEntropyOfCompoundNucleus: I can't calculate the temperature" 232 << G4endl; 275 << G4endl; 233 276 234 return 0.0; 277 return 0.0; 235 } 278 } 236 279 >> 280 >> 281 >> 282 237 G4StatMFChannel * G4StatMFMicroCanonical::Cho 283 G4StatMFChannel * G4StatMFMicroCanonical::ChooseAandZ(const G4Fragment & theFragment) 238 // Choice of fragment atomic numbers and cha 284 // Choice of fragment atomic numbers and charges 239 { 285 { 240 // We choose a multiplicity (1,2,3,...) and << 286 // We choose a multiplicity (1,2,3,...) and then a channel 241 G4double RandNumber = G4UniformRand(); << 287 G4double RandNumber = G4UniformRand(); 242 288 243 if (RandNumber < _WCompoundNucleus) { << 289 if (RandNumber < _WCompoundNucleus) { 244 290 245 G4StatMFChannel * aChannel = new G4StatMFC << 291 G4StatMFChannel * aChannel = new G4StatMFChannel; 246 aChannel->CreateFragment(theFragment.GetA_ << 292 aChannel->CreateFragment(theFragment.GetA(),theFragment.GetZ()); 247 return aChannel; << 293 return aChannel; 248 294 249 } else { << 295 } else { 250 296 251 G4double AccumWeight = _WCompoundNucleus; << 297 G4double AccumWeight = _WCompoundNucleus; 252 std::vector<G4StatMFMicroManager*>::iterat << 298 std::vector<G4StatMFMicroManager*>::iterator it; 253 for (it = _ThePartitionManagerVector.begin << 299 for (it = _ThePartitionManagerVector.begin(); it != _ThePartitionManagerVector.end(); ++it) { 254 AccumWeight += (*it)->GetProbability(); << 300 AccumWeight += (*it)->GetProbability(); 255 if (RandNumber < AccumWeight) { << 301 if (RandNumber < AccumWeight) { 256 return (*it)->ChooseChannel(theFragment.GetA << 302 return (*it)->ChooseChannel(theFragment.GetA(),theFragment.GetZ(),__MeanTemperature); 257 } << 303 } >> 304 } >> 305 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroCanonical::ChooseAandZ: wrong normalization!"); 258 } 306 } 259 throw G4HadronicException(__FILE__, __LINE << 260 } << 261 307 262 return 0; << 308 return 0; 263 } 309 } 264 310 265 G4double G4StatMFMicroCanonical::CalcInvLevelD << 311 >> 312 >> 313 >> 314 G4double G4StatMFMicroCanonical::CalcInvLevelDensity(const G4int anA) 266 { 315 { 267 G4double res = 0.0; << 316 // Calculate Inverse Density Level 268 if (anA > 1) { << 317 // Epsilon0*(1 + 3 /(Af - 1)) 269 res = G4StatMFParameters::GetEpsilon0()*(1 << 318 if (anA == 1) return 0.0; 270 } << 319 else return 271 return res; << 320 G4StatMFParameters::GetEpsilon0()*(1.0+3.0/(anA - 1.0)); 272 } 321 } 273 322