56 Initialize(theFragment);
64 if (!_theClusters.empty())
66 std::for_each(_theClusters.begin(),_theClusters.end(),DeleteFragment());
71 void G4StatMFMacroCanonical::Initialize(
const G4Fragment & theFragment)
86 CalculateTemperature(theFragment);
90 void G4StatMFMacroCanonical::CalculateTemperature(
const G4Fragment & theFragment)
105 _Kappa = _Kappa*_Kappa*_Kappa - 1.0;
129 std::vector<G4int> ANumbers(A);
131 G4double Multiplicity = ChooseA(A,ANumbers);
133 std::vector<G4int> FragmentsA;
136 for (i = 0; i <
A; i++)
138 for (
G4int j = 0; j < ANumbers[i]; j++) FragmentsA.push_back(i+1);
143 for (
G4int j = 0; j < Multiplicity; j++)
145 G4int FragmentsAMax = 0;
147 for (i = j; i < Multiplicity; i++)
149 if (FragmentsA[i] <= FragmentsAMax) {
continue; }
153 FragmentsAMax = FragmentsA[im];
158 FragmentsA[im] = FragmentsA[j];
159 FragmentsA[j] = FragmentsAMax;
162 return ChooseZ(Z,FragmentsA);
165 G4double G4StatMFMacroCanonical::ChooseA(
G4int A, std::vector<G4int> & ANumbers)
171 std::vector<G4double> AcumMultiplicity;
172 AcumMultiplicity.reserve(A);
174 AcumMultiplicity.push_back((*(_theClusters.begin()))->GetMeanMultiplicity());
175 for (std::vector<G4VStatMFMacroCluster*>::iterator it = _theClusters.begin()+1;
176 it != _theClusters.end(); ++it)
178 AcumMultiplicity.push_back((*it)->GetMeanMultiplicity()+AcumMultiplicity.back());
187 for (i = 0; i <
A; i++) ANumbers[i] = 0;
190 for (i = 0; i <
A; i++) {
191 if (RandNumber < AcumMultiplicity[i]) {
197 ANumbers[ThisOne] = ANumbers[ThisOne]+1;
202 }
while (CheckA > 0);
211 std::vector<G4int> & FragmentsA)
215 std::vector<G4int> FragmentsZ;
219 G4int multiplicity = FragmentsA.size();
224 for (
G4int i = 0; i < multiplicity; i++)
226 G4int A = FragmentsA[i];
230 if (RandNumber < (*_theClusters.begin())->GetZARatio())
232 FragmentsZ.push_back(1);
233 SumZ += FragmentsZ[i];
235 else FragmentsZ.push_back(0);
241 + 2*CP*g4calc->
Z23(FragmentsA[i]);
243 if (FragmentsA[i] > 1 && FragmentsA[i] < 5) { ZMean = 0.5*FragmentsA[i]; }
246 + _ChemPotentialNu)/CC;
255 }
while (z < 0 || z > A);
256 FragmentsZ.push_back(z);
262 }
while (std::abs(DeltaZ) > 1);
268 while (FragmentsZ[idx] < 1) { ++idx; }
270 FragmentsZ[idx] += DeltaZ;
273 for (
G4int i = multiplicity-1; i >= 0; i--)
static G4double GetGamma0()
static G4Pow * GetInstance()
ThreeVector shoot(const G4int Ap, const G4int Af)
G4StatMFChannel * ChooseAandZ(const G4Fragment &theFragment)
G4double GetEntropy(void) const
void CreateFragment(G4int A, G4int Z)
G4double GetChemicalPotentialMu(void) const
G4double Z13(G4int Z) const
double A(double temperature)
G4double CalcTemperature(void)
G4double GetMeanMultiplicity(void) const
G4double __MeanMultiplicity
G4double GetChemicalPotentialNu(void) const
~G4StatMFMacroCanonical()
G4double A13(G4double A) const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4StatMFMacroCanonical(G4Fragment const &theFragment)
G4double __MeanTemperature
static G4double GetCoulomb()
G4double Z23(G4int Z) const
static constexpr double elm_coupling
static constexpr double MeV
G4double __FreeInternalE0
static G4double GetBeta0()
G4double GetExcitationEnergy() const