Geant4-11
Data Structures | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4StatMFMacroCanonical Class Reference

#include <G4StatMFMacroCanonical.hh>

Inheritance diagram for G4StatMFMacroCanonical:
G4VStatMFEnsemble

Data Structures

struct  DeleteFragment
 

Public Member Functions

G4StatMFChannelChooseAandZ (const G4Fragment &theFragment)
 
 G4StatMFMacroCanonical (G4Fragment const &theFragment)
 
G4double GetMeanMultiplicity (void) const
 
G4double GetMeanTemperature (void) const
 
 ~G4StatMFMacroCanonical ()
 

Protected Attributes

G4double __FreeInternalE0
 
G4double __MeanEntropy
 
G4double __MeanMultiplicity
 
G4double __MeanTemperature
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 49 of file G4StatMFMacroCanonical.hh.

Constructor & Destructor Documentation

◆ G4StatMFMacroCanonical() [1/3]

G4StatMFMacroCanonical::G4StatMFMacroCanonical ( G4Fragment const &  theFragment)

Definition at line 43 of file G4StatMFMacroCanonical.cc.

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

References _theClusters, G4Fragment::GetA_asInt(), and Initialize().

◆ ~G4StatMFMacroCanonical()

G4StatMFMacroCanonical::~G4StatMFMacroCanonical ( )

Definition at line 60 of file G4StatMFMacroCanonical.cc.

61{
62 // garbage collection
63 if (!_theClusters.empty())
64 {
65 std::for_each(_theClusters.begin(),_theClusters.end(),DeleteFragment());
66 }
67}

References _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.

Member Function Documentation

◆ CalculateTemperature()

void G4StatMFMacroCanonical::CalculateTemperature ( const G4Fragment theFragment)
private

Definition at line 89 of file G4StatMFMacroCanonical.cc.

90{
91 // Excitation Energy
92 G4double U = theFragment.GetExcitationEnergy();
93
94 G4int A = theFragment.GetA_asInt();
95 G4int Z = theFragment.GetZ_asInt();
96
97 // Fragment Multiplicity
98 G4double FragMult = std::max((1.0+(2.31/MeV)*(U/A - 3.5*MeV))*A/100.0, 2.0);
99
100 // Parameter Kappa
101 G4Pow* g4calc = G4Pow::GetInstance();
102 _Kappa = (1.0+elm_coupling*(g4calc->A13(FragMult)-1)/
103 (G4StatMFParameters::Getr0()*g4calc->Z13(A)));
104 _Kappa = _Kappa*_Kappa*_Kappa - 1.0;
105
106 G4StatMFMacroTemperature * theTemp = new
108
113 __MeanEntropy = theTemp->GetEntropy();
114
115 delete theTemp;
116
117 return;
118}
static constexpr double MeV
Definition: G4SIunits.hh:200
double G4double
Definition: G4Types.hh:83
const G4int Z[17]
const G4double A[17]
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:299
G4int GetZ_asInt() const
Definition: G4Fragment.hh:276
G4int GetA_asInt() const
Definition: G4Fragment.hh:271
Definition: G4Pow.hh:49
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double A13(G4double A) const
Definition: G4Pow.cc:120
G4double Z13(G4int Z) const
Definition: G4Pow.hh:123
G4double GetChemicalPotentialMu(void) const
G4double GetChemicalPotentialNu(void) const
G4double GetMeanMultiplicity(void) const
static G4double Getr0()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
int elm_coupling
Definition: hepunit.py:285

References G4VStatMFEnsemble::__FreeInternalE0, G4VStatMFEnsemble::__MeanEntropy, G4VStatMFEnsemble::__MeanMultiplicity, G4VStatMFEnsemble::__MeanTemperature, _ChemPotentialMu, _ChemPotentialNu, _Kappa, _theClusters, A, G4Pow::A13(), G4StatMFMacroTemperature::CalcTemperature(), source.hepunit::elm_coupling, G4Fragment::GetA_asInt(), G4StatMFMacroTemperature::GetChemicalPotentialMu(), G4StatMFMacroTemperature::GetChemicalPotentialNu(), G4StatMFMacroTemperature::GetEntropy(), G4Fragment::GetExcitationEnergy(), G4Pow::GetInstance(), G4StatMFMacroTemperature::GetMeanMultiplicity(), G4StatMFParameters::Getr0(), G4Fragment::GetZ_asInt(), G4INCL::Math::max(), MeV, Z, and G4Pow::Z13().

Referenced by Initialize().

◆ ChooseA()

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

Definition at line 164 of file G4StatMFMacroCanonical.cc.

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

References G4VStatMFEnsemble::__MeanMultiplicity, _theClusters, A, and G4UniformRand.

Referenced by ChooseAandZ().

◆ ChooseAandZ()

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

Implements G4VStatMFEnsemble.

Definition at line 122 of file G4StatMFMacroCanonical.cc.

