a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
SpectrumPlotter.hpp
Go to the documentation of this file.
1/*
2 * SpectrumPlotter.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 SPECTRUMPLOTTER_HPP_
15#define SPECTRUMPLOTTER_HPP_
16
17#include <cstdlib>
18#include <fstream>
19#include <string>
20#include <list>
21#include <map>
23#include "../SLHA/BlockTypes.hpp"
24#include "../SSP/LineData.hpp"
25
26namespace LHPC
27{
28 namespace SLHA
29 {
30 // this class does the job of reading in data from a SLHA MASS or FMASS
31 // block & plotting it according to a LHPCPLOTTING block.
33 {
34 public:
36 typedef std::map< int, std::string > LineMap;
37 typedef std::list< SpectrumPlotting::LineData > LineList;
40
43 FmassBlock const* const fmassPointer,
44 MassBlock const* const massPointer = NULL );
45 virtual
47
48 bool
49 plotSpectrum( std::string const& plotFileName,
50 bool const shouldCleanUp = true );
51
52
53 protected:
54 static int const unitIndex;
55 static int const scaleIndex;
56 static int const labelYSizeIndex;
57 static int const labelXSizeIndex;
58 static int const gnuplotIndex;
59 static int const latexIndex;
60 static int const dvipsIndex;
61 static int const ps2epsIndex;
62 static int const rmIndex;
63 static int const mvIndex;
64 static std::string const gnuplotDataFileName;
65 static std::string const gnuplotCommandFileName;
66 static std::string const gnuplotTexBaseName;
67 static std::string const fullLatexBaseName;
68 static double const automaticScaleFactor;
69 static double const labelSeparationShuffleFactor;
70 static double const marginWidth;
71 static double const joinerWidth;
72 static double const flatBitWidth;
73 static double const columnPairOffset;
75
79 MassBlock const* const massPointer;
80 std::string unitString;
81 double unitFactor;
87 LineMap::const_iterator lineIterator;
89 std::list< SpectrumPlotting::LineData >::iterator lowerMassIterator;
90 std::list< SpectrumPlotting::LineData >::iterator upperMassIterator;
94 double massValue;
102 std::string fullLatexFilename;
103 std::string gnuplotCommand;
104 std::string latexCommand;
105 std::string dvipsCommand;
106 std::string ps2epsCommand;
109 std::string moveCommand;
116
117 void
118 loadCommands( std::string const& plotFileName );
119 void
120 loadLines();
121 void
122 sortMasses();
123 // this sorts all the masses in the columns, & then sets the scale range.
124 void
125 floatLabels();
126 // this tries to move all the labels up or down until they are all
127 // separated by ( labelSeparation * scaleMaximum ).
128 bool
130 };
131
132 }
133
134}
135
136#endif /* SPECTRUMPLOTTER_HPP_ */
SparseSinglyIndexedBlock< RunningConstant > FmassBlock
static std::string const fullLatexBaseName
LineMap::const_iterator lineIterator
std::list< SpectrumPlotting::LineData >::iterator upperMassIterator
BOL::VectorlikeArray< LineList > columnSet
static std::string const gnuplotCommandFileName
static std::string const gnuplotDataFileName
static int const labelXSizeIndex
MassBlock const *const massPointer
static double const joinerWidth
SpectrumPlotting::LineData lineAdder
static std::string const gnuplotTexBaseName
static double const automaticScaleFactor
static int const labelYSizeIndex
static double const marginWidth
SparseSinglyIndexedBlock< double > MassBlock
FmassBlock const *const fmassPointer
static int const maximumLabelFloatingShuffles
StringBlock const & plotControlBlock
SpectrumPlotter(StringBlock const &plotControlBlock, StringBlock const &linePlottingBlock, FmassBlock const *const fmassPointer, MassBlock const *const massPointer=NULL)
void loadCommands(std::string const &plotFileName)
std::list< SpectrumPlotting::LineData > LineList
StringBlock const & linePlottingBlock
std::list< SpectrumPlotting::LineData >::iterator lowerMassIterator
static double const flatBitWidth
SparseSinglyIndexedBlock< std::string > StringBlock
bool plotSpectrum(std::string const &plotFileName, bool const shouldCleanUp=true)
std::map< int, std::string > LineMap
static double const labelSeparationShuffleFactor
static double const columnPairOffset