a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
LineData.hpp
Go to the documentation of this file.
1/*
2 * LineData.hpp
3 *
4 * Created on: Feb 26, 2012
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 LINEPLOTTINGDATA_HPP_
15#define LINEPLOTTINGDATA_HPP_
16
17#include <string>
19
20namespace LHPC
21{
22 namespace SLHA
23 {
24 namespace SpectrumPlotting
25 {
26 // this class holds the co-ordinates of the line to plot to visualize the
27 // mass of a particle from an SLHA file, along with the label.
29 {
30 public:
32 {
36 };
37
38 static bool
39 lowToHigh( LineData const& firstLineData,
40 LineData const& secondLineData );
41 // this returns true if firstLineData has a valueDouble lower than or
42 // equal to that of secondLineData.
43
44 LineData();
45 LineData( LineData const& copySource );
46 ~LineData();
47
48 void
49 setValues( std::string const& dataString,
50 double const massValue );
52 getJustification() const;
53 void
55 int
56 getColumn() const;
57 double
58 getMass() const;
59 double
60 getLabelPosition() const;
61 void
62 setLabelPosition( double const labelPosition );
63 std::string const&
64 getLabelString() const;
65 void
66 relabelForOverlargeMass( double const scaleMaximum );
67 std::string const&
68 getColor() const;
69
70
71 protected:
73
76 double massValue;
78 std::string labelString;
79 std::string colorString;
80 std::string remainderString;
81 };
82
83
84
85
86
87 inline bool
88 LineData::lowToHigh( LineData const& firstLineData,
89 LineData const& secondLineData )
90 // this returns true if firstLineData has a valueDouble lower than or
91 // equal to that of secondLineData.
92 {
93 if( firstLineData.getMass() > secondLineData.getMass() )
94 {
95 return false;
96 }
97 else
98 {
99 return true;
100 }
101 }
102
105 {
106 return whichJustification;
107 }
108
109 inline void
111 LineData::JustificationStyle const whichJustification )
112 {
113 this->whichJustification = whichJustification;
114 }
115
116 inline int
118 {
119 return columnIndex;
120 }
121
122 inline double
124 {
125 return massValue;
126 }
127
128 inline double
130 {
131 return labelPosition;
132 }
133
134 inline void
135 LineData::setLabelPosition( double const labelPosition )
136 {
137 this->labelPosition = labelPosition;
138 }
139
140 inline std::string const&
142 {
143 return labelString;
144 }
145
146 inline void
147 LineData::relabelForOverlargeMass( double const scaleMaximum )
148 {
150 labelString.append( "{\\footnotesize (" );
152 labelString.append( ")}" );
153 labelPosition = ( 0.99 * scaleMaximum );
154 }
155
156 inline std::string const&
158 {
159 return colorString;
160 }
161
162 }
163
164 }
165
166}
167
168#endif /* LINEPLOTTINGDATA_HPP_ */
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")
JustificationStyle whichJustification
Definition: LineData.hpp:75
static BOL::StringParser const overlargeMassPrinter
Definition: LineData.hpp:72
JustificationStyle getJustification() const
Definition: LineData.hpp:104
std::string const & getColor() const
Definition: LineData.hpp:157
void relabelForOverlargeMass(double const scaleMaximum)
Definition: LineData.hpp:147
std::string const & getLabelString() const
Definition: LineData.hpp:141
void setJustification(JustificationStyle const whichJustification)
Definition: LineData.hpp:110
void setValues(std::string const &dataString, double const massValue)
Definition: LineData.cpp:63
static bool lowToHigh(LineData const &firstLineData, LineData const &secondLineData)
Definition: LineData.hpp:88
void setLabelPosition(double const labelPosition)
Definition: LineData.hpp:135