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 { class IHistogram1D ; }
19 // ============================================================================
20 namespace Gaudi
21 {
22  // ==========================================================================
31  {
32  public:
33  // ========================================================================
41  ( double low ,
42  double high ,
43  int bins = 100 ,
44  std::string title = "" );
45  // ========================================================================
53  ( std::string title = "" ,
54  double low = 0.0 ,
55  double high = 1.0 ,
56  int bins = 100 ) ;
57  // ========================================================================
59  virtual ~Histo1DDef( ) = default;
60  // ========================================================================
61  public:
62  // ========================================================================
64  double lowEdge () const { return m_low ; }
66  double highEdge () const { return m_high ; }
68  int bins () const { return m_bins ; }
70  const std::string& title () const { return m_title ; }
71  // ========================================================================
72  public:
73  // ========================================================================
75  void setLowEdge ( double value ) { m_low = value ; }
77  void setHighEdge ( double value ) { m_high = value ; }
79  void setBins ( int value ) { m_bins = value ; }
81  void setTitle ( std::string value ) { m_title = std::move(value); }
82  // ========================================================================
83  public:
84  // ========================================================================
86  std::ostream& fillStream ( std::ostream& o ) const ;
87  // ========================================================================
88  public:
89  // ========================================================================
91  bool operator< ( const Histo1DDef& right ) const ;
93  bool operator==( const Histo1DDef& right ) const ;
95  bool operator!=( const Histo1DDef& right ) const ;
96  // ========================================================================
97  public:
98  // ========================================================================
100  bool ok () const { return 0 < bins() && lowEdge() < highEdge() ; }
101  // ========================================================================
102  private:
103  // ========================================================================
104  // Histogram title
106  // Low Edge
107  double m_low ;
108  // High Edge
109  double m_high ;
110  // Number of bins
111  int m_bins ;
112  // ========================================================================
113  };
114  // ==========================================================================
117  operator<<( std::ostream& o , const Gaudi::Histo1DDef& histo ) ;
118  // ==========================================================================
124  namespace Histos
125  {
126  // ========================================================================
132  GAUDI_API AIDA::IHistogram1D* book
133  ( IHistogramSvc* svc ,
134  const std::string& path ,
135  const Gaudi::Histo1DDef& hist ) ;
136  // ========================================================================
143  GAUDI_API AIDA::IHistogram1D* book
144  ( IHistogramSvc* svc ,
145  const std::string& dir ,
146  const std::string& id ,
147  const Gaudi::Histo1DDef& hist ) ;
148  // ========================================================================
155  GAUDI_API AIDA::IHistogram1D* book
156  ( IHistogramSvc* svc ,
157  const std::string& dir ,
158  const int id ,
159  const Gaudi::Histo1DDef& hist ) ;
160  // ========================================================================
161  } // end of namespace Gaudi::Histos
162  // ==========================================================================
163 } // end of namespace Gaudi
164 // ============================================================================
165 // The END
166 // ============================================================================
167 #endif // GAUDIKERNEL_HISTODEF_H
168 // ============================================================================
helper namespace to collect useful definitions, types, constants and functions, related to manipulati...
void setBins(int value)
set number of bis
Definition: HistoDef.h:79
bool operator!=(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
Definition: Allocator.h:261
GAUDI_API std::ostream & operator<<(std::ostream &o, const Gaudi::Histo1DDef &histo)
the streamer operator for class Gaudi::Histo1DDef
Definition: HistoDef.cpp:109
double highEdge() const
get the high edge
Definition: HistoDef.h:66
double lowEdge() const
get the low edge
Definition: HistoDef.h:64
void setHighEdge(double value)
set high edge
Definition: HistoDef.h:77
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:161
GaudiKernel.
Definition: Fill.h:8
const std::string & title() const
get the title
Definition: HistoDef.h:70
STL class.
double m_high
High Edge.
Definition: HistoDef.h:109
bool operator==(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
Definition: Allocator.h:249
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
Definition: HistoDef.h:30
std::string m_title
Histogram title.
Definition: HistoDef.h:105
bool ok() const
check if all fields are "reasonable"
Definition: HistoDef.h:100
Definition of the IHistogramSvc interface class.
Definition: IHistogramSvc.h:47
T move(T...args)
void setTitle(std::string value)
set the title
Definition: HistoDef.h:81
bool operator<(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:185
int bins() const
get the number of bins
Definition: HistoDef.h:68
#define GAUDI_API
Definition: Kernel.h:107
int m_bins
Number of bins.
Definition: HistoDef.h:111
STL class.
Helper functions to set/get the application return code.
Definition: __init__.py:1
double m_low
Low Edge.
Definition: HistoDef.h:107
void setLowEdge(double value)
set low edge
Definition: HistoDef.h:75