Geant4  10.02.p03
G4StatMFMacroCanonical Class Reference

#include <G4StatMFMacroCanonical.hh>

Inheritance diagram for G4StatMFMacroCanonical:
Collaboration diagram for G4StatMFMacroCanonical:

Classes

struct  DeleteFragment
 

Public Member Functions

 G4StatMFMacroCanonical (G4Fragment const &theFragment)
 
 ~G4StatMFMacroCanonical ()
 
G4StatMFChannelChooseAandZ (const G4Fragment &theFragment)
 
- Public Member Functions inherited from G4VStatMFEnsemble
 G4VStatMFEnsemble ()
 
virtual ~G4VStatMFEnsemble ()
 
G4double GetMeanMultiplicity (void) const
 
G4double GetMeanTemperature (void) const
 

Private Member Functions

 G4StatMFMacroCanonical ()
 
 G4StatMFMacroCanonical (const G4StatMFMacroCanonical &)
 
G4StatMFMacroCanonicaloperator= (const G4StatMFMacroCanonical &right)
 
G4bool operator== (const G4StatMFMacroCanonical &right) const
 
G4bool operator!= (const G4StatMFMacroCanonical &right) const
 
void Initialize (const G4Fragment &theFragment)
 
void CalculateTemperature (const G4Fragment &theFragment)
 
G4double ChooseA (G4int A, std::vector< G4int > &ANumbers)
 
G4StatMFChannelChooseZ (G4int &Z, std::vector< G4int > &FragmentsA)
 

Private Attributes

G4double _ChemPotentialMu
 
G4double _ChemPotentialNu
 
G4double _Kappa
 
std::vector< G4VStatMFMacroCluster * > _theClusters
 

Additional Inherited Members

- Protected Attributes inherited from G4VStatMFEnsemble
G4double __FreeInternalE0
 
G4double __MeanTemperature
 
G4double __MeanEntropy
 
G4double __MeanMultiplicity
 

Detailed Description

Definition at line 49 of file G4StatMFMacroCanonical.hh.

Constructor & Destructor Documentation

◆ G4StatMFMacroCanonical() [1/3]

G4StatMFMacroCanonical::G4StatMFMacroCanonical ( G4Fragment const &  theFragment)

Definition at line 44 of file G4StatMFMacroCanonical.cc.

45 {
46 
47  // Get memory for clusters
48  _theClusters.push_back(new G4StatMFMacroNucleon); // Size 1
49  _theClusters.push_back(new G4StatMFMacroBiNucleon); // Size 2
50  _theClusters.push_back(new G4StatMFMacroTriNucleon); // Size 3
51  _theClusters.push_back(new G4StatMFMacroTetraNucleon); // Size 4
52  for (G4int i = 4; i < theFragment.GetA_asInt(); i++)
53  _theClusters.push_back(new G4StatMFMacroMultiNucleon(i+1)); // Size 5 ... A
54 
55  // Perform class initialization
56  Initialize(theFragment);
57 
58 }
int G4int
Definition: G4Types.hh:78
void Initialize(const G4Fragment &theFragment)
std::vector< G4VStatMFMacroCluster * > _theClusters
Here is the call graph for this function:

◆ ~G4StatMFMacroCanonical()

G4StatMFMacroCanonical::~G4StatMFMacroCanonical ( )

Definition at line 61 of file G4StatMFMacroCanonical.cc.

62 {
63  // garbage collection
64  if (!_theClusters.empty())
65  {
66  std::for_each(_theClusters.begin(),_theClusters.end(),DeleteFragment());
67  }
68 }
std::vector< G4VStatMFMacroCluster * > _theClusters

◆ G4StatMFMacroCanonical() [2/3]

G4StatMFMacroCanonical::G4StatMFMacroCanonical ( )
inlineprivate

Definition at line 61 of file G4StatMFMacroCanonical.hh.

61 {};

◆ G4StatMFMacroCanonical() [3/3]

G4StatMFMacroCanonical::G4StatMFMacroCanonical ( const G4StatMFMacroCanonical )
inlineprivate

