| The Gaudi Framework v32r1 (f65d50dc)

HistoDef.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_HISTODEF_H
2 #define GAUDIKERNEL_HISTODEF_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <iosfwd>
9 #include <string>
10 // ============================================================================
11 // Gaudi
12 // ============================================================================
13 #include "GaudiKernel/Kernel.h"
14 // ============================================================================
15 // Forward decalrations
16 // ============================================================================
17 class IHistogramSvc;
18 namespace AIDA {
19 class IHistogram1D;
20 } // namespace AIDA
21 // ============================================================================
22 namespace Gaudi {
23 // ==========================================================================
31 class GAUDI_API Histo1DDef final {
32 public:
33 // ========================================================================
40 Histo1DDef( double low, double high, int bins = 100, std::string title = "" );
41 // ========================================================================
48 Histo1DDef( std::string title = "", double low = 0.0, double high = 1.0, int bins = 100 );
49 // ========================================================================
50 public:
51 // ========================================================================
53 double lowEdge() const { return m_low; }
55 double highEdge() const { return m_high; }
57 int bins() const { return m_bins; }
59 const std::string& title() const { return m_title; }
60 // ========================================================================
61 public:
62 // ========================================================================
64 void setLowEdge( double value ) { m_low = value; }
66 void setHighEdge( double value ) { m_high = value; }
68 void setBins( int value ) { m_bins = value; }
70 void setTitle( std::string value ) { m_title = std::move( value ); }
71 // ========================================================================
72 public:
73 // ========================================================================
75 std::ostream& fillStream( std::ostream& o ) const;
76 // ========================================================================
77 public:
78 // ========================================================================
80 friend bool operator<( const Histo1DDef& left, const Histo1DDef& right );
82 friend bool operator==( const Histo1DDef& left, const Histo1DDef& right );
84 friend bool operator!=( const Histo1DDef& left, const Histo1DDef& right );
85 // ========================================================================
87 friend std::ostream& operator<<( std::ostream& o, const Gaudi::Histo1DDef& histo );
88 // ========================================================================
89 public:
90 // ========================================================================
92 bool ok() const { return 0 < bins() && lowEdge() < highEdge(); }
93 // ========================================================================
94 private:
95 // ========================================================================
96 // Histogram title
97 std::string m_title;
98 // Low Edge
99 double m_low;
100 // High Edge
101 double m_high;
102 // Number of bins
103 int m_bins;
104 // ========================================================================
105 };
106 // ==========================================================================
112 namespace Histos {
113 // ========================================================================
119 GAUDI_API AIDA::IHistogram1D* book( IHistogramSvc* svc, const std::string& path, const Gaudi::Histo1DDef& hist );
120 // ========================================================================
127 GAUDI_API AIDA::IHistogram1D* book( IHistogramSvc* svc, const std::string& dir, const std::string& id,
128 const Gaudi::Histo1DDef& hist );
129 // ========================================================================
136 GAUDI_API AIDA::IHistogram1D* book( IHistogramSvc* svc, const std::string& dir, const int id,
137 const Gaudi::Histo1DDef& hist );
138 // ========================================================================
139 } // namespace Histos
140 // ==========================================================================
141 } // end of namespace Gaudi
142 // ============================================================================
143 // The END
144 // ============================================================================
145 #endif // GAUDIKERNEL_HISTODEF_H
Histos
helper namespace to collect useful definitions, types, constants and functions, related to manipulati...
Gaudi::Histo1DDef::setBins
void setBins(int value)
set number of bis
Definition: HistoDef.h:68
Kernel.h
Gaudi::operator!=
bool operator!=(const T &v, const Property< TP, V, H > &p)
delegate (value != property) to property operator!=
Definition: Property.h:702
Gaudi::operator==
bool operator==(const T &v, const Property< TP, V, H > &p)
delegate (value == property) to property operator==
Definition: Property.h:696
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
Gaudi::Histos::book
GAUDI_API AIDA::IHistogram1D * book(IHistogramSvc *svc, const std::string &path, const Gaudi::Histo1DDef &hist)
helper function to book 1D-histogram
Definition: HistoDef.cpp:87
Gaudi::Histo1DDef::setHighEdge
void setHighEdge(double value)
set high edge
Definition: HistoDef.h:66
AIDA
GaudiKernel.
Definition: Fill.h:10
std::string
STL class.
Gaudi::Histo1DDef::m_high
double m_high
High Edge.
Definition: HistoDef.h:101
Gaudi::Histo1DDef
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
Definition: HistoDef.h:31
Gaudi::Histo1DDef::m_title
std::string m_title
Histogram title.
Definition: HistoDef.h:97
IHistogramSvc
Definition of the IHistogramSvc interface class.
Definition: IHistogramSvc.h:46
std::move
T move(T... args)
Gaudi::Histo1DDef::setTitle
void setTitle(std::string value)
set the title
Definition: HistoDef.h:70
Gaudi::Histo1DDef::ok
bool ok() const
check if all fields are "reasonable"
Definition: HistoDef.h:92
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:59
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:57
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:55
Gaudi::Histo1DDef::m_bins
int m_bins
Number of bins.
Definition: HistoDef.h:103
std::ostream
STL class.
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
Gaudi::Histo1DDef::m_low
double m_low
Low Edge.
Definition: HistoDef.h:99
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:53
Gaudi::operator<
bool operator<(const Gaudi::Histo1DDef &left, const Gaudi::Histo1DDef &right)
Definition: HistoDef.cpp:49
Gaudi::Histo1DDef::setLowEdge
void setLowEdge(double value)
set low edge
Definition: HistoDef.h:64
Gaudi::operator<<
std::ostream & operator<<(std::ostream &o, const Gaudi::StringKey &key)
printout of the object reply on the native printout for the string
Definition: StringKey.h:235