Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4StatMFMicroCanonical.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: G4StatMFMicroCanonical.cc 100379 2016-10-19 15:05:35Z gcosmo $
28 //
29 // Hadronic Process: Nuclear De-excitations
30 // by V. Lara
31 
32 #include <numeric>
33 
35 #include "G4PhysicalConstants.hh"
36 #include "G4SystemOfUnits.hh"
37 #include "G4HadronicException.hh"
38 #include "G4Pow.hh"
39 
40 // constructor
42 {
43  // Perform class initialization
44  Initialize(theFragment);
45 }
46 
47 // destructor
49 {
50  // garbage collection
51  if (!_ThePartitionManagerVector.empty()) {
52  std::for_each(_ThePartitionManagerVector.begin(),
53  _ThePartitionManagerVector.end(),
54  DeleteFragment());
55  }
56 }
57 
58 void G4StatMFMicroCanonical::Initialize(const G4Fragment & theFragment)
59 {
60 
61  std::vector<G4StatMFMicroManager*>::iterator it;
62 
63  // Excitation Energy
64  G4double U = theFragment.GetExcitationEnergy();
65 
66  G4int A = theFragment.GetA_asInt();
67  G4int Z = theFragment.GetZ_asInt();
68  G4double x = 1.0 - 2.0*Z/G4double(A);
69  G4Pow* g4calc = G4Pow::GetInstance();
70 
71  // Configuration temperature
72  G4double TConfiguration = std::sqrt(8.0*U/G4double(A));
73 
74  // Free internal energy at Temperature T = 0
75  __FreeInternalE0 = A*(
76  // Volume term (for T = 0)
78  // Symmetry term
80  ) +
81  // Surface term (for T = 0)
82  G4StatMFParameters::GetBeta0()*g4calc->Z23(A) +
83  // Coulomb term
84  elm_coupling*0.6*Z*Z/(G4StatMFParameters::Getr0()*g4calc->Z13(A));
85 
86  // Statistical weight
87  G4double W = 0.0;
88 
89  // Mean breakup multiplicity
90  __MeanMultiplicity = 0.0;
91 
92  // Mean channel temperature
93  __MeanTemperature = 0.0;
94 
95  // Mean channel entropy
96  __MeanEntropy = 0.0;
97 
98  // Calculate entropy of compound nucleus
99  G4double SCompoundNucleus = CalcEntropyOfCompoundNucleus(theFragment,TConfiguration);
100 
101  // Statistical weight of compound nucleus
102  _WCompoundNucleus = 1.0;
103 
104  W += _WCompoundNucleus;
105 
106  // Maximal fragment multiplicity allowed in direct simulation
108  if (A > 110) MaxMult -= 1;
109 
110  for (G4int im = 2; im <= MaxMult; im++) {
111  G4StatMFMicroManager * aMicroManager =
112  new G4StatMFMicroManager(theFragment,im,__FreeInternalE0,SCompoundNucleus);
113  _ThePartitionManagerVector.push_back(aMicroManager);
114  }
115 
116  // W is the total probability
117  W = std::accumulate(_ThePartitionManagerVector.begin(),
118  _ThePartitionManagerVector.end(),
119  W, SumProbabilities());
120 
121  // Normalization of statistical weights
122  for (it = _ThePartitionManagerVector.begin(); it != _ThePartitionManagerVector.end(); ++it)
123  {
124  (*it)->Normalize(W);
125  }
126 
127  _WCompoundNucleus /= W;
128 
129  __MeanMultiplicity += 1.0 * _WCompoundNucleus;
130  __MeanTemperature += TConfiguration * _WCompoundNucleus;
131  __MeanEntropy += SCompoundNucleus * _WCompoundNucleus;
132 
133  for (it = _ThePartitionManagerVector.begin(); it != _ThePartitionManagerVector.end(); ++it)
134  {
135  __MeanMultiplicity += (*it)->GetMeanMultiplicity();
136  __MeanTemperature += (*it)->GetMeanTemperature();
137  __MeanEntropy += (*it)->GetMeanEntropy();
138  }
139 
140  return;
141 }
142 
143 G4double G4StatMFMicroCanonical::CalcFreeInternalEnergy(const G4Fragment & theFragment,
144  G4double T)
145 {
146  G4int A = theFragment.GetA_asInt();
147  G4int Z = theFragment.GetZ_asInt();
149 
150  G4double InvLevelDensityPar = G4StatMFParameters::GetEpsilon0()
151  *(1.0 + 3.0/G4double(A-1));
152 
153  G4double VolumeTerm = (-G4StatMFParameters::GetE0()+T*T/InvLevelDensityPar)*A;
154 
155  G4double SymmetryTerm = G4StatMFParameters::GetGamma0()
156  *(A - 2*Z)*(A - 2*Z)/G4double(A);
157 
158  G4double SurfaceTerm = (G4StatMFParameters::Beta(T)
159  - T*G4StatMFParameters::DBetaDT(T))*A13*A13;
160 
161  G4double CoulombTerm = elm_coupling*0.6*Z*Z/(G4StatMFParameters::Getr0()*A13);
162 
163  return VolumeTerm + SymmetryTerm + SurfaceTerm + CoulombTerm;
164 }
165 
166 G4double
167 G4StatMFMicroCanonical::CalcEntropyOfCompoundNucleus(const G4Fragment & theFragment,
168  G4double & TConf)
169  // Calculates Temperature and Entropy of compound nucleus
170 {
171  G4int A = theFragment.GetA_asInt();
172  G4double U = theFragment.GetExcitationEnergy();
173  G4double A13 = G4Pow::GetInstance()->Z13(A);
174 
175  G4double Ta = std::max(std::sqrt(U/(0.125*A)),0.0012*MeV);
176  G4double Tb = Ta;
177 
178  G4double ECompoundNucleus = CalcFreeInternalEnergy(theFragment,Ta);
179  G4double Da = (U+__FreeInternalE0-ECompoundNucleus)/U;
180  G4double Db = 0.0;
181 
182  G4double InvLevelDensity = CalcInvLevelDensity(A);
183 
184  // bracketing the solution
185  if (Da == 0.0) {
186  TConf = Ta;
187  return 2*Ta*A/InvLevelDensity - G4StatMFParameters::DBetaDT(Ta)*A13*A13;
188  } else if (Da < 0.0) {
189  do {
190  Tb -= 0.5*Tb;
191  ECompoundNucleus = CalcFreeInternalEnergy(theFragment,Tb);
192  Db = (U+__FreeInternalE0-ECompoundNucleus)/U;
193  } while (Db < 0.0);
194  } else {
195  do {
196  Tb += 0.5*Tb;
197  ECompoundNucleus = CalcFreeInternalEnergy(theFragment,Tb);
198  Db = (U+__FreeInternalE0-ECompoundNucleus)/U;
199  } while (Db > 0.0);
200  }
201 
202  G4double eps = 1.0e-14 * std::abs(Tb-Ta);
203 
204  for (G4int i = 0; i < 1000; i++) {
205  G4double Tc = (Ta+Tb)*0.5;
206  if (std::abs(Ta-Tb) <= eps) {
207  TConf = Tc;
208  return 2*Tc*A/InvLevelDensity - G4StatMFParameters::DBetaDT(Tc)*A13*A13;
209  }
210  ECompoundNucleus = CalcFreeInternalEnergy(theFragment,Tc);
211  G4double Dc = (U+__FreeInternalE0-ECompoundNucleus)/U;
212 
213  if (Dc == 0.0) {
214  TConf = Tc;
215  return 2*Tc*A/InvLevelDensity - G4StatMFParameters::DBetaDT(Tc)*A13*A13;
216  }
217 
218  if (Da*Dc < 0.0) {
219  Tb = Tc;
220  Db = Dc;
221  } else {
222  Ta = Tc;
223  Da = Dc;
224  }
225  }
226 
227  G4cout <<
228  "G4StatMFMicrocanoncal::CalcEntropyOfCompoundNucleus: I can't calculate the temperature"
229  << G4endl;
230 
231  return 0.0;
232 }
233 
235  // Choice of fragment atomic numbers and charges
236 {
237  // We choose a multiplicity (1,2,3,...) and then a channel
238  G4double RandNumber = G4UniformRand();
239 
240  if (RandNumber < _WCompoundNucleus) {
241 
242  G4StatMFChannel * aChannel = new G4StatMFChannel;
243  aChannel->CreateFragment(theFragment.GetA_asInt(),theFragment.GetZ_asInt());
244  return aChannel;
245 
246  } else {
247 
248  G4double AccumWeight = _WCompoundNucleus;
249  std::vector<G4StatMFMicroManager*>::iterator it;
250  for (it = _ThePartitionManagerVector.begin(); it != _ThePartitionManagerVector.end(); ++it) {
251  AccumWeight += (*it)->GetProbability();
252  if (RandNumber < AccumWeight) {
253  return (*it)->ChooseChannel(theFragment.GetA_asInt(),theFragment.GetZ_asInt(),__MeanTemperature);
254  }
255  }
256  throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMicroCanonical::ChooseAandZ: wrong normalization!");
257  }
258 
259  return 0;
260 }
261 
262 G4double G4StatMFMicroCanonical::CalcInvLevelDensity(G4int anA)
263 {
264  G4double res = 0.0;
265  if (anA > 1) {
266  res = G4StatMFParameters::GetEpsilon0()*(1.0+3.0/(anA - 1.0));
267  }
268  return res;
269 }
static G4double GetGamma0()
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4StatMFChannel * ChooseAandZ(const G4Fragment &theFragment)
G4StatMFMicroCanonical(const G4Fragment &theFragment)
#define A13
Definition: G4Pow.hh:56
tuple elm_coupling
Definition: hepunit.py:286
static const G4double eps
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
static G4double Getr0()
void CreateFragment(G4int A, G4int Z)
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
G4double Z13(G4int Z) const
Definition: G4Pow.hh:127
double A(double temperature)
G4int GetA_asInt() const
Definition: G4Fragment.hh:266
static G4double GetE0()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static G4double DBetaDT(G4double T)
G4int GetZ_asInt() const
Definition: G4Fragment.hh:271
G4double Z23(G4int Z) const
Definition: G4Pow.hh:154
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
static G4double GetEpsilon0()
static G4double GetBeta0()
double G4double
Definition: G4Types.hh:76
static G4double Beta(G4double T)
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:283