ModelParameter Class Reference

A class for model parameters. More...

#include <ModelParameter.h>

Detailed Description

A class for model parameters.

Author
HEPfit Collaboration

This class stores the details of the model parameters defined in the SomeModel.conf file or specified by the user. The name of the model parameter has to correspond to the list of names in the SomeModel.cpp file in the Model src directories.
e.g. GF, which can be found in StandardModel.cpp file in the StandardModel project source folder StandardModel/src.

Definition at line 28 of file ModelParameter.h.

Public Member Functions

double getave () const
 A get method to get the average. More...
 
std::string getCgp_name () const
 A get method to get the name of the set of correlated parameter. More...
 
double geterrf () const
 A get method to get the flat error. More...
 
double geterrg () const
 A get method to get the gaussian error. More...
 
double getmax () const
 A get method to get the maximum value. More...
 
double getmin () const
 A get method to get the minimum value. More...
 
std::string getname () const
 A get method to get the name of each parameter. More...
 
bool IsCorrelated () const
 A method to check if the parameters are correlated or not. More...
 
bool IsFixed () const
 A method to check if the parameter is fixed. More...
 
 ModelParameter (std::string name_in, double ave_in, double errg_in, double errf_in)
 Constructor. More...
 
 ModelParameter ()
 Constructor. More...
 
boost::tokenizer< boost::char_separator< char > >::iterator & ParseModelParameter (boost::tokenizer< boost::char_separator< char > >::iterator &beg)
 Parser for model parameters. More...
 
void setCgp_name (std::string cgp_name)
 A set method to set the name of the set of correlated parameter. More...
 
virtual ~ModelParameter ()
 The default destructor. More...
 

Private Attributes

double ave
 The average value of the model parameter. More...
 
std::string cgp_name
 
double errf
 The flat error of the model parameter. More...
 
double errg
 The Gaussian error of the model parameter. More...
 
bool isFixed
 A boolean flag that is true if the parameter is fixed. More...
 
double max
 The maximum value of the model parameter. More...
 
double min
 The minimum value of the model parameter. More...
 
std::string name
 The name of the model parameter. More...
 

Friends

std::ostream & operator<< (std::ostream &output, const ModelParameter &m)
 Befriending of the std::ostream operator << to generate an output stream for printing the model parameters. More...
 

Constructor & Destructor Documentation

ModelParameter::ModelParameter ( std::string  name_in,
double  ave_in,
double  errg_in,
double  errf_in 
)

Constructor.

Parameters
[in]name_inthe name for the model parameter
[in]ave_inthe average value for the model parameter
[in]errg_inthe gaussian error for the model parameter
[in]errf_inthe flat error for the model parameter

Definition at line 10 of file ModelParameter.cpp.

11 {
12  name = name_in;
13  ave = ave_in;
14  errg = errg_in;
15  errf = errf_in;
16  min = ave - errf - 5.*errg;
17  max = ave + errf + 5.*errg;
18  cgp_name.clear();
19  if(errg == 0. && errf == 0.)
20  isFixed = true;
21  else
22  isFixed = false;
23 }
std::string name
The name of the model parameter.
std::string cgp_name
bool isFixed
A boolean flag that is true if the parameter is fixed.
double min
The minimum value of the model parameter.
double errg
The Gaussian error of the model parameter.
double ave
The average value of the model parameter.
double max
The maximum value of the model parameter.
double errf
The flat error of the model parameter.
ModelParameter::ModelParameter ( )

Constructor.

Definition at line 25 of file ModelParameter.cpp.

26 {}
ModelParameter::~ModelParameter ( )
virtual

The default destructor.

Definition at line 28 of file ModelParameter.cpp.

29 {
30 }

Member Function Documentation

double ModelParameter::getave ( ) const
inline

A get method to get the average.

Returns
the average of the parameter

Definition at line 78 of file ModelParameter.h.

79  {
80  return ave;
81  }
double ave
The average value of the model parameter.
std::string ModelParameter::getCgp_name ( ) const
inline

A get method to get the name of the set of correlated parameter.

Returns
a string that contains the name

Definition at line 132 of file ModelParameter.h.

133  {
134  return cgp_name;
135  }
std::string cgp_name
double ModelParameter::geterrf ( ) const
inline

A get method to get the flat error.

Returns
the flat error of the parameter

Definition at line 87 of file ModelParameter.h.

88  {
89  return errf;
90  }
double errf
The flat error of the model parameter.
double ModelParameter::geterrg ( ) const
inline

A get method to get the gaussian error.

Returns
the Gaussian error of the parameter

