]>
Commit | Line | Data |
---|---|---|
03896fc4 | 1 | // |
2 | // | |
3 | // Nikolai Amelin, Ludmila Malinina, Timur Pocheptsov (C) JINR/Dubna | |
4 | // amelin@sunhe.jinr.ru, malinina@sunhe.jinr.ru, pocheptsov@sunhe.jinr.ru | |
5 | // November. 2, 2006 | |
6 | // | |
7 | // | |
b1c2e580 | 8 | |
03896fc4 | 9 | #include <TMath.h> |
b1c2e580 | 10 | #include "StrangePotential.h" |
b1c2e580 | 11 | |
03896fc4 | 12 | //_____________________________________________________________________ |
13 | Double_t StrangePotential::CalculateStrangePotential() { | |
14 | // | |
15 | // compute strange potential | |
16 | // | |
b1c2e580 | 17 | Double_t minFunction = this->operator()(fMinStrangePotential); |
18 | Double_t maxFunction = this->operator()(fMaxStrangePotential); | |
19 | ||
20 | Int_t iter = 0; | |
21 | while(minFunction < 0.0 && iter++ < fNIteration) { | |
22 | fMinStrangePotential -= 0.5*fMinStrangePotential; | |
23 | minFunction = this->operator()(fMinStrangePotential); | |
24 | } | |
25 | ||
26 | iter = 0; | |
27 | while(minFunction*maxFunction > 0.0 && iter++ < fNIteration) { | |
03896fc4 | 28 | fMaxStrangePotential += 1.5*TMath::Abs(fMaxStrangePotential-fMinStrangePotential); |
b1c2e580 | 29 | maxFunction = this->operator()(fMaxStrangePotential); |
30 | } | |
31 | ||
32 | if(minFunction*maxFunction > 0.0) { | |
33 | Error("StrangePotential::CalculateStrangePotential", "minFunction*maxFunction is positive!\n"); | |
34 | return 0.; | |
35 | } | |
36 | ||
03896fc4 | 37 | EquationSolver<StrangePotential> * theSolver = |
38 | new EquationSolver<StrangePotential>(fNSolverIteration, fTolerance); | |
b1c2e580 | 39 | |
40 | theSolver->SetIntervalLimits(fMinStrangePotential, fMaxStrangePotential); | |
41 | ||
42 | if (!theSolver->Brent(*this)) | |
43 | Error("StrangePotential::CalculateStrangePotential", "the root is not found!\n"); | |
44 | ||
45 | Double_t strangePotential = theSolver->GetRoot(); | |
46 | delete theSolver; | |
47 | return strangePotential; | |
48 | } | |
49 | ||
03896fc4 | 50 | //_____________________________________________________________________ |
51 | Double_t StrangePotential::CalculateStrangeDensity(const Double_t strangePotential) | |
b1c2e580 | 52 | { |
03896fc4 | 53 | // |
54 | //calculate hadron system strange density | |
55 | // | |
b1c2e580 | 56 | fGc.SetStrangePotential(strangePotential); |
57 | fGc.SetTemperature(fTemperature); | |
58 | fGc.SetBaryonPotential(fBaryonPotential); | |
59 | return fGc.StrangenessDensity(fDatabase); | |
60 | } |