00001 // -*- C++ -*- 00002 // AID-GENERATED 00003 // ========================================================================= 00004 // This class was generated by AID - Abstract Interface Definition 00005 // DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it. 00006 // ========================================================================= 00007 #ifndef AIDA_IHISTOGRAM1D_H 00008 #define AIDA_IHISTOGRAM1D_H 1 00009 00010 // This file is part of the AIDA library 00011 // Copyright (C) 2002 by the AIDA team. All rights reserved. 00012 // This library is free software and under the terms of the 00013 // GNU Library General Public License described in the LGPL.txt 00014 00015 #include "AIDA/IHistogram.h" 00016 00017 namespace AIDA { 00018 00019 class IAxis; 00020 00021 /** 00022 * User level interface to 1D Histogram. 00023 * 00024 * @author The AIDA team (http://aida.freehep.org/) 00025 * 00026 */ 00027 00028 class IHistogram1D : virtual public IHistogram { 00029 00030 public: 00031 /// Destructor. 00032 virtual ~IHistogram1D() { /* nop */; } 00033 00034 /** 00035 * Fill the IHistogram1D with a value and the 00036 * corresponding weight. 00037 * @param x The value to be filled in. 00038 * @param weight The corresponding weight (by default 1). 00039 * @return false If the weight is <0 or >1 (?). 00040 * 00041 */ 00042 virtual bool fill(double x, double weight = 1.) = 0; 00043 00044 /** 00045 * The weighted mean of a bin. 00046 * @param index The bin number (0...N-1) or OVERFLOW or UNDERFLOW. 00047 * @return The mean of the corresponding bin. 00048 * 00049 */ 00050 virtual double binMean(int index) const = 0; 00051 00052 /** 00053 * Number of entries in the corresponding bin (ie the number of times fill was called for this bin). 00054 * @param index The bin number (0...N-1) or OVERFLOW or UNDERFLOW. 00055 * @return The number of entries in the corresponding bin. 00056 * 00057 */ 00058 virtual int binEntries(int index) const = 0; 00059 00060 /** 00061 * Total height of the corresponding bin (ie the sum of the weights in this bin). 00062 * @param index The bin number (0...N-1) or OVERFLOW or UNDERFLOW. 00063 * @return The height of the corresponding bin. 00064 * 00065 */ 00066 virtual double binHeight(int index) const = 0; 00067 00068 /** 00069 * The error of a given bin. 00070 * @param index The bin number (0...N-1) or OVERFLOW or UNDERFLOW. 00071 * @return The error on the corresponding bin. 00072 * 00073 */ 00074 virtual double binError(int index) const = 0; 00075 00076 /** 00077 * The mean of the whole IHistogram1D. 00078 * @return The mean of the IHistogram1D. 00079 * 00080 */ 00081 virtual double mean() const = 0; 00082 00083 /** 00084 * The RMS of the whole IHistogram1D. 00085 * @return The RMS if the IHistogram1D. 00086 * 00087 */ 00088 virtual double rms() const = 0; 00089 00090 /** 00091 * Get the x axis of the IHistogram1D. 00092 * @return The x coordinate IAxis. 00093 * 00094 */ 00095 virtual const IAxis & axis() const = 0; 00096 00097 /** 00098 * Get the bin number corresponding to a given coordinate along the x axis. 00099 * This is a convenience method, equivalent to <tt>axis().coordToIndex(coord)</tt>. 00100 * @see IAxis#coordToIndex(double) 00101 * @param coord The coordinalte along the x axis. 00102 * @return The corresponding bin number. 00103 * 00104 */ 00105 virtual int coordToIndex(double coord) const = 0; 00106 00107 /** 00108 * Add to this IHistogram1D the contents of another IHistogram1D. 00109 * @param hist The IHistogram1D to be added to this IHistogram1D. 00110 * @return false If the IHistogram1Ds binnings are incompatible. 00111 * 00112 */ 00113 virtual bool add(const IHistogram1D & hist) = 0; 00114 }; // class 00115 } // namespace AIDA 00116 #endif /* ifndef AIDA_IHISTOGRAM1D_H */