Definition at line 65 of file G4StatMFMacroCanonical.hh.

Here is the call graph for this function:

Member Function Documentation

◆ CalculateTemperature()

void G4StatMFMacroCanonical::CalculateTemperature ( const G4Fragment theFragment)
private

Definition at line 90 of file G4StatMFMacroCanonical.cc.

91 {
92  // Excitation Energy
93  G4double U = theFragment.GetExcitationEnergy();
94 
95  G4int A = theFragment.GetA_asInt();
96  G4int Z = theFragment.GetZ_asInt();
97 
98  // Fragment Multiplicity
99  G4double FragMult = std::max((1.0+(2.31/MeV)*(U/A - 3.5*MeV))*A/100.0, 2.0);
100 
101  // Parameter Kappa
102  G4Pow* g4pow = G4Pow::GetInstance();
103  _Kappa = (1.0+elm_coupling*(g4pow->A13(FragMult)-1)/
104  (G4StatMFParameters::Getr0()*g4pow->Z13(A)));
105  _Kappa = _Kappa*_Kappa*_Kappa - 1.0;
106 
107  G4StatMFMacroTemperature * theTemp = new
109 
110  __MeanTemperature = theTemp->CalcTemperature();
114  __MeanEntropy = theTemp->GetEntropy();
115 
116  delete theTemp;
117 
118  return;
119 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4double GetChemicalPotentialMu(void) const
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:273
static const double MeV
Definition: G4SIunits.hh:211
Definition: G4Pow.hh:56
G4int GetA_asInt() const
Definition: G4Fragment.hh:256
int G4int
Definition: G4Types.hh:78
int elm_coupling
Definition: hepunit.py:286
static G4double Getr0()
double A(double temperature)
G4int GetZ_asInt() const
Definition: G4Fragment.hh:261
Float_t Z
G4double GetMeanMultiplicity(void) const
G4double Z13(G4int Z) const
Definition: G4Pow.hh:127
G4double A13(G4double A) const
Definition: G4Pow.hh:132
G4double GetChemicalPotentialNu(void) const
std::vector< G4VStatMFMacroCluster * > _theClusters
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChooseA()

G4double G4StatMFMacroCanonical::ChooseA ( G4int  A,
std::vector< G4int > &  ANumbers 
)
private

Definition at line 165 of file G4StatMFMacroCanonical.cc.

167 {
168  G4double multiplicity = 0.0;
169  G4int i;
170 
171  std::vector<G4double> AcumMultiplicity;
172  AcumMultiplicity.reserve(A);
173 
174  AcumMultiplicity.push_back((*(_theClusters.begin()))->GetMeanMultiplicity());
175  for (std::vector<G4VStatMFMacroCluster*>::iterator it = _theClusters.begin()+1;
176  it != _theClusters.end(); ++it)
177  {
178  AcumMultiplicity.push_back((*it)->GetMeanMultiplicity()+AcumMultiplicity.back());
179  }
180 
181  G4int CheckA;
182  do {
183  CheckA = -1;
184  G4int SumA = 0;
185  G4int ThisOne = 0;
186  multiplicity = 0.0;
187  for (i = 0; i < A; i++) ANumbers[i] = 0;
188  do {
190  for (i = 0; i < A; i++) {
191  if (RandNumber < AcumMultiplicity[i]) {
192  ThisOne = i;
193  break;
194  }
195  }
196  multiplicity++;
197  ANumbers[ThisOne] = ANumbers[ThisOne]+1;
198  SumA += ThisOne+1;
199  CheckA = A - SumA;
200 
201  // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
202  } while (CheckA > 0);
203 
204  // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
205  } while (CheckA < 0 || std::abs(__MeanMultiplicity - multiplicity) > std::sqrt(__MeanMultiplicity) + 0.5);
206 
207  return multiplicity;
208 }
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
double A(double temperature)
std::vector< G4VStatMFMacroCluster * > _theClusters
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChooseAandZ()

G4StatMFChannel * G4StatMFMacroCanonical::ChooseAandZ ( const G4Fragment theFragment)
virtual

Implements G4VStatMFEnsemble.

Definition at line 123 of file G4StatMFMacroCanonical.cc.

125 {
126  G4int A = theFragment.GetA_asInt();
127  G4int Z = theFragment.GetZ_asInt();
128 
129  std::vector<G4int> ANumbers(A);
130 
131  G4double Multiplicity = ChooseA(A,ANumbers);
132 
133  std::vector<G4int> FragmentsA;
134 
135  G4int i = 0;
136  for (i = 0; i < A; i++)
137  {
138  for (G4int j = 0; j < ANumbers[i]; j++) FragmentsA.push_back(i+1);
139  }
140 
141  // Sort fragments in decreasing order
142  G4int im = 0;
143  for (G4int j = 0; j < Multiplicity; j++)
144  {
145  G4int FragmentsAMax = 0;
146  im = j;
147  for (i = j; i < Multiplicity; i++)
148  {
149  if (FragmentsA[i] <= FragmentsAMax) { continue; }
150  else
151  {
152  im = i;
153  FragmentsAMax = FragmentsA[im];
154  }
155  }
156  if (im != j)
157  {
158  FragmentsA[im] = FragmentsA[j];
159  FragmentsA[j] = FragmentsAMax;
160  }
161  }
162  return ChooseZ(Z,FragmentsA);
163 }
G4int GetA_asInt() const
Definition: G4Fragment.hh:256
G4StatMFChannel * ChooseZ(G4int &Z, std::vector< G4int > &FragmentsA)
int G4int
Definition: G4Types.hh:78
double A(double temperature)
G4int GetZ_asInt() const
Definition: G4Fragment.hh:261
Float_t Z
G4double ChooseA(G4int A, std::vector< G4int > &ANumbers)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChooseZ()

G4StatMFChannel * G4StatMFMacroCanonical::ChooseZ ( G4int Z,
std::vector< G4int > &  FragmentsA 
)
private

Definition at line 210 of file G4StatMFMacroCanonical.cc.

213 {
214  G4Pow* g4pow = G4Pow::GetInstance();
215  std::vector<G4int> FragmentsZ;
216 
217  G4int DeltaZ = 0;
219  G4int multiplicity = FragmentsA.size();
220 
221  do {
222  FragmentsZ.clear();
223  G4int SumZ = 0;
224  for (G4int i = 0; i < multiplicity; i++)
225  {
226  G4int A = FragmentsA[i];
227  if (A <= 1)
228  {
229  G4double RandNumber = G4UniformRand();
230  if (RandNumber < (*_theClusters.begin())->GetZARatio())
231  {
232  FragmentsZ.push_back(1);
233  SumZ += FragmentsZ[i];
234  }
235  else FragmentsZ.push_back(0);
236  }
237  else
238  {
239  G4double RandZ;
241  + 2*CP*g4pow->Z23(FragmentsA[i]);
242  G4double ZMean;
243  if (FragmentsA[i] > 1 && FragmentsA[i] < 5) { ZMean = 0.5*FragmentsA[i]; }
244  else {
245  ZMean = FragmentsA[i]*(4.0*G4StatMFParameters::GetGamma0()
246  + _ChemPotentialNu)/CC;
247  }
248  G4double ZDispersion = std::sqrt(FragmentsA[i]*__MeanTemperature/CC);
249  G4int z;
250  do
251  {
252  RandZ = G4RandGauss::shoot(ZMean,ZDispersion);
253  z = G4lrint(RandZ+0.5);
254  // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
255  } while (z < 0 || z > A);
256  FragmentsZ.push_back(z);
257  SumZ += z;
258  }
259  }
260  DeltaZ = Z - SumZ;
261  // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
262  } while (std::abs(DeltaZ) > 1);
263 
264  // DeltaZ can be 0, 1 or -1
265  G4int idx = 0;
266  if (DeltaZ < 0.0)
267  {
268  while (FragmentsZ[idx] < 1) { ++idx; }
269  }
270  FragmentsZ[idx] += DeltaZ;
271 
272  G4StatMFChannel * theChannel = new G4StatMFChannel;
273  for (G4int i = multiplicity-1; i >= 0; i--)
274  {
275  theChannel->CreateFragment(FragmentsA[i],FragmentsZ[i]);
276  }
277 
278  return theChannel;
279 }
static G4double GetGamma0()
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
ThreeVector shoot(const G4int Ap, const G4int Af)
Definition: G4Pow.hh:56
int G4int
Definition: G4Types.hh:78
void CreateFragment(G4int A, G4int Z)
#define G4UniformRand()
Definition: Randomize.hh:97
double A(double temperature)
Float_t Z
int G4lrint(double ad)
Definition: templates.hh:163
static G4double GetCoulomb()
std::vector< G4VStatMFMacroCluster * > _theClusters
double G4double
Definition: G4Types.hh:76
G4double Z23(G4int Z) const
Definition: G4Pow.hh:154
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialize()

void G4StatMFMacroCanonical::Initialize ( const G4Fragment theFragment)
private

Definition at line 71 of file G4StatMFMacroCanonical.cc.

72 {
73 
74  G4int A = theFragment.GetA_asInt();
75  G4int Z = theFragment.GetZ_asInt();
76  G4double x = 1.0 - 2.0*Z/G4double(A);
77  G4Pow* g4pow = G4Pow::GetInstance();
78 
79  // Free Internal energy at T = 0
80  __FreeInternalE0 = A*( -G4StatMFParameters::GetE0() + // Volume term (for T = 0)
81  G4StatMFParameters::GetGamma0()*x*x) // Symmetry term
82  + G4StatMFParameters::GetBeta0()*g4pow->Z23(A) + // Surface term (for T = 0)
83  0.6*elm_coupling*Z*Z/(G4StatMFParameters::Getr0()* // Coulomb term
84  g4pow->Z13(A));
85 
86  CalculateTemperature(theFragment);
87  return;
88 }
static G4double GetGamma0()
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
void CalculateTemperature(const G4Fragment &theFragment)
Definition: G4Pow.hh:56
G4int GetA_asInt() const
Definition: G4Fragment.hh:256
int G4int
Definition: G4Types.hh:78
int elm_coupling
Definition: hepunit.py:286
static G4double Getr0()
double A(double temperature)
G4int GetZ_asInt() const
Definition: G4Fragment.hh:261
Float_t Z
static G4double GetE0()
G4double Z13(G4int Z) const
Definition: G4Pow.hh:127
static G4double GetBeta0()
double G4double
Definition: G4Types.hh:76
G4double Z23(G4int Z) const
Definition: G4Pow.hh:154
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

G4bool G4StatMFMacroCanonical::operator!= ( const G4StatMFMacroCanonical right) const
private
Here is the caller graph for this function:

◆ operator=()

G4StatMFMacroCanonical& G4StatMFMacroCanonical::operator= ( const G4StatMFMacroCanonical right)
private
Here is the caller graph for this function:

◆ operator==()

G4bool G4StatMFMacroCanonical::operator== ( const G4StatMFMacroCanonical right) const
private
Here is the caller graph for this function:

Member Data Documentation

◆ _ChemPotentialMu

G4double G4StatMFMacroCanonical::_ChemPotentialMu
private

Definition at line 98 of file G4StatMFMacroCanonical.hh.

◆ _ChemPotentialNu

G4double G4StatMFMacroCanonical::_ChemPotentialNu
private

Definition at line 101 of file G4StatMFMacroCanonical.hh.

◆ _Kappa

G4double G4StatMFMacroCanonical::_Kappa
private

Definition at line 105 of file G4StatMFMacroCanonical.hh.

◆ _theClusters

std::vector<G4VStatMFMacroCluster*> G4StatMFMacroCanonical::_theClusters
private

Definition at line 108 of file G4StatMFMacroCanonical.hh.


The documentation for this class was generated from the following files: