Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4StatMFMacroMultiplicity Class Reference

#include <G4StatMFMacroMultiplicity.hh>

Public Member Functions

 G4StatMFMacroMultiplicity (const G4double anA, const G4double kappa, const G4double temp, const G4double nu, std::vector< G4VStatMFMacroCluster * > *ClusterVector)
 
 ~G4StatMFMacroMultiplicity ()
 
G4double operator() (const G4double mu)
 
G4double GetMeanMultiplicity (void) const
 
G4double GetChemicalPotentialMu (void) const
 
G4double CalcChemicalPotentialMu (void)
 

Detailed Description

Definition at line 43 of file G4StatMFMacroMultiplicity.hh.

Constructor & Destructor Documentation

◆ G4StatMFMacroMultiplicity()

G4StatMFMacroMultiplicity::G4StatMFMacroMultiplicity ( const G4double  anA,
const G4double  kappa,
const G4double  temp,
const G4double  nu,
std::vector< G4VStatMFMacroCluster * > *  ClusterVector 
)
inline

Definition at line 47 of file G4StatMFMacroMultiplicity.hh.

51 :
52 theA(anA),
53 _Kappa(kappa),
54 _MeanMultiplicity(0.0),
55 _MeanTemperature(temp),
56 _ChemPotentialMu(0.0),
57 _ChemPotentialNu(nu),
58 _theClusters(ClusterVector)
59 {};

◆ ~G4StatMFMacroMultiplicity()

G4StatMFMacroMultiplicity::~G4StatMFMacroMultiplicity ( )
inline

Definition at line 61 of file G4StatMFMacroMultiplicity.hh.

61{};

Member Function Documentation

◆ CalcChemicalPotentialMu()

G4double G4StatMFMacroMultiplicity::CalcChemicalPotentialMu ( void  )

Definition at line 65 of file G4StatMFMacroMultiplicity.cc.

68{
69 G4double CP = ((3./5.)*elm_coupling/G4StatMFParameters::Getr0())*
70 (1.0-1.0/std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0));
71
72 // starting value for chemical potential \mu
73 // it is the derivative of F(T,V)-\nu*Z w.r.t. Af in Af=5
74 G4double ZA5 = _theClusters->operator[](4)->GetZARatio();
75 G4double ILD5 = _theClusters->operator[](4)->GetInvLevelDensity();
76 _ChemPotentialMu = -G4StatMFParameters::GetE0()-
77 _MeanTemperature*_MeanTemperature/ILD5 -
78 _ChemPotentialNu*ZA5 +
79 G4StatMFParameters::GetGamma0()*(1.0-2.0*ZA5)*(1.0-2.0*ZA5) +
80 (2.0/3.0)*G4StatMFParameters::Beta(_MeanTemperature)/std::pow(5.,1./3.) +
81 (5.0/3.0)*CP*ZA5*ZA5*std::pow(5.,2./3.) -
82 1.5*_MeanTemperature/5.0;
83
84
85
86 G4double ChemPa = _ChemPotentialMu;
87 if (ChemPa/_MeanTemperature > 10.0) ChemPa = 10.0*_MeanTemperature;
88 G4double ChemPb = ChemPa - 0.5*std::abs(ChemPa);
89
90
91 G4double fChemPa = this->operator()(ChemPa);
92 G4double fChemPb = this->operator()(ChemPb);
93
94
95 // Set the precision level for locating the root.
96 // If the root is inside this interval, then it's done!
97 G4double intervalWidth = 1.e-4;
98
99 // bracketing the solution
100 G4int iterations = 0;
101 while (fChemPa*fChemPb > 0.0 && iterations < 100)
102 {
103 if (std::abs(fChemPa) <= std::abs(fChemPb))
104 {
105 ChemPa += 0.6*(ChemPa-ChemPb);
106 fChemPa = this->operator()(ChemPa);
107 iterations++;
108 }
109 else
110 {
111 ChemPb += 0.6*(ChemPb-ChemPa);
112 fChemPb = this->operator()(ChemPb);
113 iterations++;
114 }
115 }
116
117 if (fChemPa*fChemPb > 0.0) // the bracketing failed, complain
118 {
119 G4cerr <<"G4StatMFMacroMultiplicity:"<<" ChemPa="<<ChemPa<<" ChemPb="<<ChemPb<< G4endl;
120 G4cerr <<"G4StatMFMacroMultiplicity:"<<" fChemPa="<<fChemPa<<" fChemPb="<<fChemPb<< G4endl;
121 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::CalcChemicalPotentialMu: I couldn't bracket the root.");
122 }
123 else if (fChemPa*fChemPb < 0.0 && std::abs(ChemPa-ChemPb) > intervalWidth) // the bracketing was OK, try to locate the root
124 {
126 theSolver->SetIntervalLimits(ChemPa,ChemPb);
127 // if (!theSolver->Crenshaw(*this))
128 if (!theSolver->Brent(*this))
129 {
130 G4cerr <<"G4StatMFMacroMultiplicity:"<<" ChemPa="<<ChemPa<<" ChemPb="<<ChemPb<< G4endl;
131 G4cerr <<"G4StatMFMacroMultiplicity:"<<" fChemPa="<<fChemPa<<" fChemPb="<<fChemPb<< G4endl;
132 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::CalcChemicalPotentialMu: I couldn't find the root.");
133 }
134 _ChemPotentialMu = theSolver->GetRoot();
135 delete theSolver;
136 }
137 else // the root is within the interval, which is shorter then the precision level - all done
138 {
139 _ChemPotentialMu = ChemPa;
140 }
141
142 return _ChemPotentialMu;
143}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4bool Brent(Function &theFunction)
void SetIntervalLimits(const G4double Limit1, const G4double Limit2)
G4double GetRoot(void) const
Definition: G4Solver.hh:77
G4double operator()(const G4double mu)
static G4double Getr0()
static G4double GetGamma0()
static G4double GetKappaCoulomb()
static G4double GetE0()
static G4double Beta(const G4double T)

◆ GetChemicalPotentialMu()

G4double G4StatMFMacroMultiplicity::GetChemicalPotentialMu ( void  ) const
inline

Definition at line 83 of file G4StatMFMacroMultiplicity.hh.

83{return _ChemPotentialMu;}

◆ GetMeanMultiplicity()

G4double G4StatMFMacroMultiplicity::GetMeanMultiplicity ( void  ) const
inline

Definition at line 81 of file G4StatMFMacroMultiplicity.hh.

81{return _MeanMultiplicity;}

◆ operator()()

G4double G4StatMFMacroMultiplicity::operator() ( const G4double  mu)
inline

Definition at line 63 of file G4StatMFMacroMultiplicity.hh.

64 { return (theA - this->CalcMeanA(mu))/theA; }

Referenced by CalcChemicalPotentialMu().


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