a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
RunningConstant.hpp
Go to the documentation of this file.
1/*
2 * RunningConstant.hpp
3 *
4 * Created on: Apr 1, 2012 (really!)
5 * Author: Ben O'Leary (benjamin.oleary@gmail.com)
6 * Copyright 2012 Ben O'Leary
7 *
8 * This file is part of LesHouchesParserClasses, released under the
9 * GNU General Public License. Please see the accompanying
10 * README.LHPC_CPP.txt file for a full list of files, brief documentation
11 * on how to use these classes, and further details on the license.
12 */
13
14#ifndef RUNNINGCONSTANT_HPP_
15#define RUNNINGCONSTANT_HPP_
16
17#include <string>
19
20namespace LHPC
21{
22 // this is a class to hold the information about the mass of a particle in
23 // the FLHA format.
25 {
26 public:
28 RunningConstant( RunningConstant const& copySource );
30
31 double
32 getValue() const;
33 int
34 getScheme() const;
35 double
36 getScale() const;
37 void
38 setValues( double const valueDouble,
39 int const schemeType,
40 double const evaluationScale );
41 void
42 setFromString( std::string const& valuesString );
43 std::string
44 getAsString() const;
45
46
47 protected:
51 };
52
53
54
55
56
57 inline double
59 {
60 return valueDouble;
61 }
62
63 inline int
65 {
66 return schemeType;
67 }
68
69 inline double
71 {
72 return evaluationScale;
73 }
74
75 inline void
76 RunningConstant::setValues( double const valueDouble,
77 int const schemeType,
78 double const evaluationScale )
79 {
80 this->valueDouble = valueDouble;
81 this->schemeType = schemeType;
82 this->evaluationScale = evaluationScale;
83 }
84
85 inline void
86 RunningConstant::setFromString( std::string const& valuesString )
87 {
88 std::string firstRemainder;
89 std::string secondRemainder;
92 valuesString,
93 &firstRemainder,
97 firstRemainder,
98 &secondRemainder,
101 }
102
103 inline std::string
105 {
106 std::string returnString( BOL::StringParser::doubleToString( valueDouble,
107 9,
108 3 ) );
109 returnString.append( " " );
110 returnString.append( BOL::StringParser::intToString( schemeType,
111 2,
112 "",
113 "-",
114 ' ' ) );
115 returnString.append( " " );
117 9,
118 3 ) );
119 return returnString;
120 }
121
122}
123
124#endif /* RUNNINGCONSTANT_HPP_ */
static std::string firstWordOf(std::string const &stringToParse, std::string *const remainderString=NULL, std::string const &separatorChars=whitespaceChars)
static std::string const whitespaceAndNewlineChars
static double stringToDouble(std::string const &stringToInterpret)
static std::string intToString(int inputInt, int const minimumNumberOfDigits, std::string const prefixForPositiveNumbers="+", std::string const prefixForNegativeNumbers="-", char const paddingChar='0')
static std::string doubleToString(double inputDouble, int const numberOfMantissaDigits, int const numberOfExponentDigits, std::string const prefixForPositiveNumbers="+", std::string const prefixForNegativeNumbers="-", std::string const positiveExponentPrefix="+", std::string const negativeExponentPrefix="-", std::string const exponentCharacter="E")
static int stringToInt(std::string const &stringToInterpret)
void setValues(double const valueDouble, int const schemeType, double const evaluationScale)
std::string getAsString() const
void setFromString(std::string const &valuesString)