| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
20 class IHistogram1D;
21 }
22 // ============================================================================
23 namespace Gaudi
24 {
25 // ==========================================================================
33 class GAUDI_API Histo1DDef final
34 {
35 public:
36 // ========================================================================
43 Histo1DDef( double low, double high, int bins = 100, std::string title = "" );
44 // ========================================================================
51 Histo1DDef( std::string title = "", double low = 0.0, double high = 1.0, int bins = 100 );
52 // ========================================================================
53 public:
54 // ========================================================================
56 double lowEdge() const { return m_low; }
58 double highEdge() const { return m_high; }
60 int bins() const { return m_bins; }
62 const std::string& title() const { return m_title; }
63 // ========================================================================
64 public:
65 // ========================================================================
67 void setLowEdge( double value ) { m_low = value; }
69 void setHighEdge( double value ) { m_high = value; }
71 void setBins( int value ) { m_bins = value; }
73 void setTitle( std::string value ) { m_title = std::move( value ); }
74 // ========================================================================
75 public:
76 // ========================================================================
78 std::ostream& fillStream( std::ostream& o ) const;
79 // ========================================================================
80 public:
81 // ========================================================================
83 friend bool operator<( const Histo1DDef& left, const Histo1DDef& right );
85 friend bool operator==( const Histo1DDef& left, const Histo1DDef& right );
87 friend bool operator!=( const Histo1DDef& left, const Histo1DDef& right );
88 // ========================================================================
90 friend std::ostream& operator<<( std::ostream& o, const Gaudi::Histo1DDef& histo );
91 // ========================================================================
92 public:
93 // ========================================================================
95 bool ok() const { return 0 < bins() && lowEdge() < highEdge(); }
96 // ========================================================================
97 private:
98 // ========================================================================
99 // Histogram title
100 std::string m_title;
101 // Low Edge
102 double m_low;
103 // High Edge
104 double m_high;
105 // Number of bins
106 int m_bins;
107 // ========================================================================
108 };
109 // ==========================================================================
115 namespace Histos
116 {
117 // ========================================================================
123 GAUDI_API AIDA::IHistogram1D* book( IHistogramSvc* svc, const std::string& path, const Gaudi::Histo1DDef& hist );
124 // ========================================================================
131 GAUDI_API AIDA::IHistogram1D* book( IHistogramSvc* svc, const std::string& dir, const std::string& id,
132 const Gaudi::Histo1DDef& hist );
133 // ========================================================================
140 GAUDI_API AIDA::IHistogram1D* book( IHistogramSvc* svc, const std::string& dir, const int id,
141 const Gaudi::Histo1DDef& hist );
142 // ========================================================================
143 } // end of namespace Gaudi::Histos
144 // ==========================================================================
145 } // end of namespace Gaudi
146 // ============================================================================
147 // The END
148 // ============================================================================
149 #endif // GAUDIKERNEL_HISTODEF_H
150 // ============================================================================
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:71
operator!=
bool operator!=(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
Definition: Allocator.h:256
Kernel.h
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:58
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:56
Gaudi::Histo1DDef::setHighEdge
void setHighEdge(double value)
set high edge
Definition: HistoDef.h:69
Gaudi::Histos::book
GAUDI_API AIDA::IHistogram1D * book(IHistogramSvc *svc, const std::string &dir, const int id, const Gaudi::Histo1DDef &hist)
helper function to book 1D-histogram
Definition: HistoDef.cpp:120
AIDA
GaudiKernel.
Definition: Fill.h:10
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:62
std::string
STL class.
Gaudi::Histo1DDef::m_high
double m_high
High Edge.
Definition: HistoDef.h:104
operator==
bool operator==(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
Definition: Allocator.h:246
Gaudi::Histo1DDef
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
Definition: HistoDef.h:33
Gaudi::Histo1DDef::m_title
std::string m_title
Histogram title.
Definition: HistoDef.h:100
Gaudi::Histo1DDef::ok
bool ok() const
check if all fields are "reasonable"
Definition: HistoDef.h:95
IHistogramSvc
Definition of the IHistogramSvc interface class.
Definition: IHistogramSvc.h:47
std::move
T move(T...args)
Gaudi::Histo1DDef::setTitle
void setTitle(std::string value)
set the title
Definition: HistoDef.h:73
operator<
bool operator<(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:207
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:60
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
Gaudi::Histo1DDef::m_bins
int m_bins
Number of bins.
Definition: HistoDef.h:106
std::ostream
STL class.
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
Gaudi::Histo1DDef::m_low
double m_low
Low Edge.
Definition: HistoDef.h:102
Gaudi::Histo1DDef::setLowEdge
void setLowEdge(double value)
set low edge
Definition: HistoDef.h:67
GaudiAlg::operator<<
std::ostream & operator<<(std::ostream &str, const GaudiAlg::ID &id)
Operator overloading for ostream.
Definition: GaudiHistoID.h:136