|
Gaudi Framework, version v23r2 |
| Home | Generated: Thu Jun 28 2012 |
00001 // $Id: HistoDef.h,v 1.1 2007/09/26 16:13:41 marcocle Exp $ 00002 // ============================================================================ 00003 #ifndef GAUDIKERNEL_HISTODEF_H 00004 #define GAUDIKERNEL_HISTODEF_H 1 00005 // ============================================================================ 00006 // Include files 00007 // ============================================================================ 00008 // STD & STL 00009 // ============================================================================ 00010 #include <iosfwd> 00011 #include <string> 00012 // ============================================================================ 00013 // Gaudi 00014 // ============================================================================ 00015 #include "GaudiKernel/Kernel.h" 00016 // ============================================================================ 00017 // Forward decalrations 00018 // ============================================================================ 00019 class IHistogramSvc ; 00020 namespace AIDA { class IHistogram1D ; } 00021 // ============================================================================ 00022 namespace Gaudi 00023 { 00024 // ========================================================================== 00032 class GAUDI_API Histo1DDef 00033 { 00034 public: 00035 // ======================================================================== 00042 Histo1DDef 00043 ( const double low , 00044 const double high , 00045 const int bins = 100 , 00046 const std::string& title = "" ); 00047 // ======================================================================== 00054 Histo1DDef 00055 ( const std::string& title = "" , 00056 const double low = 0.0 , 00057 const double high = 1.0 , 00058 const int bins = 100 ) ; 00059 // ======================================================================== 00061 virtual ~Histo1DDef( ); 00062 // ======================================================================== 00063 public: 00064 // ======================================================================== 00066 double lowEdge () const { return m_low ; } 00068 double highEdge () const { return m_high ; } 00070 int bins () const { return m_bins ; } 00072 const std::string& title () const { return m_title ; } 00073 // ======================================================================== 00074 public: 00075 // ======================================================================== 00077 void setLowEdge ( const double value ) { m_low = value ; } 00079 void setHighEdge ( const double value ) { m_high = value ; } 00081 void setBins ( const int value ) { m_bins = value ; } 00083 void setTitle ( const std::string& value ) { m_title = value ; } 00084 // ======================================================================== 00085 public: 00086 // ======================================================================== 00088 std::ostream& fillStream ( std::ostream& o ) const ; 00089 // ======================================================================== 00090 public: 00091 // ======================================================================== 00093 bool operator< ( const Histo1DDef& right ) const ; 00095 bool operator==( const Histo1DDef& right ) const ; 00097 bool operator!=( const Histo1DDef& right ) const ; 00098 // ======================================================================== 00099 public: 00100 // ======================================================================== 00102 bool ok () const { return 0 < bins() && lowEdge() < highEdge() ; } 00103 // ======================================================================== 00104 private: 00105 // ======================================================================== 00106 // Histogram title 00107 std::string m_title ; 00108 // Low Edge 00109 double m_low ; 00110 // High Edge 00111 double m_high ; 00112 // Number of bins 00113 int m_bins ; 00114 // ======================================================================== 00115 }; 00116 // ========================================================================== 00118 GAUDI_API std::ostream& 00119 operator<<( std::ostream& o , const Gaudi::Histo1DDef& histo ) ; 00120 // ========================================================================== 00126 namespace Histos 00127 { 00128 // ======================================================================== 00134 GAUDI_API AIDA::IHistogram1D* book 00135 ( IHistogramSvc* svc , 00136 const std::string& path , 00137 const Gaudi::Histo1DDef& hist ) ; 00138 // ======================================================================== 00145 GAUDI_API AIDA::IHistogram1D* book 00146 ( IHistogramSvc* svc , 00147 const std::string& dir , 00148 const std::string& id , 00149 const Gaudi::Histo1DDef& hist ) ; 00150 // ======================================================================== 00157 GAUDI_API AIDA::IHistogram1D* book 00158 ( IHistogramSvc* svc , 00159 const std::string& dir , 00160 const int id , 00161 const Gaudi::Histo1DDef& hist ) ; 00162 // ======================================================================== 00163 } // end of namespace Gaudi::Histos 00164 // ========================================================================== 00165 } // end of namespace Gaudi 00166 // ============================================================================ 00167 // The END 00168 // ============================================================================ 00169 #endif // GAUDIKERNEL_HISTODEF_H 00170 // ============================================================================