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 ( 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.

00051                                                                                  :
00052         theA(anA),
00053         _Kappa(kappa),
00054         _MeanMultiplicity(0.0),
00055         _MeanTemperature(temp),
00056         _ChemPotentialMu(0.0),
00057         _ChemPotentialNu(nu),
00058         _theClusters(ClusterVector) 
00059         {};
        

G4StatMFMacroMultiplicity::~G4StatMFMacroMultiplicity (  )  [inline]

Definition at line 61 of file G4StatMFMacroMultiplicity.hh.

00061 {};


Member Function Documentation

G4double G4StatMFMacroMultiplicity::CalcChemicalPotentialMu ( void   ) 

Definition at line 65 of file G4StatMFMacroMultiplicity.cc.

References G4StatMFParameters::Beta(), G4Solver< Function >::Brent(), G4cerr, G4endl, G4StatMFParameters::GetE0(), G4StatMFParameters::GetGamma0(), G4StatMFParameters::GetKappaCoulomb(), G4StatMFParameters::Getr0(), G4Solver< Function >::GetRoot(), operator()(), and G4Solver< Function >::SetIntervalLimits().

00068 {
00069     G4double CP = ((3./5.)*elm_coupling/G4StatMFParameters::Getr0())*
00070         (1.0-1.0/std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0));
00071 
00072     // starting value for chemical potential \mu
00073     // it is the derivative of F(T,V)-\nu*Z w.r.t. Af in Af=5
00074     G4double ZA5 = _theClusters->operator[](4)->GetZARatio();
00075     G4double ILD5 = _theClusters->operator[](4)->GetInvLevelDensity();
00076     _ChemPotentialMu = -G4StatMFParameters::GetE0()-
00077         _MeanTemperature*_MeanTemperature/ILD5 -
00078         _ChemPotentialNu*ZA5 + 
00079         G4StatMFParameters::GetGamma0()*(1.0-2.0*ZA5)*(1.0-2.0*ZA5) +
00080         (2.0/3.0)*G4StatMFParameters::Beta(_MeanTemperature)/std::pow(5.,1./3.) +
00081         (5.0/3.0)*CP*ZA5*ZA5*std::pow(5.,2./3.) -
00082         1.5*_MeanTemperature/5.0;
00083                 
00084 
00085 
00086     G4double ChemPa = _ChemPotentialMu;
00087     if (ChemPa/_MeanTemperature > 10.0) ChemPa = 10.0*_MeanTemperature;
00088     G4double ChemPb = ChemPa - 0.5*std::abs(ChemPa);
00089     
00090     
00091     G4double fChemPa = this->operator()(ChemPa); 
00092     G4double fChemPb = this->operator()(ChemPb); 
00093     
00094 
00095     // Set the precision level for locating the root. 
00096     // If the root is inside this interval, then it's done! 
00097     G4double intervalWidth = 1.e-4;
00098 
00099     // bracketing the solution
00100     G4int iterations = 0;
00101     while (fChemPa*fChemPb > 0.0 && iterations < 100) 
00102     {
00103         if (std::abs(fChemPa) <= std::abs(fChemPb)) 
00104         {
00105             ChemPa += 0.6*(ChemPa-ChemPb);
00106             fChemPa = this->operator()(ChemPa);
00107             iterations++;
00108         } 
00109         else 
00110         {
00111             ChemPb += 0.6*(ChemPb-ChemPa);
00112             fChemPb = this->operator()(ChemPb);
00113             iterations++;
00114         }
00115     }
00116 
00117     if (fChemPa*fChemPb > 0.0) // the bracketing failed, complain 
00118     {
00119       G4cerr <<"G4StatMFMacroMultiplicity:"<<" ChemPa="<<ChemPa<<" ChemPb="<<ChemPb<< G4endl;
00120       G4cerr <<"G4StatMFMacroMultiplicity:"<<" fChemPa="<<fChemPa<<" fChemPb="<<fChemPb<< G4endl;
00121         throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::CalcChemicalPotentialMu: I couldn't bracket the root.");
00122     }
00123     else if (fChemPa*fChemPb < 0.0 && std::abs(ChemPa-ChemPb) > intervalWidth) // the bracketing was OK, try to locate the root
00124     {   
00125     G4Solver<G4StatMFMacroMultiplicity> * theSolver = new G4Solver<G4StatMFMacroMultiplicity>(100,intervalWidth);
00126     theSolver->SetIntervalLimits(ChemPa,ChemPb);
00127     //    if (!theSolver->Crenshaw(*this)) 
00128     if (!theSolver->Brent(*this)) 
00129     {
00130       G4cerr <<"G4StatMFMacroMultiplicity:"<<" ChemPa="<<ChemPa<<" ChemPb="<<ChemPb<< G4endl;
00131       G4cerr <<"G4StatMFMacroMultiplicity:"<<" fChemPa="<<fChemPa<<" fChemPb="<<fChemPb<< G4endl;
00132         throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::CalcChemicalPotentialMu: I couldn't find the root.");
00133     }
00134     _ChemPotentialMu = theSolver->GetRoot();
00135     delete theSolver;
00136     }
00137     else // the root is within the interval, which is shorter then the precision level - all done 
00138     {
00139      _ChemPotentialMu = ChemPa;
00140     }
00141 
00142     return _ChemPotentialMu;
00143 }

G4double G4StatMFMacroMultiplicity::GetChemicalPotentialMu ( void   )  const [inline]

Definition at line 83 of file G4StatMFMacroMultiplicity.hh.

00083 {return _ChemPotentialMu;}

G4double G4StatMFMacroMultiplicity::GetMeanMultiplicity ( void   )  const [inline]

Definition at line 81 of file G4StatMFMacroMultiplicity.hh.

00081 {return _MeanMultiplicity;}

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

Definition at line 63 of file G4StatMFMacroMultiplicity.hh.

Referenced by CalcChemicalPotentialMu().

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


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:25 2013 for Geant4 by  doxygen 1.4.7