CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
NAStrangePotential Class Reference

#include <StrangePotential.h>

Public Member Functions

double CalculateStrangePotential ()
 
 NAStrangePotential (const double initialStrangeDensity, DatabasePDG *database)
 
double operator() (const double strangePotential)
 
void SetBaryonPotential (double value)
 
void SetMaxStrangePotential (double value)
 
void SetMinStrangePotential (double value)
 
void SetTemperature (double value)
 
 ~NAStrangePotential ()
 

Private Member Functions

double CalculateStrangeDensity (const double strangePotential)
 
 NAStrangePotential ()
 

Private Attributes

double fBaryonPotential
 
DatabasePDGfDatabase
 
NAStrangeDensity fGc
 
double fMaxStrangePotential
 
double fMinStrangePotential
 
int fNIteration
 
int fNSolverIteration
 
double fStrangeDensity
 
double fTemperature
 
double fTolerance
 

Detailed Description

Definition at line 19 of file StrangePotential.h.

Constructor & Destructor Documentation

NAStrangePotential::NAStrangePotential ( )
inlineprivate

Definition at line 34 of file StrangePotential.h.

34 {};
NAStrangePotential::NAStrangePotential ( const double  initialStrangeDensity,
DatabasePDG database 
)
inline

Definition at line 37 of file StrangePotential.h.

37  :
38  fStrangeDensity(initialStrangeDensity),
39  fMinStrangePotential(0.0001*GeV),
41  fNIteration(100),
42  fNSolverIteration(100),
43  fTolerance(1.e-8),
44  fDatabase(database)
45  {};
const double GeV
Definition: MathUtil.h:16
DatabasePDG * fDatabase
NAStrangePotential::~NAStrangePotential ( )
inline

Definition at line 47 of file StrangePotential.h.

47 {};

Member Function Documentation

double NAStrangePotential::CalculateStrangeDensity ( const double  strangePotential)
private
double NAStrangePotential::CalculateStrangePotential ( )

Definition at line 11 of file StrangePotential.cc.

References Abs(), NAEquationSolver< Function >::Brent(), fMaxStrangePotential, fMinStrangePotential, fNIteration, fNSolverIteration, fTolerance, NAEquationSolver< Function >::GetRoot(), operator()(), and NAEquationSolver< Function >::SetIntervalLimits().

Referenced by gen::Hydjet2Hadronizer::initializeForInternalPartons(), and SetMaxStrangePotential().

11  {
12  double minFunction = this->operator()(fMinStrangePotential);
13  double maxFunction = this->operator()(fMaxStrangePotential);
14 
15  int iter = 0;
16  while(minFunction < 0.0 && iter++ < fNIteration) {
18  minFunction = this->operator()(fMinStrangePotential);
19  }
20 
21  iter = 0;
22  while(minFunction*maxFunction > 0.0 && iter++ < fNIteration) {
24  maxFunction = this->operator()(fMaxStrangePotential);
25  }
26 
27  if(minFunction*maxFunction > 0.0) {
28  edm::LogError("StrangePotential") << "CalculateStrangePotential: minFunction*maxFunction is positive!";
29  return 0.;
30  }
31 
34 
36 
37  if (!theSolver->Brent(*this))
38  edm::LogError("StrangePotential") << "CalculateStrangePotential: the root is not found!";
39 
40  double strangePotential = theSolver->GetRoot();
41  delete theSolver;
42  return strangePotential;
43 }
double GetRoot(void) const
T Abs(T a)
Definition: MathUtil.h:49
bool Brent(Function &theFunction)
double operator()(const double strangePotential)
void SetIntervalLimits(const double Limit1, const double Limit2)
double NAStrangePotential::operator() ( const double  strangePotential)
inline

Definition at line 49 of file StrangePotential.h.

References CalculateStrangeDensity(), and fStrangeDensity.

Referenced by CalculateStrangePotential().

49  {
50  return (fStrangeDensity - this->CalculateStrangeDensity(strangePotential))/fStrangeDensity;
51  }
double CalculateStrangeDensity(const double strangePotential)
void NAStrangePotential::SetBaryonPotential ( double  value)
inline
void NAStrangePotential::SetMaxStrangePotential ( double  value)
inline
void NAStrangePotential::SetMinStrangePotential ( double  value)
inline
void NAStrangePotential::SetTemperature ( double  value)
inline

Member Data Documentation

double NAStrangePotential::fBaryonPotential
private

Definition at line 22 of file StrangePotential.h.

Referenced by CalculateStrangeDensity().

DatabasePDG* NAStrangePotential::fDatabase
private

Definition at line 29 of file StrangePotential.h.

Referenced by CalculateStrangeDensity().

NAStrangeDensity NAStrangePotential::fGc
private

Definition at line 30 of file StrangePotential.h.

Referenced by CalculateStrangeDensity().

double NAStrangePotential::fMaxStrangePotential
private

Definition at line 25 of file StrangePotential.h.

Referenced by CalculateStrangePotential().

double NAStrangePotential::fMinStrangePotential
private

Definition at line 24 of file StrangePotential.h.

Referenced by CalculateStrangePotential().

int NAStrangePotential::fNIteration
private

Definition at line 26 of file StrangePotential.h.

Referenced by CalculateStrangePotential().

int NAStrangePotential::fNSolverIteration
private

Definition at line 27 of file StrangePotential.h.

Referenced by CalculateStrangePotential().

double NAStrangePotential::fStrangeDensity
private

Definition at line 23 of file StrangePotential.h.

Referenced by operator()().

double NAStrangePotential::fTemperature
private

Definition at line 21 of file StrangePotential.h.

Referenced by CalculateStrangeDensity().

double NAStrangePotential::fTolerance
private

Definition at line 28 of file StrangePotential.h.

Referenced by CalculateStrangePotential().