00001 #ifndef PSHIST_H2_H 00002 #define PSHIST_H2_H 00003 00004 //-------------------------------------------------------------------------- 00005 // File and Version Information: 00006 // $Id: H2.h 2050 2011-06-29 21:30:05Z salnikov@SLAC.STANFORD.EDU $ 00007 // 00008 // Description: 00009 // Class H2. 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------- 00014 // C/C++ Headers -- 00015 //----------------- 00016 #include <iosfwd> 00017 #include <boost/utility.hpp> 00018 00019 //---------------------- 00020 // Base Class Headers -- 00021 //---------------------- 00022 00023 //------------------------------- 00024 // Collaborating Class Headers -- 00025 //------------------------------- 00026 00027 //------------------------------------ 00028 // Collaborating Class Declarations -- 00029 //------------------------------------ 00030 00031 // --------------------- 00032 // -- Class Interface -- 00033 // --------------------- 00034 00035 namespace PSHist { 00036 00037 /** 00038 * @ingroup PSHist 00039 * 00040 * @brief Interface for 2-dimensional histogram class. 00041 * 00042 * Currently this interface defines only very simple filling operations. 00043 * 00044 * This software was developed for the LCLS project. If you use all or 00045 * part of it, please give an appropriate acknowledgment. 00046 * 00047 * @see HManager 00048 * 00049 * @version $Id: H2.h 2050 2011-06-29 21:30:05Z salnikov@SLAC.STANFORD.EDU $ 00050 * 00051 * @author Mikhail S. Dubrovin 00052 */ 00053 00054 class H2 : boost::noncopyable { 00055 public: 00056 00057 // Destructor 00058 virtual ~H2 () {} 00059 00060 /** 00061 * @brief Fill histogram. 00062 * 00063 * @param[in] x Histogrammed value. 00064 * @param[in] y Histogrammed value. 00065 * @param[in] weight Weight assigned to this value. 00066 */ 00067 virtual void fill(double x, double y, double weight=1.0) = 0; 00068 00069 /** 00070 * @brief Fill histogram with multiple values. 00071 * 00072 * This method is equivalent to calling fill() multiple times but 00073 * implementation may provide more efficient way if you have 00074 * many values to fill histogram at once. 00075 * 00076 * @param[in] n Size of the values array. 00077 * @param[in] x Histogrammed values array, array size is n. 00078 * @param[in] y Histogrammed values array, array size is n. 00079 * @param[in] weight Weight assigned to these values, if pointer is 00080 * zero then weight 1 is assumed for every value. 00081 */ 00082 virtual void fillN(unsigned n, const double* x, const double* y, const double* weight=0) = 0; 00083 00084 /** 00085 * @brief Reset the accumulated contents of a histogram. 00086 */ 00087 virtual void reset() = 0; 00088 00089 /// Print some basic information about histogram to a stream 00090 virtual void print(std::ostream& o) const = 0; 00091 00092 }; 00093 00094 } // namespace PSHist 00095 00096 #endif // PSHIST_H2_H