Geant4_10
G4StatMFMicroPartition.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4StatMFMicroPartition.cc 67983 2013-03-13 10:42:03Z gcosmo $
28 //
29 // by V. Lara
30 // --------------------------------------------------------------------
31 
33 #include "G4PhysicalConstants.hh"
34 #include "G4SystemOfUnits.hh"
35 #include "G4HadronicException.hh"
36 
37 // Copy constructor
39 {
40  throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroPartition::copy_constructor meant to not be accessable");
41 }
42 
43 // Operators
44 
45 G4StatMFMicroPartition & G4StatMFMicroPartition::
46 operator=(const G4StatMFMicroPartition & )
47 {
48  throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroPartition::operator= meant to not be accessable");
49  return *this;
50 }
51 
52 
54 {
55  //throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroPartition::operator== meant to not be accessable");
56  return false;
57 }
58 
59 
61 {
62  //throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroPartition::operator!= meant to not be accessable");
63  return true;
64 }
65 
66 void G4StatMFMicroPartition::CoulombFreeEnergy(G4int anA)
67 {
68  // This Z independent factor in the Coulomb free energy
69  G4double CoulombConstFactor = 1.0/std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0);
70 
71  CoulombConstFactor = elm_coupling * (3./5.) *
72  (1. - CoulombConstFactor)/G4StatMFParameters::Getr0();
73 
74  // We use the aproximation Z_f ~ Z/A * A_f
75 
76  G4double ZA = G4double(theZ)/G4double(theA);
77 
78  if (anA == 0 || anA == 1)
79  {
80  _theCoulombFreeEnergy.push_back(CoulombConstFactor*ZA*ZA);
81  }
82  else if (anA == 2 || anA == 3 || anA == 4)
83  {
84  // Z/A ~ 1/2
85  _theCoulombFreeEnergy.push_back(CoulombConstFactor*0.5*std::pow(anA,5./3.));
86  }
87  else // anA > 4
88  {
89  _theCoulombFreeEnergy.push_back(CoulombConstFactor*ZA*ZA*std::pow(anA,5./3.));
90  }
91 }
92 
93 G4double G4StatMFMicroPartition::GetCoulombEnergy(void)
94 {
95  G4double CoulombFactor = 1.0/
96  std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0);
97 
98  G4double CoulombEnergy = elm_coupling*(3./5.)*theZ*theZ*CoulombFactor/
99  (G4StatMFParameters::Getr0()*std::pow(static_cast<G4double>(theA),1./3.));
100 
101  G4double ZA = G4double(theZ)/G4double(theA);
102  for (unsigned int i = 0; i < _thePartition.size(); i++)
103  CoulombEnergy += _theCoulombFreeEnergy[i] - elm_coupling*(3./5.)*
104  ZA*ZA*std::pow(static_cast<G4double>(_thePartition[i]),5./3.)/
106 
107  return CoulombEnergy;
108 }
109 
110 G4double G4StatMFMicroPartition::GetPartitionEnergy(G4double T)
111 {
112  G4double CoulombFactor = 1.0/
113  std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0);
114 
115  G4double PartitionEnergy = 0.0;
116 
117  // We use the aprox that Z_f ~ Z/A * A_f
118  for (unsigned int i = 0; i < _thePartition.size(); i++)
119  {
120  if (_thePartition[i] == 0 || _thePartition[i] == 1)
121  {
122  PartitionEnergy += _theCoulombFreeEnergy[i];
123  }
124  else if (_thePartition[i] == 2)
125  {
126  PartitionEnergy +=
127  -2.796 // Binding Energy of deuteron ??????
128  + _theCoulombFreeEnergy[i];
129  }
130  else if (_thePartition[i] == 3)
131  {
132  PartitionEnergy +=
133  -9.224 // Binding Energy of trtion/He3 ??????
134  + _theCoulombFreeEnergy[i];
135  }
136  else if (_thePartition[i] == 4)
137  {
138  PartitionEnergy +=
139  -30.11 // Binding Energy of ALPHA ??????
140  + _theCoulombFreeEnergy[i]
141  + 4.*T*T/InvLevelDensity(4.);
142  }
143  else
144  {
145  PartitionEnergy +=
146  //Volume term
148  T*T/InvLevelDensity(_thePartition[i]))
149  *_thePartition[i] +
150 
151  // Symmetry term
153  (1.0-2.0*theZ/theA)*(1.0-2.0*theZ/theA)*_thePartition[i] +
154 
155  // Surface term
157  std::pow(static_cast<G4double>(_thePartition[i]),2./3.) +
158 
159  // Coulomb term
160  _theCoulombFreeEnergy[i];
161  }
162  }
163 
164  PartitionEnergy += elm_coupling*(3./5.)*theZ*theZ*CoulombFactor/
165  (G4StatMFParameters::Getr0()*std::pow(static_cast<G4double>(theA),1./3.))
166  + (3./2.)*T*(_thePartition.size()-1);
167 
168  return PartitionEnergy;
169 }
170 
171 G4double G4StatMFMicroPartition::CalcPartitionTemperature(G4double U,
172  G4double FreeInternalE0)
173 {
174  G4double PartitionEnergy = GetPartitionEnergy(0.0);
175 
176  // If this happens, T = 0 MeV, which means that probability for this
177  // partition will be 0
178  if (std::fabs(U + FreeInternalE0 - PartitionEnergy) < 0.003) return -1.0;
179 
180  // Calculate temperature by midpoint method
181 
182  // Bracketing the solution
183  G4double Ta = 0.001;
184  G4double Tb = std::max(std::sqrt(8.0*U/theA),0.0012*MeV);
185  G4double Tmid = 0.0;
186 
187  G4double Da = (U + FreeInternalE0 - GetPartitionEnergy(Ta))/U;
188  G4double Db = (U + FreeInternalE0 - GetPartitionEnergy(Tb))/U;
189 
190  G4int maxit = 0;
191  while (Da*Db > 0.0 && maxit < 1000)
192  {
193  ++maxit;
194  Tb += 0.5*Tb;
195  Db = (U + FreeInternalE0 - GetPartitionEnergy(Tb))/U;
196  }
197 
198  G4double eps = 1.0e-14*std::abs(Ta-Tb);
199 
200  for (G4int i = 0; i < 1000; i++)
201  {
202  Tmid = (Ta+Tb)/2.0;
203  if (std::fabs(Ta-Tb) <= eps) return Tmid;
204  G4double Dmid = (U + FreeInternalE0 - GetPartitionEnergy(Tmid))/U;
205  if (std::fabs(Dmid) < 0.003) return Tmid;
206  if (Da*Dmid < 0.0)
207  {
208  Tb = Tmid;
209  Db = Dmid;
210  }
211  else
212  {
213  Ta = Tmid;
214  Da = Dmid;
215  }
216  }
217  // if we arrive here the temperature could not be calculated
218  G4cerr << "G4StatMFMicroPartition::CalcPartitionTemperature: I can't calculate the temperature"
219  << G4endl;
220  // and set probability to 0 returning T < 0
221  return -1.0;
222 
223 }
224 
226  G4double FreeInternalE0,
227  G4double SCompound)
228 {
229  G4double T = CalcPartitionTemperature(U,FreeInternalE0);
230  if ( T <= 0.0) return _Probability = 0.0;
231  _Temperature = T;
232 
233 
234  // Factorial of fragment multiplicity
235  G4double Fact = 1.0;
236  unsigned int i;
237  for (i = 0; i < _thePartition.size() - 1; i++)
238  {
239  G4double f = 1.0;
240  for (unsigned int ii = i+1; i< _thePartition.size(); i++)
241  {
242  if (_thePartition[i] == _thePartition[ii]) f++;
243  }
244  Fact *= f;
245  }
246 
247  G4double ProbDegeneracy = 1.0;
248  G4double ProbA32 = 1.0;
249 
250  for (i = 0; i < _thePartition.size(); i++)
251  {
252  ProbDegeneracy *= GetDegeneracyFactor(static_cast<G4int>(_thePartition[i]));
253  ProbA32 *= static_cast<G4double>(_thePartition[i])*
254  std::sqrt(static_cast<G4double>(_thePartition[i]));
255  }
256 
257  // Compute entropy
258  G4double PartitionEntropy = 0.0;
259  for (i = 0; i < _thePartition.size(); i++)
260  {
261  // interaction entropy for alpha
262  if (_thePartition[i] == 4)
263  {
264  PartitionEntropy +=
265  2.0*T*_thePartition[i]/InvLevelDensity(_thePartition[i]);
266  }
267  // interaction entropy for Af > 4
268  else if (_thePartition[i] > 4)
269  {
270  PartitionEntropy +=
271  2.0*T*_thePartition[i]/InvLevelDensity(_thePartition[i])
273  * std::pow(static_cast<G4double>(_thePartition[i]),2.0/3.0);
274  }
275  }
276 
277  // Thermal Wave Lenght = std::sqrt(2 pi hbar^2 / nucleon_mass T)
278  G4double ThermalWaveLenght3 = 16.15*fermi/std::sqrt(T);
279  ThermalWaveLenght3 = ThermalWaveLenght3*ThermalWaveLenght3*ThermalWaveLenght3;
280 
281  // Translational Entropy
282  G4double kappa = (1. + elm_coupling*(std::pow(static_cast<G4double>(_thePartition.size()),1./3.)-1.0)
283  /(G4StatMFParameters::Getr0()*std::pow(static_cast<G4double>(theA),1./3.)));
284  kappa = kappa*kappa*kappa;
285  kappa -= 1.;
288  G4double FreeVolume = kappa*V0;
289  G4double TranslationalS = std::max(0.0, std::log(ProbA32/Fact) +
290  (_thePartition.size()-1.0)*std::log(FreeVolume/ThermalWaveLenght3) +
291  1.5*(_thePartition.size()-1.0) - (3./2.)*std::log(G4double(theA)));
292 
293  PartitionEntropy += std::log(ProbDegeneracy) + TranslationalS;
294  _Entropy = PartitionEntropy;
295 
296  // And finally compute probability of fragment configuration
297  G4double exponent = PartitionEntropy-SCompound;
298  if (exponent > 700.0) exponent = 700.0;
299  return _Probability = std::exp(exponent);
300 }
301 
302 G4double G4StatMFMicroPartition::GetDegeneracyFactor(G4int A)
303 {
304  // Degeneracy factors are statistical factors
305  // DegeneracyFactor for nucleon is (2S_n + 1)(2I_n + 1) = 4
306  G4double DegFactor = 0;
307  if (A > 4) DegFactor = 1.0;
308  else if (A == 1) DegFactor = 4.0; // nucleon
309  else if (A == 2) DegFactor = 3.0; // Deuteron
310  else if (A == 3) DegFactor = 4.0; // Triton + He3
311  else if (A == 4) DegFactor = 1.0; // alpha
312  return DegFactor;
313 }
314 
316 // Gives fragments charges
317 {
318  std::vector<G4int> FragmentsZ;
319 
320  G4int ZBalance = 0;
321  do
322  {
324  G4int SumZ = 0;
325  for (unsigned int i = 0; i < _thePartition.size(); i++)
326  {
327  G4double ZMean;
328  G4double Af = _thePartition[i];
329  if (Af > 1.5 && Af < 4.5) ZMean = 0.5*Af;
330  else ZMean = Af*Z0/A0;
331  G4double ZDispersion = std::sqrt(Af * MeanT/CC);
332  G4int Zf;
333  do
334  {
335  Zf = static_cast<G4int>(G4RandGauss::shoot(ZMean,ZDispersion));
336  }
337  while (Zf < 0 || Zf > Af);
338  FragmentsZ.push_back(Zf);
339  SumZ += Zf;
340  }
341  ZBalance = Z0 - SumZ;
342  }
343  while (std::abs(ZBalance) > 1);
344  FragmentsZ[0] += ZBalance;
345 
346  G4StatMFChannel * theChannel = new G4StatMFChannel;
347  for (unsigned int i = 0; i < _thePartition.size(); i++)
348  {
349  theChannel->CreateFragment(_thePartition[i],FragmentsZ[i]);
350  }
351 
352  return theChannel;
353 }
static G4double GetGamma0()
G4bool operator!=(const G4StatMFMicroPartition &right) const
ThreeVector shoot(const G4int Ap, const G4int Af)
static G4double GetKappaCoulomb()
tuple elm_coupling
Definition: hepunit.py:286
G4bool operator==(const G4StatMFMicroPartition &right) const
int G4int
Definition: G4Types.hh:78
TFile f
Definition: plotHisto.C:6
static G4double Getr0()
void CreateFragment(G4int A, G4int Z)
G4StatMFChannel * ChooseZ(G4int A0, G4int Z0, G4double MeanT)
G4StatMFMicroPartition(G4int A, G4int Z)
bool G4bool
Definition: G4Types.hh:79
static G4double GetE0()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double CalcPartitionProbability(G4double U, G4double FreeInternalE0, G4double SCompound)
static G4double DBetaDT(G4double T)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static G4double Beta(G4double T)
G4GLOB_DLL std::ostream G4cerr