124{
125 G4int A = theFragment.GetA_asInt();
126 G4int Z = theFragment.GetZ_asInt();
127
128 std::vector<G4int> ANumbers(A);
129
130 G4double Multiplicity = ChooseA(A,ANumbers);
131
132 std::vector<G4int> FragmentsA;
133
134 G4int i = 0;
135 for (i = 0; i < A; i++)
136 {
137 for (G4int j = 0; j < ANumbers[i]; j++) FragmentsA.push_back(i+1);
138 }
139
140 // Sort fragments in decreasing order
141 G4int im = 0;
142 for (G4int j = 0; j < Multiplicity; j++)
143 {
144 G4int FragmentsAMax = 0;
145 im = j;
146 for (i = j; i < Multiplicity; i++)
147 {
148 if (FragmentsA[i] <= FragmentsAMax) { continue; }
149 else
150 {
151 im = i;
152 FragmentsAMax = FragmentsA[im];
153 }
154 }
155 if (im != j)
156 {
157 FragmentsA[im] = FragmentsA[j];
158 FragmentsA[j] = FragmentsAMax;
159 }
160 }
161 return ChooseZ(Z,FragmentsA);
162}
G4StatMFChannel * ChooseZ(G4int &Z, std::vector< G4int > &FragmentsA)
G4double ChooseA(G4int A, std::vector< G4int > &ANumbers)

References A, ChooseA(), ChooseZ(), G4Fragment::GetA_asInt(), G4Fragment::GetZ_asInt(), and Z.

Referenced by G4StatMF::BreakItUp().

◆ ChooseZ()

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

Definition at line 209 of file G4StatMFMacroCanonical.cc.

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

References G4VStatMFEnsemble::__MeanTemperature, _ChemPotentialNu, _theClusters, A, anonymous_namespace{paraMaker.cc}::CP, G4StatMFChannel::CreateFragment(), G4lrint(), G4UniformRand, G4StatMFParameters::GetCoulomb(), G4StatMFParameters::GetGamma0(), G4Pow::GetInstance(), G4INCL::DeJongSpin::shoot(), Z, and G4Pow::Z23().

Referenced by ChooseAandZ().

◆ GetMeanMultiplicity()

G4double G4VStatMFEnsemble::GetMeanMultiplicity ( void  ) const
inlineinherited

Definition at line 68 of file G4VStatMFEnsemble.hh.

68{return __MeanMultiplicity;}

References G4VStatMFEnsemble::__MeanMultiplicity.

Referenced by G4StatMF::BreakItUp().

◆ GetMeanTemperature()

G4double G4VStatMFEnsemble::GetMeanTemperature ( void  ) const
inlineinherited

Definition at line 70 of file G4VStatMFEnsemble.hh.

70{return __MeanTemperature;}

References G4VStatMFEnsemble::__MeanTemperature.

Referenced by G4StatMF::BreakItUp().

◆ Initialize()

void G4StatMFMacroCanonical::Initialize ( const G4Fragment theFragment)
private

Definition at line 70 of file G4StatMFMacroCanonical.cc.

71{
72
73 G4int A = theFragment.GetA_asInt();
74 G4int Z = theFragment.GetZ_asInt();
75 G4double x = 1.0 - 2.0*Z/G4double(A);
76 G4Pow* g4calc = G4Pow::GetInstance();
77
78 // Free Internal energy at T = 0
79 __FreeInternalE0 = A*( -G4StatMFParameters::GetE0() + // Volume term (for T = 0)
80 G4StatMFParameters::GetGamma0()*x*x) // Symmetry term
81 + G4StatMFParameters::GetBeta0()*g4calc->Z23(A) + // Surface term (for T = 0)
82 0.6*elm_coupling*Z*Z/(G4StatMFParameters::Getr0()* // Coulomb term
83 g4calc->Z13(A));
84
85 CalculateTemperature(theFragment);
86 return;
87}
void CalculateTemperature(const G4Fragment &theFragment)
static G4double GetBeta0()
static G4double GetE0()

References G4VStatMFEnsemble::__FreeInternalE0, A, CalculateTemperature(), source.hepunit::elm_coupling, G4Fragment::GetA_asInt(), G4StatMFParameters::GetBeta0(), G4StatMFParameters::GetE0(), G4StatMFParameters::GetGamma0(), G4Pow::GetInstance(), G4StatMFParameters::Getr0(), G4Fragment::GetZ_asInt(), Z, G4Pow::Z13(), and G4Pow::Z23().

Referenced by G4StatMFMacroCanonical().

◆ operator!=()

G4bool G4StatMFMacroCanonical::operator!= ( const G4StatMFMacroCanonical right) const
private

◆ operator=()

G4StatMFMacroCanonical & G4StatMFMacroCanonical::operator= ( const G4StatMFMacroCanonical right)
private

◆ operator==()

G4bool G4StatMFMacroCanonical::operator== ( const G4StatMFMacroCanonical right) const
private

Field Documentation

◆ __FreeInternalE0

G4double G4VStatMFEnsemble::__FreeInternalE0
protectedinherited

◆ __MeanEntropy

G4double G4VStatMFEnsemble::__MeanEntropy
protectedinherited

◆ __MeanMultiplicity

G4double G4VStatMFEnsemble::__MeanMultiplicity
protectedinherited

◆ __MeanTemperature

G4double G4VStatMFEnsemble::__MeanTemperature
protectedinherited

◆ _ChemPotentialMu

G4double G4StatMFMacroCanonical::_ChemPotentialMu
private

Definition at line 98 of file G4StatMFMacroCanonical.hh.

Referenced by CalculateTemperature().

◆ _ChemPotentialNu

G4double G4StatMFMacroCanonical::_ChemPotentialNu
private

Definition at line 101 of file G4StatMFMacroCanonical.hh.

Referenced by CalculateTemperature(), and ChooseZ().

◆ _Kappa

G4double G4StatMFMacroCanonical::_Kappa
private

Definition at line 105 of file G4StatMFMacroCanonical.hh.

Referenced by CalculateTemperature().

◆ _theClusters

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

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