source: trunk/source/processes/hadronic/models/de_excitation/multifragmentation/src/G4StatMFMacroMultiplicity.cc @ 846

Last change on this file since 846 was 819, checked in by garnier, 16 years ago

import all except CVS

File size: 5.2 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: G4StatMFMacroMultiplicity.cc,v 1.5 2006/06/29 20:25:10 gunter Exp $
28// GEANT4 tag $Name:  $
29//
30// Hadronic Process: Nuclear De-excitations
31// by V. Lara
32
33
34#include "G4StatMFMacroMultiplicity.hh"
35
36// operators definitions
37G4StatMFMacroMultiplicity & 
38G4StatMFMacroMultiplicity::operator=(const G4StatMFMacroMultiplicity & ) 
39{
40    throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::operator= meant to not be accessable");
41    return *this;
42}
43
44G4bool G4StatMFMacroMultiplicity::operator==(const G4StatMFMacroMultiplicity & ) const 
45{
46    throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::operator== meant to not be accessable");
47    return false;
48}
49
50
51G4bool G4StatMFMacroMultiplicity::operator!=(const G4StatMFMacroMultiplicity & ) const 
52{
53    throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::operator!= meant to not be accessable");
54    return true;
55}
56
57
58
59
60G4double G4StatMFMacroMultiplicity::CalcChemicalPotentialMu(void) 
61    //  Calculate Chemical potential \mu
62    // For that is necesary to calculate mean multiplicities
63{
64    G4double CP = ((3./5.)*elm_coupling/G4StatMFParameters::Getr0())*
65        (1.0-1.0/std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0));
66
67    // starting value for chemical potential \mu
68    // it is the derivative of F(T,V)-\nu*Z w.r.t. Af in Af=5
69    G4double ZA5 = _theClusters->operator[](4)->GetZARatio();
70    G4double ILD5 = _theClusters->operator[](4)->GetInvLevelDensity();
71    _ChemPotentialMu = -G4StatMFParameters::GetE0()-
72        _MeanTemperature*_MeanTemperature/ILD5 -
73        _ChemPotentialNu*ZA5 + 
74        G4StatMFParameters::GetGamma0()*(1.0-2.0*ZA5)*(1.0-2.0*ZA5) +
75        (2.0/3.0)*G4StatMFParameters::Beta(_MeanTemperature)/std::pow(5.,1./3.) +
76        (5.0/3.0)*CP*ZA5*ZA5*std::pow(5.,2./3.) -
77        1.5*_MeanTemperature/5.0;
78               
79
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   
86    G4double fChemPa = this->operator()(ChemPa); 
87    G4double fChemPb = this->operator()(ChemPb); 
88   
89    // bracketing the solution
90    G4int iterations = 0;
91    while (fChemPa*fChemPb > 0.0 && iterations < 10) 
92    {
93        if (std::abs(fChemPa) <= std::abs(fChemPb)) 
94        {
95            ChemPa += 0.6*(ChemPa-ChemPb);
96            fChemPa = this->operator()(ChemPa);
97        } 
98        else 
99        {
100            ChemPb += 0.6*(ChemPb-ChemPa);
101            fChemPb = this->operator()(ChemPb);
102        }
103    }
104    if (fChemPa*fChemPb > 0.0) 
105    {
106        throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::CalcChemicalPotentialMu: I couldn't bracket the root.");
107    }
108       
109       
110    G4Solver<G4StatMFMacroMultiplicity> * theSolver = new G4Solver<G4StatMFMacroMultiplicity>(100,1.e-4);
111    theSolver->SetIntervalLimits(ChemPa,ChemPb);
112    //    if (!theSolver->Crenshaw(*this))
113    if (!theSolver->Brent(*this)) 
114    {
115        throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::CalcChemicalPotentialMu: I couldn't find the root.");
116    }
117    _ChemPotentialMu = theSolver->GetRoot();
118    delete theSolver;
119    return _ChemPotentialMu;
120}
121
122
123
124G4double G4StatMFMacroMultiplicity::CalcMeanA(const G4double mu)
125{
126  G4double r03 = G4StatMFParameters::Getr0(); r03 *= r03*r03;
127  G4double V0 = (4.0/3.0)*pi*theA*r03;
128
129  G4double MeanA = 0.0;
130       
131  _MeanMultiplicity = 0.0;
132       
133 
134  G4int n = 1;
135 for (std::vector<G4VStatMFMacroCluster*>::iterator i = _theClusters->begin(); 
136      i != _theClusters->end(); ++i) 
137   {
138     G4double multip = (*i)->CalcMeanMultiplicity(V0*_Kappa,mu,_ChemPotentialNu,_MeanTemperature);
139     MeanA += multip*static_cast<G4double>(n++);
140     _MeanMultiplicity += multip;
141   }
142
143  return MeanA;
144}
Note: See TracBrowser for help on using the repository browser.