Definition at line 96 of file ModelParameter.h.

97  {
98  return errg;
99  }
double errg
The Gaussian error of the model parameter.
double ModelParameter::getmax ( ) const
inline

A get method to get the maximum value.

Returns
the maximum value of the parameter

Definition at line 114 of file ModelParameter.h.

115  {
116  return max;
117  }
double max
The maximum value of the model parameter.
double ModelParameter::getmin ( ) const
inline

A get method to get the minimum value.

Returns
the minimum value of the parameter

Definition at line 105 of file ModelParameter.h.

106  {
107  return min;
108  }
double min
The minimum value of the model parameter.
std::string ModelParameter::getname ( ) const
inline

A get method to get the name of each parameter.

Returns
a string that contains the name

Definition at line 69 of file ModelParameter.h.

70  {
71  return name;
72  }
std::string name
The name of the model parameter.
bool ModelParameter::IsCorrelated ( ) const
inline

A method to check if the parameters are correlated or not.

Returns
a boolean which is true of the parameters are correlated

Definition at line 60 of file ModelParameter.h.

61  {
62  return(!cgp_name.empty());
63  }
std::string cgp_name
bool ModelParameter::IsFixed ( ) const
inline

A method to check if the parameter is fixed.

Returns
a boolean that is true if the parameter is fixed

Definition at line 123 of file ModelParameter.h.

124  {
125  return isFixed;
126  }
bool isFixed
A boolean flag that is true if the parameter is fixed.
boost::tokenizer< boost::char_separator< char > >::iterator & ModelParameter::ParseModelParameter ( boost::tokenizer< boost::char_separator< char > >::iterator &  beg)

Parser for model parameters.

Parameters
[in]begiterator for reading the model parameter

Definition at line 39 of file ModelParameter.cpp.

40 {
41 
42  name = *beg;
43  ++beg;
44  ave = atof((*beg).c_str());
45  ++beg;
46  errg = atof((*beg).c_str());
47  ++beg;
48  errf = atof((*beg).c_str());
49  ++beg;
50  min = ave - errf - 5.*errg;
51  max = ave + errf + 5.*errg;
52 
53  cgp_name.clear();
54  if(errg == 0. && errf == 0.)
55  isFixed = true;
56  else
57  isFixed = false;
58 
59  return beg;
60 }
std::string name
The name of the model parameter.
std::string cgp_name
bool isFixed
A boolean flag that is true if the parameter is fixed.
double min
The minimum value of the model parameter.
double errg
The Gaussian error of the model parameter.
double ave
The average value of the model parameter.
double max
The maximum value of the model parameter.
double errf
The flat error of the model parameter.
void ModelParameter::setCgp_name ( std::string  cgp_name)
inline

A set method to set the name of the set of correlated parameter.

Definition at line 140 of file ModelParameter.h.

141  {
142  this->cgp_name = cgp_name;
143  }
std::string cgp_name

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const ModelParameter m 
)
friend

Befriending of the std::ostream operator << to generate an output stream for printing the model parameters.

Parameters
[out]outputthe formatted output stream to print the model parameters
[in]ma reference to an object of type ModelParameter()

Definition at line 32 of file ModelParameter.cpp.

33 {
34  output << "ModelParameter name, average, gaussian error, flat error" << std::endl;
35  output << m.name << " " << m.ave << " " << m.errg << " " << m.errf << std::endl;
36  return output;
37 }
std::string name
The name of the model parameter.
double errg
The Gaussian error of the model parameter.
double ave
The average value of the model parameter.
double errf
The flat error of the model parameter.

Member Data Documentation

double ModelParameter::ave
private

The average value of the model parameter.

Definition at line 155 of file ModelParameter.h.

std::string ModelParameter::cgp_name
private

Definition at line 161 of file ModelParameter.h.

double ModelParameter::errf
private

The flat error of the model parameter.

Definition at line 157 of file ModelParameter.h.

double ModelParameter::errg
private

The Gaussian error of the model parameter.

Definition at line 156 of file ModelParameter.h.

bool ModelParameter::isFixed
private

A boolean flag that is true if the parameter is fixed.

Definition at line 160 of file ModelParameter.h.

double ModelParameter::max
private

The maximum value of the model parameter.

Definition at line 159 of file ModelParameter.h.

double ModelParameter::min
private

The minimum value of the model parameter.

Definition at line 158 of file ModelParameter.h.

std::string ModelParameter::name
private

The name of the model parameter.

Definition at line 154 of file ModelParameter.h.


The documentation for this class was generated from the following files: