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