Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:17

0001 // -*- C++ -*-
0002 //
0003 // AIHistogram2D.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef LWH_AIHistogram2D_H
0010 #define LWH_AIHistogram2D_H
0011 
0012 
0013 
0014 /** @cond DONT_DOCUMENT_STRIPPED_DOWN_AIDA_INTERFACES */
0015 
0016 #include "AIHistogram1D.h"
0017 
0018 namespace AIDA {
0019 
0020 class IAxis;
0021 
0022 class IHistogram2D : virtual public IHistogram {
0023 
0024 public: 
0025 
0026     virtual ~IHistogram2D() { /* nop */; }
0027 
0028     /**
0029      * Fill the IHistogram2D with a couple of values and the
0030      * corresponding weight.
0031      * @param x      The x value to be filled in.
0032      * @param y      The y value to be filled in.
0033      * @param weight The corresponding weight (by default 1).
0034      * @return false If the weight is <0 or >1 (?).
0035      *
0036      */
0037     virtual bool fill(double x, double y, double weight = 1.) = 0;
0038 
0039     /**
0040      * The weighted mean along the x axis of a given bin. 
0041      * @param indexX The x bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0042      * @param indexY The y bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0043      * @return      The mean of the corresponding bin along the x axis.
0044      *
0045      */
0046     virtual double binMeanX(int indexX, int indexY) const = 0;
0047 
0048     /**
0049      * The weighted mean along the y axis of a given bin.
0050      * @param indexX The x bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0051      * @param indexY The y bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0052      * @return      The mean of the corresponding bin along the y axis.
0053      *
0054      */
0055     virtual double binMeanY(int indexX, int indexY) const = 0;
0056 
0057     /**
0058      * Number of entries in the corresponding bin (ie the number of times fill was called for this bin).
0059      * @param indexX The x bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0060      * @param indexY The y bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0061      * @return       The number of entries in the corresponding bin. 
0062      *
0063      */
0064     virtual int binEntries(int indexX, int indexY) const = 0;
0065 
0066     /**
0067      * Sum of all the entries of the bins along a given x bin.
0068      * This is equivalent to <tt>projectionX().binEntries(index)</tt>.
0069      * @param index The x bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0070      * @return      The number of entries in the corresponding set of bins. 
0071      *
0072      */
0073     virtual int binEntriesX(int index) const = 0;
0074 
0075     /**
0076      * Sum of all the entries of the bins along a given y bin.
0077      * This is equivalent to <tt>projectionY().binEntries(index)</tt>.
0078      * @param index The y bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0079      * @return      The number of entries in the corresponding set of bins. 
0080      *
0081      */
0082     virtual int binEntriesY(int index) const = 0;
0083 
0084     /**
0085      * Total height of a give bin (ie the sum of the weights in this bin).
0086      * @param indexX The x bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0087      * @param indexY The y bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0088      * @return       The height of the corresponding bin.
0089      *
0090      */
0091     virtual double binHeight(int indexX, int indexY) const = 0;
0092 
0093     /**
0094      * Sum of all the heights of the bins along a given x bin.
0095      * This is equivalent to <tt>projectionX().binHeight(index)</tt>.
0096      * @param index The x bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0097      * @return      The sum of the heights in the corresponding set of bins. 
0098      *
0099      */
0100     virtual double binHeightX(int index) const = 0;
0101 
0102     /**
0103      * Sum of all the heights of the bins along a given y bin.
0104      * This is equivalent to <tt>projectionY().binHeight(index)</tt>.
0105      * @param index The y bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0106      * @return      The sum of the heights in the corresponding set of bins. 
0107      *
0108      */
0109     virtual double binHeightY(int index) const = 0;
0110 
0111     /**
0112      * The error of a given bin.
0113      * @param indexX The x bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0114      * @param indexY The y bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0115      * @return       The error on the corresponding bin.
0116      *
0117      */
0118     virtual double binError(int indexX, int indexY) const = 0;
0119 
0120     /**
0121      * The mean of the IHistogram2D along the x axis.
0122      * @return The mean of the IHistogram2D along the x axis.
0123      *
0124      */
0125     virtual double meanX() const = 0;
0126 
0127     /**
0128      * The mean of the IHistogram2D along the y axis.
0129      * @return The mean of the IHistogram2D along the y axis.
0130      *
0131      */
0132     virtual double meanY() const = 0;
0133 
0134     /**
0135      * The RMS of the IHistogram2D along the x axis.
0136      * @return The RMS if the IHistogram2D along the x axis.
0137      *
0138      */
0139     virtual double rmsX() const = 0;
0140 
0141     /**
0142      * The RMS of the IHistogram2D along the y axis.
0143      * @return The RMS if the IHistogram2D along the y axis.
0144      *
0145      */
0146     virtual double rmsY() const = 0;
0147 
0148     /**
0149      * Get the x axis of the IHistogram2D.
0150      * @return The x coordinate IAxis.
0151      *
0152      */
0153     virtual const IAxis & xAxis() const = 0;
0154 
0155     /**
0156      * Get the y axis of the IHistogram2D.
0157      * @return The y coordinate IAxis.
0158      *
0159      */
0160     virtual const IAxis & yAxis() const = 0;
0161 
0162     /**
0163      * Get the bin number corresponding to a given coordinate along the x axis.
0164      * This is a convenience method, equivalent to <tt>xAxis().coordToIndex(coord)</tt>.
0165      * @see IAxis#coordToIndex(double)
0166      * @param coord The coordinalte along the x axis.
0167      * @return      The corresponding bin number.
0168      *
0169      */
0170     virtual int coordToIndexX(double coord) const = 0;
0171 
0172     /**
0173      * Get the bin number corresponding to a given coordinate along the y axis.
0174      * This is a convenience method, equivalent to <tt>yAxis().coordToIndex(coord)</tt>.
0175      * @see IAxis#coordToIndex(double)
0176      * @param coord The coordinalte along the y axis.
0177      * @return      The corresponding bin number.
0178      *
0179      */
0180     virtual int coordToIndexY(double coord) const = 0;
0181 
0182     /**
0183      * Add to this IHistogram2D the contents of another IHistogram2D.
0184      * @param hist The IHistogram2D to be added to this IHistogram2D.
0185      * @return false If the IHistogram2Ds binnings are incompatible.
0186      *
0187      */
0188     virtual bool add(const IHistogram2D & hist) = 0;
0189 
0190   virtual bool scale(double scaleFactor) = 0;
0191 
0192 
0193 }; // class
0194 } // namespace AIDA
0195 /** @endcond */
0196 
0197 
0198 
0199 
0200 
0201 #endif /* LWH_AIHistogram2D_H */
0202