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)
101 G4double FragMult = std::max((1.0+(2.31/
MeV)*(U/A - 3.5*
MeV))*A/100.0, 2.0);
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]; }
257 RandZ = G4RandGauss::shoot(ZMean,ZDispersion);
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--)