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