The Gaudi Framework  v29r0 (ff2e7097)
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  // ==========================================================================
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  // ========================================================================
54  virtual ~Histo1DDef() = default;
55  // ========================================================================
56  public:
57  // ========================================================================
59  double lowEdge() const { return m_low; }
61  double highEdge() const { return m_high; }
63  int bins() const { return m_bins; }
65  const std::string& title() const { return m_title; }
66  // ========================================================================
67  public:
68  // ========================================================================
70  void setLowEdge( double value ) { m_low = value; }
72  void setHighEdge( double value ) { m_high = value; }
74  void setBins( int value ) { m_bins = value; }
76  void setTitle( std::string value ) { m_title = std::move( value ); }
77  // ========================================================================
78  public:
79  // ========================================================================
81  std::ostream& fillStream( std::ostream& o ) const;
82  // ========================================================================
83  public:
84  // ========================================================================
86  bool operator<( const Histo1DDef& right ) const;
88  bool operator==( const Histo1DDef& right ) const;
90  bool operator!=( const Histo1DDef& right ) const;
91  // ========================================================================
92  public:
93  // ========================================================================
95  bool ok() const { return 0 < bins() && lowEdge() < highEdge(); }
96  // ========================================================================
97  private:
98  // ========================================================================
99  // Histogram 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  // ==========================================================================
112  // ==========================================================================
118  namespace Histos
119  {
120  // ========================================================================
126  GAUDI_API AIDA::IHistogram1D* book( IHistogramSvc* svc, const std::string& path, const Gaudi::Histo1DDef& hist );
127  // ========================================================================
134  GAUDI_API AIDA::IHistogram1D* book( IHistogramSvc* svc, const std::string& dir, const std::string& id,
135  const Gaudi::Histo1DDef& hist );
136  // ========================================================================
143  GAUDI_API AIDA::IHistogram1D* book( IHistogramSvc* svc, const std::string& dir, const int id,
144  const Gaudi::Histo1DDef& hist );
145  // ========================================================================
146  } // end of namespace Gaudi::Histos
147  // ==========================================================================
148 } // end of namespace Gaudi
149 // ============================================================================
150 // The END
151 // ============================================================================
152 #endif // GAUDIKERNEL_HISTODEF_H
153 // ============================================================================
helper namespace to collect useful definitions, types, constants and functions, related to manipulati...
void setBins(int value)
set number of bis
Definition: HistoDef.h:74
bool operator!=(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
Definition: Allocator.h:256
GAUDI_API std::ostream & operator<<(std::ostream &o, const Gaudi::Histo1DDef &histo)
the streamer operator for class Gaudi::Histo1DDef
Definition: HistoDef.cpp:94
double highEdge() const
get the high edge
Definition: HistoDef.h:61
double lowEdge() const
get the low edge
Definition: HistoDef.h:59
void setHighEdge(double value)
set high edge
Definition: HistoDef.h:72
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:130
GaudiKernel.
Definition: Fill.h:10
const std::string & title() const
get the title
Definition: HistoDef.h:65
STL class.
double m_high
High Edge.
Definition: HistoDef.h:104
bool operator==(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
Definition: Allocator.h:246
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
Definition: HistoDef.h:33
std::string m_title
Histogram title.
Definition: HistoDef.h:100
bool ok() const
check if all fields are "reasonable"
Definition: HistoDef.h:95
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:76
bool operator<(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:206
int bins() const
get the number of bins
Definition: HistoDef.h:63
#define GAUDI_API
Definition: Kernel.h:110
int m_bins
Number of bins.
Definition: HistoDef.h:106
STL class.
Helper functions to set/get the application return code.
Definition: __init__.py:1
double m_low
Low Edge.
Definition: HistoDef.h:102
void setLowEdge(double value)
set low edge
Definition: HistoDef.h:70