cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
Drawer.h
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2022-2024 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_Drawer_h
20
#define CepGen_Utils_Drawer_h
21
22
#include <cstdint>
23
24
#include "
CepGen/Modules/NamedModule.h
"
25
26
namespace
cepgen
{
27
namespace
utils {
28
class
Graph1D;
29
class
Graph2D;
30
class
Hist1D;
31
class
Hist2D;
32
class
Drawable;
34
typedef
std::vector<const Drawable*>
DrawableColl
;
36
class
Drawer
:
public
NamedModule
<Drawer> {
37
public
:
39
explicit
Drawer
(
const
ParametersList
& params);
40
41
class
Mode
{
42
public
:
43
enum
value_t
: uint16_t {
44
none
= 0,
45
logx
= 1 << 0,
46
logy
= 1 << 1,
47
logz
= 1 << 2,
48
nostack
= 1 << 3,
49
grid
= 1 << 4,
50
col
= 1 << 5,
51
cont
= 1 << 6,
52
ratio
= 1 << 7,
53
bar
= 1 << 8
54
};
55
Mode
() : value_(
none
) {}
56
Mode
(
int
val) : value_((
value_t
)val) {}
57
Mode
(
const
value_t
& val) : value_(val) {}
58
59
friend
std::ostream&
operator<<
(std::ostream&,
const
Mode
&);
60
friend
bool
operator&
(
const
Mode
&,
const
Mode::value_t
&);
61
62
const
value_t
&
value
()
const
{
return
value_; }
63
64
private
:
65
value_t
value_;
66
};
67
69
virtual
const
Drawer
&
draw
(
const
Graph1D
&,
const
Mode
& mode =
Mode::none
)
const
= 0;
71
virtual
const
Drawer
&
draw
(
const
Graph2D
&,
const
Mode
& mode =
Mode::none
)
const
= 0;
73
virtual
const
Drawer
&
draw
(
const
Hist1D
&,
const
Mode
& mode =
Mode::none
)
const
= 0;
75
virtual
const
Drawer
&
draw
(
const
Hist2D
&,
const
Mode
& mode =
Mode::none
)
const
= 0;
76
78
virtual
const
Drawer
&
draw
(
const
DrawableColl
&,
79
const
std::string&
name
=
""
,
80
const
std::string& title =
""
,
81
const
Mode
& mode =
Mode::none
)
const
= 0;
82
84
virtual
std::ostream&
operator<<
(std::ostream& os)
const
{
return
os; }
85
86
protected
:
87
friend
class
Drawable
;
88
friend
class
Graph1D
;
89
friend
class
Graph2D
;
90
friend
class
Hist1D
;
91
friend
class
Hist2D
;
92
};
93
}
// namespace utils
94
utils::Drawer::Mode
operator|
(
const
utils::Drawer::Mode
&,
const
utils::Drawer::Mode::value_t
&);
95
utils::Drawer::Mode
operator|
(
const
utils::Drawer::Mode::value_t
&,
const
utils::Drawer::Mode::value_t
&);
96
}
// namespace cepgen
97
cepgen::utils::Drawer::Mode
&
operator|=
(
cepgen::utils::Drawer::Mode
&,
const
cepgen::utils::Drawer::Mode::value_t
&);
98
99
#endif
operator|=
cepgen::utils::Drawer::Mode & operator|=(cepgen::utils::Drawer::Mode &, const cepgen::utils::Drawer::Mode::value_t &)
Definition
Drawer.cpp:67
NamedModule.h
cepgen::NamedModule
Base runtime module object.
Definition
NamedModule.h:28
cepgen::NamedModule< Drawer >::name
const std::string & name() const
Module unique indexing name.
Definition
NamedModule.h:42
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::utils::Drawable
A generic object which can be drawn in the standard output.
Definition
Drawable.h:31
cepgen::utils::Drawer::Mode
Definition
Drawer.h:41
cepgen::utils::Drawer::Mode::Mode
Mode(const value_t &val)
Definition
Drawer.h:57
cepgen::utils::Drawer::Mode::Mode
Mode()
Definition
Drawer.h:55
cepgen::utils::Drawer::Mode::operator&
friend bool operator&(const Mode &, const Mode::value_t &)
Definition
Drawer.cpp:30
cepgen::utils::Drawer::Mode::operator<<
friend std::ostream & operator<<(std::ostream &, const Mode &)
Definition
Drawer.cpp:37
cepgen::utils::Drawer::Mode::Mode
Mode(int val)
Definition
Drawer.h:56
cepgen::utils::Drawer::Mode::value_t
value_t
Definition
Drawer.h:43
cepgen::utils::Drawer::Mode::col
@ col
Definition
Drawer.h:50
cepgen::utils::Drawer::Mode::cont
@ cont
Definition
Drawer.h:51
cepgen::utils::Drawer::Mode::bar
@ bar
Definition
Drawer.h:53
cepgen::utils::Drawer::Mode::logz
@ logz
Definition
Drawer.h:47
cepgen::utils::Drawer::Mode::nostack
@ nostack
Definition
Drawer.h:48
cepgen::utils::Drawer::Mode::grid
@ grid
Definition
Drawer.h:49
cepgen::utils::Drawer::Mode::none
@ none
Definition
Drawer.h:44
cepgen::utils::Drawer::Mode::ratio
@ ratio
Definition
Drawer.h:52
cepgen::utils::Drawer::Mode::logx
@ logx
Definition
Drawer.h:45
cepgen::utils::Drawer::Mode::logy
@ logy
Definition
Drawer.h:46
cepgen::utils::Drawer::Mode::value
const value_t & value() const
Definition
Drawer.h:62
cepgen::utils::Drawer
A generic drawing utility.
Definition
Drawer.h:36
cepgen::utils::Drawer::draw
virtual const Drawer & draw(const Hist2D &, const Mode &mode=Mode::none) const =0
Draw a two-dimensional histogram.
cepgen::utils::Drawer::draw
virtual const Drawer & draw(const DrawableColl &, const std::string &name="", const std::string &title="", const Mode &mode=Mode::none) const =0
Draw a collection of drawables.
cepgen::utils::Drawer::draw
virtual const Drawer & draw(const Hist1D &, const Mode &mode=Mode::none) const =0
Draw a one-dimensional histogram.
cepgen::utils::Drawer::draw
virtual const Drawer & draw(const Graph2D &, const Mode &mode=Mode::none) const =0
Draw a two-dimensional graph.
cepgen::utils::Drawer::draw
virtual const Drawer & draw(const Graph1D &, const Mode &mode=Mode::none) const =0
Draw a one-dimensional graph.
cepgen::utils::Drawer::operator<<
virtual std::ostream & operator<<(std::ostream &os) const
Output operator (when necessary)
Definition
Drawer.h:84
cepgen::utils::Graph1D
A one-dimensional graph object.
Definition
Graph.h:29
cepgen::utils::Graph2D
A two-dimensional graph object.
Definition
Graph.h:58
cepgen::utils::Hist1D
1D histogram container
Definition
Histogram.h:72
cepgen::utils::Hist2D
2D histogram container
Definition
Histogram.h:146
cepgen::utils::DrawableColl
std::vector< const Drawable * > DrawableColl
A collection of drawable objects.
Definition
Drawer.h:34
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
cepgen::operator|
utils::Drawer::Mode operator|(const utils::Drawer::Mode::value_t &lhs, const utils::Drawer::Mode::value_t &rhs)
Definition
Drawer.cpp:61
CepGen
Utils
Drawer.h
Generated on Mon Jul 29 2024 for CepGen by
1.9.7