56 Initialize(theFragment);
64 if (!_theClusters.empty())
66 std::for_each(_theClusters.begin(),_theClusters.end(),DeleteFragment());
71 void G4StatMFMacroCanonical::Initialize(
const G4Fragment & theFragment)
87 CalculateTemperature(theFragment);
92 void G4StatMFMacroCanonical::CalculateTemperature(
const G4Fragment & theFragment)
105 _Kappa = (1.0+
elm_coupling*(std::pow(FragMult,1./3.)-1)/
107 _Kappa = _Kappa*_Kappa*_Kappa - 1.0;
133 std::vector<G4int> ANumbers(A);
135 G4double Multiplicity = ChooseA(A,ANumbers);
137 std::vector<G4int> FragmentsA;
140 for (i = 0; i < A; i++)
142 for (
G4int j = 0; j < ANumbers[i]; j++) FragmentsA.push_back(i+1);
147 for (
G4int j = 0; j < Multiplicity; j++)
149 G4int FragmentsAMax = 0;
151 for (i = j; i < Multiplicity; i++)
153 if (FragmentsA[i] <= FragmentsAMax) {
continue; }
157 FragmentsAMax = FragmentsA[im];
163 FragmentsA[im] = FragmentsA[j];
164 FragmentsA[j] = FragmentsAMax;
168 return ChooseZ(Z,FragmentsA);
172 G4double G4StatMFMacroCanonical::ChooseA(
G4int A, std::vector<G4int> & ANumbers)
178 std::vector<G4double> AcumMultiplicity;
179 AcumMultiplicity.reserve(A);
181 AcumMultiplicity.push_back((*(_theClusters.begin()))->GetMeanMultiplicity());
182 for (std::vector<G4VStatMFMacroCluster*>::iterator it = _theClusters.begin()+1;
183 it != _theClusters.end(); ++it)
185 AcumMultiplicity.push_back((*it)->GetMeanMultiplicity()+AcumMultiplicity.back());
194 for (i = 0; i < A; i++) ANumbers[i] = 0;
197 for (i = 0; i < A; i++) {
198 if (RandNumber < AcumMultiplicity[i]) {
204 ANumbers[ThisOne] = ANumbers[ThisOne]+1;
208 }
while (CheckA > 0);
217 std::vector<G4int> & FragmentsA)
221 std::vector<G4int> FragmentsZ;
227 G4int multiplicity = FragmentsA.size();
233 for (
G4int i = 0; i < multiplicity; i++)
235 G4int A = FragmentsA[i];
239 if (RandNumber < (*_theClusters.begin())->GetZARatio())
241 FragmentsZ.push_back(1);
242 SumZ += FragmentsZ[i];
244 else FragmentsZ.push_back(0);
251 if (FragmentsA[i] > 1 && FragmentsA[i] < 5) { ZMean = 0.5*FragmentsA[i]; }
258 z =
static_cast<G4int>(RandZ+0.5);
259 }
while (z < 0 || z > A);
260 FragmentsZ.push_back(z);
266 while (std::abs(DeltaZ) > 1);
272 while (FragmentsZ[idx] < 1) { ++idx; }
274 FragmentsZ[idx] += DeltaZ;
277 for (
G4int i = multiplicity-1; i >= 0; i--)
static G4double GetGamma0()
static G4Pow * GetInstance()
ThreeVector shoot(const G4int Ap, const G4int Af)
static G4double GetKappaCoulomb()
G4StatMFChannel * ChooseAandZ(const G4Fragment &theFragment)
G4double GetEntropy(void) const
void CreateFragment(G4int A, G4int Z)
G4double GetChemicalPotentialMu(void) const
G4double Z13(G4int Z) const
G4double CalcTemperature(void)
G4double GetMeanMultiplicity(void) const
G4double __MeanMultiplicity
G4double GetChemicalPotentialNu(void) const
~G4StatMFMacroCanonical()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4StatMFMacroCanonical(G4Fragment const &theFragment)
G4double __MeanTemperature
G4double Z23(G4int Z) const
G4double __FreeInternalE0
static G4double GetBeta0()
G4double GetExcitationEnergy() const