Geant4 10.7.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 42 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 46 of file G4StatMFMacroMultiplicity.hh.

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

◆ ~G4StatMFMacroMultiplicity()

G4StatMFMacroMultiplicity::~G4StatMFMacroMultiplicity ( )
inline

Definition at line 60 of file G4StatMFMacroMultiplicity.hh.

60{};

Member Function Documentation

◆ CalcChemicalPotentialMu()

G4double G4StatMFMacroMultiplicity::CalcChemicalPotentialMu ( void  )

Definition at line 62 of file G4StatMFMacroMultiplicity.cc.

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

◆ GetChemicalPotentialMu()

G4double G4StatMFMacroMultiplicity::GetChemicalPotentialMu ( void  ) const
inline

Definition at line 82 of file G4StatMFMacroMultiplicity.hh.

82{return _ChemPotentialMu;}

◆ GetMeanMultiplicity()

G4double G4StatMFMacroMultiplicity::GetMeanMultiplicity ( void  ) const
inline

Definition at line 80 of file G4StatMFMacroMultiplicity.hh.

80{return _MeanMultiplicity;}

◆ operator()()

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

Definition at line 62 of file G4StatMFMacroMultiplicity.hh.

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

Referenced by CalcChemicalPotentialMu().


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