a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
SlhaValuePlotLine.hpp
Go to the documentation of this file.
1/*
2 * SlhaValuePlotLine.hpp
3 *
4 * Created on: Mar 22, 2015
5 * Author: Ben O'Leary (benjamin.oleary@gmail.com)
6 * Copyright 2015 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 SLHAVALUEPLOTLINE_HPP_
15#define SLHAVALUEPLOTLINE_HPP_
16
17#include <string>
18#include <map>
19#include <fstream>
20#include "../SLHA/SlhaSimplisticInterpreter.hpp"
21#include "../BOLlib/include/AsciiXmlParser.hpp"
22#include "../BOLlib/include/StringParser.hpp"
26
27namespace LHPC
28{
29 namespace SLHA
30 {
31
33 {
34 public:
35 static bool
36 lowToHigh( SlhaValuePlotLine const& firstLine,
37 SlhaValuePlotLine const& secondLine )
38 { return ( firstLine.getValue() <= secondLine.getValue() ); }
39
40 SlhaValuePlotLine( double const slhaValue,
41 double const columnCenterPosition,
42 double const columnLineWidth,
43 double const columnPairOffset,
44 double const labelJoinerWidth,
45 std::string const& labelString,
46 bool const labelLeftOfColumn,
48 SlhaValuePlotLine( SlhaValuePlotLine const& copySource );
50
51 double getValue() const { return slhaValue; }
52 void setValue( double const slhaValue ) { this->slhaValue = slhaValue; }
53
54 double getLabelPosition() const { return labelVerticalPosition; }
55 void setLabelPosition( double const labelPosition )
56 { this->labelVerticalPosition = labelPosition; }
57
59
60 // This places the label just below the upper edge of the plot, and
61 // appends the value in brackets to the label.
62 void relabelForAboveRange( double const verticalAxisUpperRange );
63
64 // This writes the line as a segment or series of segments defined as
65 // lines themselves in gnuplotDataFile, using gnuplotLineIndex to keep
66 // handles on the lines and their styles.
67 void writeLineData( int& gnuplotLineIndex,
68 std::ofstream& gnuplotDataFile,
69 std::ofstream& gnuplotCommandFile );
70
71 // This writes input to have gnuplot print the line label correctly.
72 void writeLabel( std::ofstream& gnuplotCommandFile );
73
74
75 protected:
76 static std::string joinerColor;
78
79 double slhaValue;
84 std::string labelString;
88 };
89
90
91
92
93
94 // This places the label just below the upper edge of the plot, and
95 // appends the value in brackets to the label.
96 inline void
97 SlhaValuePlotLine::relabelForAboveRange( double const scaleMaximum )
98 {
99 labelLeftOfColumn = true;
100 valueAbovePlotRange = true;
101 labelString.append( "{\\footnotesize (" );
103 labelString.append( ")}" );
104 labelVerticalPosition = ( 0.99 * scaleMaximum );
108 }
109
110 } /* namespace SLHA */
111} /* namespace LHPC */
112
113#endif /* SLHAVALUEPLOTLINE_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")
void setValue(double const slhaValue)
void writeLabel(std::ofstream &gnuplotCommandFile)
SlhaValueLineColoring const * lineColoring
SlhaValuePlotLine(double const slhaValue, double const columnCenterPosition, double const columnLineWidth, double const columnPairOffset, double const labelJoinerWidth, std::string const &labelString, bool const labelLeftOfColumn, SlhaValueLineColoring const *lineColoring)
void writeLineData(int &gnuplotLineIndex, std::ofstream &gnuplotDataFile, std::ofstream &gnuplotCommandFile)
void setLabelPosition(double const labelPosition)
static BOL::StringParser const overlargeValuePrinter
void relabelForAboveRange(double const verticalAxisUpperRange)
static bool lowToHigh(SlhaValuePlotLine const &firstLine, SlhaValuePlotLine const &secondLine)