48 std::vector<G4VStatMFMacroCluster*> * ClusterVector) :
52 _FreeInternalE0(FreeE0),
54 _MeanMultiplicity(0.0),
55 _MeanTemperature(0.0),
56 _ChemPotentialMu(0.0),
57 _ChemPotentialNu(0.0),
59 _theClusters(ClusterVector)
70 G4double Tb = std::max(std::sqrt(_ExEnergy/(theA*0.12)),0.01*
MeV);
85 while (fTa < 0.0 && ++iterations < 10) {
91 while (fTa*fTb > 0.0 && iterations++ < 10) {
92 Tb += 2.*std::fabs(Tb-Ta);
97 G4cerr <<
"G4StatMFMacroTemperature:"<<
" Ta="<<Ta<<
" Tb="<<Tb<<
G4endl;
98 G4cerr <<
"G4StatMFMacroTemperature:"<<
" fTa="<<fTa<<
" fTb="<<fTb<<
G4endl;
99 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMFMacroTemperature::CalcTemperature: I couldn't bracket the solution.");
105 G4cout <<
"G4StatMFMacroTemperature, Crenshaw method failed:"<<
" Ta="<<Ta<<
" Tb="<<Tb<<
G4endl;
106 G4cout <<
"G4StatMFMacroTemperature, Crenshaw method failed:"<<
" fTa="<<fTa<<
" fTb="<<fTb<<
G4endl;
108 _MeanTemperature = theSolver->
GetRoot();
114 if (std::fabs(FunctionValureAtRoot) > 5.
e-2) {
115 if (_MeanTemperature < 1. || _MeanTemperature > 50.) {
116 G4cout <<
"Crenshaw method failed; function = " << FunctionValureAtRoot
117 <<
" solution? = " << _MeanTemperature <<
" MeV " <<
G4endl;
120 if (!theSolverBrent->
Brent(*
this)){
121 G4cout <<
"G4StatMFMacroTemperature, Brent method failed:"<<
" Ta="<<Ta<<
" Tb="<<Tb<<
G4endl;
122 G4cout <<
"G4StatMFMacroTemperature, Brent method failed:"<<
" fTa="<<fTa<<
" fTb="<<fTb<<
G4endl;
123 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
126 _MeanTemperature = theSolverBrent->
GetRoot();
127 FunctionValureAtRoot = this->
operator()(_MeanTemperature);
128 delete theSolverBrent;
130 if (std::abs(FunctionValureAtRoot) > 5.
e-2) {
132 G4cout <<
"Brent method failed; function = " << FunctionValureAtRoot <<
" solution? = " << _MeanTemperature <<
" MeV " <<
G4endl;
133 throw G4HadronicException(__FILE__, __LINE__,
"G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
138 return _MeanTemperature;
150 G4double FreeVol = _Kappa*(4.*
pi/3.)*R0*R0*R0;
154 CalcChemicalPotentialNu(T);
159 std::vector<G4VStatMFMacroCluster*>::iterator i;
160 for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
162 AverageEnergy += (*i)->GetMeanMultiplicity() * (*i)->CalcEnergy(T);
170 for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
172 _MeanEntropy += (*i)->CalcEntropy(T,FreeVol);
176 return AverageEnergy - _FreeInternalE0;
181 void G4StatMFMacroTemperature::CalcChemicalPotentialNu(
const G4double T)