|
[yoda-svn] r243 - trunk/include/YODAblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon Aug 15 16:26:03 BST 2011
Author: buckley Date: Mon Aug 15 16:26:03 2011 New Revision: 243 Log: Doxygen improvements Modified: trunk/include/YODA/Bin1D.h trunk/include/YODA/Bin2D.h trunk/include/YODA/HistoBin1D.h trunk/include/YODA/HistoBin2D.h trunk/include/YODA/ProfileBin1D.h Modified: trunk/include/YODA/Bin1D.h ============================================================================== --- trunk/include/YODA/Bin1D.h Mon Aug 15 14:21:29 2011 (r242) +++ trunk/include/YODA/Bin1D.h Mon Aug 15 16:26:03 2011 (r243) @@ -14,7 +14,12 @@ namespace YODA { - /// @brief Base class for bins in 1D normal and profile histograms. + /// @brief A generic 1D bin type + /// + /// This is a generic 1D bin type which supplies the accessors for the two "x" + /// and "y" axis directions in which it is defined. Bin1D is not intended to be + /// directly instantiated: it is inherited from to make specific histogram and + /// profile bin types as HistoBin1D and ProfileBin1D. /// The lower bin edge is inclusive. This base class provides no fill /// method, since the signatures for standard and profile histos differ. class Bin1D : public Bin { Modified: trunk/include/YODA/Bin2D.h ============================================================================== --- trunk/include/YODA/Bin2D.h Mon Aug 15 14:21:29 2011 (r242) +++ trunk/include/YODA/Bin2D.h Mon Aug 15 16:26:03 2011 (r243) @@ -12,6 +12,14 @@ namespace YODA { + /// @brief A generic 2D bin type + /// + /// This is a generic 2D bin type which supplies the accessors for the two "x" + /// and "y" axis directions in which it is defined. Bin2D is not intended to be + /// directly instantiated: it is inherited from to make specific histogram and + /// profile bin types as HistoBin2D and ProfileBin2D. + /// The lower bin edges in x and y are inclusive. This base class provides no fill + /// method, since the signatures for standard and profile histos differ. class Bin2D : public Bin { public: Modified: trunk/include/YODA/HistoBin1D.h ============================================================================== --- trunk/include/YODA/HistoBin1D.h Mon Aug 15 14:21:29 2011 (r242) +++ trunk/include/YODA/HistoBin1D.h Mon Aug 15 16:26:03 2011 (r243) @@ -13,7 +13,11 @@ namespace YODA { - /// @brief A Bin in a 1D histogram + /// @brief A Bin1D specialised for handling histogram-type information + /// + /// This is a 1D bin type, which supports all the operations defined for + /// a generic Bin1D object, but also supplies the specific member functions + /// for histogram-type data, as opposed to profile-type. class HistoBin1D : public Bin1D { public: Modified: trunk/include/YODA/HistoBin2D.h ============================================================================== --- trunk/include/YODA/HistoBin2D.h Mon Aug 15 14:21:29 2011 (r242) +++ trunk/include/YODA/HistoBin2D.h Mon Aug 15 16:26:03 2011 (r243) @@ -6,63 +6,100 @@ #include <cmath> namespace YODA { - class HistoBin2D : public Bin2D { - public: - /// Constructor accepting a set of extremal points of a bin - HistoBin2D(double lowEdgeX, double highEdgeX, - double lowEdgeY, double highEdgeY); - /// Constructor accepting a set of all edges of a bin - HistoBin2D(std::vector<std::pair<std::pair<double,double>, std::pair<double,double> > >& edges); + /// @brief A Bin2D specialised for handling histogram-type information + /// + /// This is a 2D bin type, which supports all the operations defined for + /// a generic Bin2D object, but also supplies the specific member functions + /// for histogram-type data, as opposed to profile-type. + class HistoBin2D : public Bin2D { + public: - /// A fill() function accepting the coordinates as std::pair - void fill(std::pair<double,double>, double weight=1.0); + /// @name Constructors + //@{ - /// A fill() function accepting coordinates as spearate numbers - void fill(double coordX, double coordY, double weight=1.0); + /// Constructor accepting a set of extremal points of a bin + HistoBin2D(double lowEdgeX, double highEdgeX, + double lowEdgeY, double highEdgeY); - /// A function that fills this particular bin. - void fillBin(double weight=1.0); + /// Constructor accepting a set of all edges of a bin + HistoBin2D(std::vector<std::pair<std::pair<double,double>, std::pair<double,double> > >& edges); - /// A reset function - void reset() { - Bin2D::reset(); - } + //@} - /// Rescalling the height of a bin - void scaleW(double scalefactor) { - _dbn.scaleW(scalefactor); - } + /// @name Modifiers + //@{ - //TODO: Is it a volume? Looks like height. - /// The volume of a bin - double volume() const { return sumW(); } + /// A fill() function accepting the coordinates as std::pair + void fill(std::pair<double,double>, double weight=1.0); - /// The height of a bin - double height() const { return volume()/(widthX()*widthY()); } + /// A fill() function accepting coordinates as spearate numbers + void fill(double coordX, double coordY, double weight=1.0); - /// Error on volume - double volumeErr() const{ return sqrt(sumW2()); } + /// A function that fills this particular bin. + void fillBin(double weight=1.0); - ///Error on height - double heightErr() const{ return volumeErr()/(widthX()*widthY());} + /// A reset function + void reset() { + Bin2D::reset(); + } + /// Rescaling the height of a bin + void scaleW(double scalefactor) { + _dbn.scaleW(scalefactor); + } - /// Addition operator - HistoBin2D& operator += (const HistoBin2D&); + //@} - /// Subtraction operator - HistoBin2D& operator -= (const HistoBin2D&); - protected: - HistoBin2D& add(const HistoBin2D&); - HistoBin2D& subtract(const HistoBin2D&); - }; + /// @name Accessors + //@{ - HistoBin2D operator + (const HistoBin2D& a, const HistoBin2D& b); - HistoBin2D operator - (const HistoBin2D& a, const HistoBin2D& b); + /// The volume of a bin + double volume() const { return sumW(); } + + /// Error on volume + double volumeErr() const{ return sqrt(sumW2()); } + + /// The height of a bin + double height() const { return volume()/(widthX()*widthY()); } + + /// Error on height + double heightErr() const{ return volumeErr()/(widthX()*widthY());} + + //@} + + + /// @name Operators + //@{ + + /// Addition operator + HistoBin2D& operator += (const HistoBin2D&); + + /// Subtraction operator + HistoBin2D& operator -= (const HistoBin2D&); + + //@} + + + protected: + + /// Named addition operator + HistoBin2D& add(const HistoBin2D&); + + /// Named subtraction operator + HistoBin2D& subtract(const HistoBin2D&); + + }; + + + /// Bin addition operator + HistoBin2D operator + (const HistoBin2D& a, const HistoBin2D& b); + + /// Bin subtraction operator + HistoBin2D operator - (const HistoBin2D& a, const HistoBin2D& b); } Modified: trunk/include/YODA/ProfileBin1D.h ============================================================================== --- trunk/include/YODA/ProfileBin1D.h Mon Aug 15 14:21:29 2011 (r242) +++ trunk/include/YODA/ProfileBin1D.h Mon Aug 15 16:26:03 2011 (r243) @@ -12,7 +12,13 @@ namespace YODA { - /// A Bin in a 1D profile histogram. + /// @brief A Bin1D specialised for handling profile-type information + /// + /// This is a 1D bin type, which supports all the operations defined for + /// a generic Bin1D object, but also supplies the specific member functions + /// for profile-type data, as opposed to histogram-type. This means that + /// extra internal distribution statistics are stored for the extra + /// "y-direction" specified in the profile fill operation. class ProfileBin1D : public Bin1D { /// Profile1D is a friend to add/subtract bins
More information about the yoda-svn mailing list |