cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
Graph.h
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2013-2022 Laurent Forthomme
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef CepGen_Utils_Graph_h
20
#define CepGen_Utils_Graph_h
21
22
#include <set>
23
24
#include "
CepGen/Utils/Drawable.h
"
25
26
namespace
cepgen
{
27
namespace
utils {
29
class
Graph1D
final :
public
Drawable
{
30
public
:
31
explicit
Graph1D
(
const
std::string&
name
=
""
,
const
std::string&
title
=
""
);
32
34
Graph1D
&
addPoint
(
double
x,
double
y);
36
Graph1D
&
addPoint
(
double
x,
double
y,
double
ex,
double
ey);
38
const
axis_t
&
points
()
const
{
return
values_; }
40
double
minimum
()
const
;
42
double
maximum
()
const
;
44
double
chi2
(
const
Graph1D
&)
const
;
45
47
std::set<double>
xCoords
()
const
;
49
const
Value
valueAt
(
double
)
const
;
50
51
bool
isGraph1D
()
const override
{
return
true
; }
52
53
private
:
54
axis_t
values_;
55
};
56
58
class
Graph2D
final :
public
Drawable
{
59
public
:
60
explicit
Graph2D
(
const
std::string&
name
=
""
,
const
std::string&
title
=
""
);
61
63
Graph2D
&
addPoint
(
double
x,
double
y,
double
z);
65
Graph2D
&
addPoint
(
double
x,
double
y,
double
z,
double
ex,
double
ey,
double
ez);
67
const
dualaxis_t
&
points
()
const
{
return
values_; }
69
void
dumpPoints
(std::ostream&)
const
;
70
72
std::set<double>
xCoords
()
const
;
74
std::set<double>
yCoords
()
const
;
76
const
Value
valueAt
(
double
,
double
)
const
;
77
78
bool
isGraph2D
()
const override
{
return
true
; }
79
80
private
:
81
dualaxis_t
values_;
82
};
83
}
// namespace utils
84
}
// namespace cepgen
85
86
#endif
Drawable.h
cepgen::Value
A scalar value with its uncertainty.
Definition
Value.h:26
cepgen::utils::Drawable
A generic object which can be drawn in the standard output.
Definition
Drawable.h:31
cepgen::utils::Drawable::axis_t
std::map< coord_t, Value > axis_t
Metadata for an axis (coordinates and bins value)
Definition
Drawable.h:95
cepgen::utils::Drawable::name
const std::string & name() const
Drawable name.
Definition
Drawable.h:37
cepgen::utils::Drawable::title
const std::string & title() const
Drawable name.
Definition
Drawable.h:42
cepgen::utils::Drawable::dualaxis_t
std::map< coord_t, axis_t > dualaxis_t
Metadata for a two-dimensional axis definition (coordinates and bins values)
Definition
Drawable.h:103
cepgen::utils::Graph1D
A one-dimensional graph object.
Definition
Graph.h:29
cepgen::utils::Graph1D::minimum
double minimum() const
Minimum value registered in this graph.
Definition
Graph.cpp:40
cepgen::utils::Graph1D::chi2
double chi2(const Graph1D &) const
Compute the between this graph and another.
Definition
Graph.cpp:48
cepgen::utils::Graph1D::addPoint
Graph1D & addPoint(double x, double y)
Add one value to the graph.
Definition
Graph.cpp:30
cepgen::utils::Graph1D::points
const axis_t & points() const
Retrieve all values in the graph.
Definition
Graph.h:38
cepgen::utils::Graph1D::xCoords
std::set< double > xCoords() const
List of horizontal axis coordinates.
Definition
Graph.cpp:66
cepgen::utils::Graph1D::maximum
double maximum() const
Maximum value registered in this graph.
Definition
Graph.cpp:44
cepgen::utils::Graph1D::valueAt
const Value valueAt(double) const
Retrieve the value of the graph at a given coordinate.
Definition
Graph.cpp:73
cepgen::utils::Graph1D::isGraph1D
bool isGraph1D() const override
Is this drawable a one-dimensional graph?
Definition
Graph.h:51
cepgen::utils::Graph2D
A two-dimensional graph object.
Definition
Graph.h:58
cepgen::utils::Graph2D::addPoint
Graph2D & addPoint(double x, double y, double z)
Add one value to the graph.
Definition
Graph.cpp:82
cepgen::utils::Graph2D::yCoords
std::set< double > yCoords() const
List of vertical axis coordinates.
Definition
Graph.cpp:107
cepgen::utils::Graph2D::points
const dualaxis_t & points() const
Retrieve all values in the graph.
Definition
Graph.h:67
cepgen::utils::Graph2D::xCoords
std::set< double > xCoords() const
List of horizontal axis coordinates.
Definition
Graph.cpp:100
cepgen::utils::Graph2D::isGraph2D
bool isGraph2D() const override
Is this drawable a two-dimensional graph?
Definition
Graph.h:78
cepgen::utils::Graph2D::dumpPoints
void dumpPoints(std::ostream &) const
List all values registered in the graph.
Definition
Graph.cpp:92
cepgen::utils::Graph2D::valueAt
const Value valueAt(double, double) const
Retrieve the value of the graph at the given coordinates.
Definition
Graph.cpp:115
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
CepGen
Utils
Graph.h
Generated on Mon Jul 29 2024 for CepGen by
1.9.7