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() [1/2]

NAStrangePotential::NAStrangePotential ( )
inlineprivate

Definition at line 34 of file StrangePotential.h.

34 {};

◆ NAStrangePotential() [2/2]

NAStrangePotential::NAStrangePotential ( const double  initialStrangeDensity,
DatabasePDG database 
)
inline

Definition at line 37 of file StrangePotential.h.

38  : fStrangeDensity(initialStrangeDensity),
39  fMinStrangePotential(0.0001 * GeV),
41  fNIteration(100),
42  fNSolverIteration(100),
43  fTolerance(1.e-8),
44  fDatabase(database){};

◆ ~NAStrangePotential()

NAStrangePotential::~NAStrangePotential ( )
inline

Definition at line 46 of file StrangePotential.h.

46 {};

Member Function Documentation

◆ CalculateStrangeDensity()

double NAStrangePotential::CalculateStrangeDensity ( const double  strangePotential)
private

◆ CalculateStrangePotential()

double NAStrangePotential::CalculateStrangePotential ( )

Definition at line 11 of file StrangePotential.cc.

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 }

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

Referenced by gen::Hydjet2Hadronizer::initializeForInternalPartons().

◆ operator()()

double NAStrangePotential::operator() ( const double  strangePotential)
inline

Definition at line 48 of file StrangePotential.h.

48  {
49  return (fStrangeDensity - this->CalculateStrangeDensity(strangePotential)) / fStrangeDensity;
50  }

References CalculateStrangeDensity(), and fStrangeDensity.

Referenced by CalculateStrangePotential().

◆ SetBaryonPotential()

void NAStrangePotential::SetBaryonPotential ( double  value)
inline

◆ SetMaxStrangePotential()

void NAStrangePotential::SetMaxStrangePotential ( double  value)
inline

Definition at line 55 of file StrangePotential.h.

References fMaxStrangePotential, and relativeConstraints::value.

◆ SetMinStrangePotential()

void NAStrangePotential::SetMinStrangePotential ( double  value)
inline

Definition at line 54 of file StrangePotential.h.

References fMinStrangePotential, and relativeConstraints::value.

◆ SetTemperature()

void NAStrangePotential::SetTemperature ( double  value)
inline

Member Data Documentation

◆ fBaryonPotential

double NAStrangePotential::fBaryonPotential
private

Definition at line 22 of file StrangePotential.h.

Referenced by CalculateStrangeDensity(), and SetBaryonPotential().

◆ fDatabase

DatabasePDG* NAStrangePotential::fDatabase
private

Definition at line 29 of file StrangePotential.h.

Referenced by CalculateStrangeDensity().

◆ fGc

NAStrangeDensity NAStrangePotential::fGc
private

Definition at line 30 of file StrangePotential.h.

Referenced by CalculateStrangeDensity().

◆ fMaxStrangePotential

double NAStrangePotential::fMaxStrangePotential
private

Definition at line 25 of file StrangePotential.h.

Referenced by CalculateStrangePotential(), and SetMaxStrangePotential().

◆ fMinStrangePotential

double NAStrangePotential::fMinStrangePotential
private

Definition at line 24 of file StrangePotential.h.

Referenced by CalculateStrangePotential(), and SetMinStrangePotential().

◆ fNIteration

int NAStrangePotential::fNIteration
private

Definition at line 26 of file StrangePotential.h.

Referenced by CalculateStrangePotential().

◆ fNSolverIteration

int NAStrangePotential::fNSolverIteration
private

Definition at line 27 of file StrangePotential.h.

Referenced by CalculateStrangePotential().

◆ fStrangeDensity

double NAStrangePotential::fStrangeDensity
private

Definition at line 23 of file StrangePotential.h.

Referenced by operator()().

◆ fTemperature

double NAStrangePotential::fTemperature
private

Definition at line 21 of file StrangePotential.h.

Referenced by CalculateStrangeDensity(), and SetTemperature().

◆ fTolerance

double NAStrangePotential::fTolerance
private

Definition at line 28 of file StrangePotential.h.

Referenced by CalculateStrangePotential().

NAStrangePotential::fDatabase
DatabasePDG * fDatabase
Definition: StrangePotential.h:29
NAStrangeDensity::SetStrangePotential
void SetStrangePotential(double value)
Definition: StrangeDensity.h:41
NAStrangePotential::fNIteration
int fNIteration
Definition: StrangePotential.h:26
NAStrangePotential::fGc
NAStrangeDensity fGc
Definition: StrangePotential.h:30
NAStrangePotential::fBaryonPotential
double fBaryonPotential
Definition: StrangePotential.h:22
NAStrangePotential::fTolerance
double fTolerance
Definition: StrangePotential.h:28
NAStrangePotential::fStrangeDensity
double fStrangeDensity
Definition: StrangePotential.h:23
NAEquationSolver::Brent
bool Brent(Function &theFunction)
NAStrangePotential::fNSolverIteration
int fNSolverIteration
Definition: StrangePotential.h:27
NAStrangePotential::fMaxStrangePotential
double fMaxStrangePotential
Definition: StrangePotential.h:25
NAStrangePotential::fMinStrangePotential
double fMinStrangePotential
Definition: StrangePotential.h:24
Abs
T Abs(T a)
Definition: MathUtil.h:49
NAStrangePotential::operator()
double operator()(const double strangePotential)
Definition: StrangePotential.h:48
NAEquationSolver
Definition: EquationSolver.h:18
NAEquationSolver::GetRoot
double GetRoot(void) const
Definition: EquationSolver.h:61
NAStrangeDensity::SetTemperature
void SetTemperature(double value)
Definition: StrangeDensity.h:39
GeV
const double GeV
Definition: MathUtil.h:16
NAStrangePotential::CalculateStrangeDensity
double CalculateStrangeDensity(const double strangePotential)
Definition: StrangePotential.cc:46
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
NAEquationSolver::SetIntervalLimits
void SetIntervalLimits(const double Limit1, const double Limit2)
relativeConstraints.value
value
Definition: relativeConstraints.py:53
NAStrangeDensity::StrangenessDensity
double StrangenessDensity(DatabasePDG *database)
Definition: StrangeDensity.cc:11
NAStrangeDensity::SetBaryonPotential
void SetBaryonPotential(double value)
Definition: StrangeDensity.h:40
NAStrangePotential::fTemperature
double fTemperature
Definition: StrangePotential.h:21
edm::Log
Definition: MessageLogger.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37