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 // Forward decalrations 00014 // ============================================================================ 00015 class IHistogramSvc ; 00016 namespace AIDA { class IHistogram1D ; } 00017 // ============================================================================ 00018 namespace Gaudi 00019 { 00020 // ========================================================================== 00028 class Histo1DDef 00029 { 00030 public: 00031 // ======================================================================== 00038 Histo1DDef 00039 ( const double low , 00040 const double high , 00041 const int bins = 100 , 00042 const std::string& title = "" ); 00043 // ======================================================================== 00050 Histo1DDef 00051 ( const std::string& title = "" , 00052 const double low = 0.0 , 00053 const double high = 1.0 , 00054 const int bins = 100 ) ; 00055 // ======================================================================== 00057 virtual ~Histo1DDef( ); 00058 // ======================================================================== 00059 public: 00060 // ======================================================================== 00062 double lowEdge () const { return m_low ; } 00064 double highEdge () const { return m_high ; } 00066 int bins () const { return m_bins ; } 00068 const std::string& title () const { return m_title ; } 00069 // ======================================================================== 00070 public: 00071 // ======================================================================== 00073 void setLowEdge ( const double value ) { m_low = value ; } 00075 void setHighEdge ( const double value ) { m_high = value ; } 00077 void setBins ( const int value ) { m_bins = value ; } 00079 void setTitle ( const std::string& value ) { m_title = value ; } 00080 // ======================================================================== 00081 public: 00082 // ======================================================================== 00084 std::ostream& fillStream ( std::ostream& o ) const ; 00085 // ======================================================================== 00086 public: 00087 // ======================================================================== 00089 bool operator< ( const Histo1DDef& right ) const ; 00091 bool operator==( const Histo1DDef& right ) const ; 00093 bool operator!=( const Histo1DDef& right ) const ; 00094 // ======================================================================== 00095 public: 00096 // ======================================================================== 00098 bool ok () const { return 0 < bins() && lowEdge() < highEdge() ; } 00099 // ======================================================================== 00100 private: 00101 // ======================================================================== 00102 // Histogram title 00103 std::string m_title ; 00104 // Low Edge 00105 double m_low ; 00106 // High Edge 00107 double m_high ; 00108 // Number of bins 00109 int m_bins ; 00110 // ======================================================================== 00111 }; 00112 // ========================================================================== 00118 namespace Histos 00119 { 00120 // ======================================================================== 00126 AIDA::IHistogram1D* book 00127 ( IHistogramSvc* svc , 00128 const std::string& path , 00129 const Gaudi::Histo1DDef& hist ) ; 00130 // ======================================================================== 00137 AIDA::IHistogram1D* book 00138 ( IHistogramSvc* svc , 00139 const std::string& dir , 00140 const std::string& id , 00141 const Gaudi::Histo1DDef& hist ) ; 00142 // ======================================================================== 00149 AIDA::IHistogram1D* book 00150 ( IHistogramSvc* svc , 00151 const std::string& dir , 00152 const int id , 00153 const Gaudi::Histo1DDef& hist ) ; 00154 // ======================================================================== 00155 } // end of namespace Gaudi::Histos 00156 } // end of namespace Gaudi 00157 // ============================================================================ 00159 std::ostream& operator<<( std::ostream& o , const Gaudi::Histo1DDef& histo ) ; 00160 // ============================================================================ 00161 // The END 00162 // ============================================================================ 00163 #endif // GAUDIKERNEL_HISTODEF_H 00164 // ============================================================================