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