All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HistoDef.h
Go to the documentation of this file.
1 // $Id: HistoDef.h,v 1.1 2007/09/26 16:13:41 marcocle Exp $
2 // ============================================================================
3 #ifndef GAUDIKERNEL_HISTODEF_H
4 #define GAUDIKERNEL_HISTODEF_H 1
5 // ============================================================================
6 // Include files
7 // ============================================================================
8 // STD & STL
9 // ============================================================================
10 #include <iosfwd>
11 #include <string>
12 // ============================================================================
13 // Gaudi
14 // ============================================================================
15 #include "GaudiKernel/Kernel.h"
16 // ============================================================================
17 // Forward decalrations
18 // ============================================================================
19 class IHistogramSvc ;
20 namespace AIDA { class IHistogram1D ; }
21 // ============================================================================
22 namespace Gaudi
23 {
24  // ==========================================================================
33  {
34  public:
35  // ========================================================================
43  ( const double low ,
44  const double high ,
45  const int bins = 100 ,
46  const std::string& title = "" );
47  // ========================================================================
55  ( const std::string& title = "" ,
56  const double low = 0.0 ,
57  const double high = 1.0 ,
58  const int bins = 100 ) ;
59  // ========================================================================
61  virtual ~Histo1DDef( );
62  // ========================================================================
63  public:
64  // ========================================================================
66  double lowEdge () const { return m_low ; }
68  double highEdge () const { return m_high ; }
70  int bins () const { return m_bins ; }
72  const std::string& title () const { return m_title ; }
73  // ========================================================================
74  public:
75  // ========================================================================
77  void setLowEdge ( const double value ) { m_low = value ; }
79  void setHighEdge ( const double value ) { m_high = value ; }
81  void setBins ( const int value ) { m_bins = value ; }
83  void setTitle ( const std::string& value ) { m_title = value ; }
84  // ========================================================================
85  public:
86  // ========================================================================
88  std::ostream& fillStream ( std::ostream& o ) const ;
89  // ========================================================================
90  public:
91  // ========================================================================
93  bool operator< ( const Histo1DDef& right ) const ;
95  bool operator==( const Histo1DDef& right ) const ;
97  bool operator!=( const Histo1DDef& right ) const ;
98  // ========================================================================
99  public:
100  // ========================================================================
102  bool ok () const { return 0 < bins() && lowEdge() < highEdge() ; }
103  // ========================================================================
104  private:
105  // ========================================================================
106  // Histogram title
107  std::string m_title ;
108  // Low Edge
109  double m_low ;
110  // High Edge
111  double m_high ;
112  // Number of bins
113  int m_bins ;
114  // ========================================================================
115  };
116  // ==========================================================================
118  GAUDI_API std::ostream&
119  operator<<( std::ostream& o , const Gaudi::Histo1DDef& histo ) ;
120  // ==========================================================================
126  namespace Histos
127  {
128  // ========================================================================
134  GAUDI_API AIDA::IHistogram1D* book
135  ( IHistogramSvc* svc ,
136  const std::string& path ,
137  const Gaudi::Histo1DDef& hist ) ;
138  // ========================================================================
145  GAUDI_API AIDA::IHistogram1D* book
146  ( IHistogramSvc* svc ,
147  const std::string& dir ,
148  const std::string& id ,
149  const Gaudi::Histo1DDef& hist ) ;
150  // ========================================================================
157  GAUDI_API AIDA::IHistogram1D* book
158  ( IHistogramSvc* svc ,
159  const std::string& dir ,
160  const int id ,
161  const Gaudi::Histo1DDef& hist ) ;
162  // ========================================================================
163  } // end of namespace Gaudi::Histos
164  // ==========================================================================
165 } // end of namespace Gaudi
166 // ============================================================================
167 // The END
168 // ============================================================================
169 #endif // GAUDIKERNEL_HISTODEF_H
170 // ============================================================================
GAUDI_API std::ostream & operator<<(std::ostream &o, const Gaudi::Histo1DDef &histo)
the streamer operator for class Gaudi::Histo1DDef
Definition: HistoDef.cpp:114
GAUDI_API AIDA::IHistogram1D * book(IHistogramSvc *svc, const std::string &path, const Gaudi::Histo1DDef &hist)
helper function to book 1D-histogram
Definition: HistoDef.cpp:132
bool operator==(const Gaudi::StringKey &key1, const char(&key2)[N])
equality operator with C-arrays
Definition: StringKey.h:149
void setHighEdge(const double value)
set high edge
Definition: HistoDef.h:79
void setBins(const int value)
set number of bis
Definition: HistoDef.h:81
double highEdge() const
get the high edge
Definition: HistoDef.h:68
double lowEdge() const
get the low edge
Definition: HistoDef.h:66
const std::string & title() const
get the title
Definition: HistoDef.h:72
void setTitle(const std::string &value)
set the title
Definition: HistoDef.h:83
double m_high
High Edge.
Definition: HistoDef.h:111
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
Definition: HistoDef.h:32
std::string m_title
Histogram title.
Definition: HistoDef.h:107
bool ok() const
check if all fields are "reasonable"
Definition: HistoDef.h:102
Definition of the IHistogramSvc interface class.
Definition: IHistogramSvc.h:47
bool operator!=(const Gaudi::StringKey &key1, const char(&key2)[N])
non-equality operator with C-arrays
Definition: StringKey.h:163
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
int bins() const
get the number of bins
Definition: HistoDef.h:70
This is a number of static methods for bootstrapping the Gaudi framework.
Definition: Bootstrap.h:15
bool operator<(const Gaudi::Time &t1, const Gaudi::Time &t2)
Definition: Time.icpp:233
#define GAUDI_API
Definition: Kernel.h:108
int m_bins
Number of bins.
Definition: HistoDef.h:113
double m_low
Low Edge.
Definition: HistoDef.h:109
void setLowEdge(const double value)
set low edge
Definition: HistoDef.h:77