Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:15:55

0001 /**
0002  *  @file   PandoraSDK/include/Objects/Histograms.h
0003  * 
0004  *  @brief  Header file for histogram classes
0005  * 
0006  *  $Log: $
0007  */
0008 #ifndef PANDORA_HISTOGRAMS_H
0009 #define PANDORA_HISTOGRAMS_H 1
0010 
0011 #include <map>
0012 
0013 namespace pandora
0014 {
0015 
0016 class TiXmlDocument;
0017 class TiXmlHandle;
0018 
0019 //------------------------------------------------------------------------------------------------------------------------------------------
0020 
0021 /**
0022  *  @brief  Histogram class
0023  */
0024 class Histogram
0025 {
0026 public:
0027     /**
0028      *  @brief  Constructor
0029      * 
0030      *  @param  nBinsX number of x bins
0031      *  @param  xLow min binned x value
0032      *  @param  xHigh max binned x value
0033      */
0034     Histogram(const unsigned int nBinsX, const float xLow, const float xHigh);
0035 
0036     /**
0037      *  @brief  Constructor
0038      * 
0039      *  @param  pXmlHandle address of the handle for the xml element describing the histogram
0040      *  @param  xmlElementName the xml element name for the histogram
0041      */
0042     Histogram(const TiXmlHandle *const pXmlHandle, const std::string &xmlElementName);
0043 
0044     /**
0045      *  @brief  Copy constructor
0046      * 
0047      *  @param  rhs the histogram to copy
0048      */
0049     Histogram(const Histogram &rhs);
0050 
0051     /**
0052      *  @brief  Get the number of x bins
0053      * 
0054      *  @return The number of x bins
0055      */
0056     int GetNBinsX() const;
0057 
0058     /**
0059      *  @brief  Get the min binned x value
0060      * 
0061      *  @return The min binned x value
0062      */
0063     float GetXLow() const;
0064 
0065     /**
0066      *  @brief  Get the max binned x value
0067      * 
0068      *  @return The max binned x value
0069      */
0070     float GetXHigh() const;
0071 
0072     /**
0073      *  @brief  Get the x bin width
0074      * 
0075      *  @return The x bin width
0076      */
0077     float GetXBinWidth() const;
0078 
0079     /**
0080      *  @brief  Get the content of a specified bin
0081      * 
0082      *  @param  binX the specified bin number
0083      * 
0084      *  @return The content of the specified bin
0085      */
0086     float GetBinContent(const int binX) const;
0087 
0088     /**
0089      *  @brief  Get the bin number for a specified value
0090      * 
0091      *  @param  valueX the specified value
0092      * 
0093      *  @return The bin number
0094      */
0095     int GetBinNumber(const float valueX) const;
0096 
0097     /**
0098      *  @brief  Get the min bin number of the histogram
0099      *          (ignores overflow and underflow bins)
0100      * 
0101      *  @return The min bin number
0102      */
0103     int GetMinBinNumber() const;
0104 
0105     /**
0106      *  @brief  Get the max bin number of the histogram
0107      *          (ignores overflow and underflow bins)
0108      * 
0109      *  @return The max bin number
0110      */
0111     int GetMaxBinNumber() const;
0112 
0113     /**
0114      *  @brief  Get the underflow bin number of the histogram
0115      * 
0116      *  @return The underflow bin number
0117      */
0118     int GetUnderflowBinNumber() const;
0119 
0120     /**
0121      *  @brief  Get the overflow bin number of the histogram
0122      * 
0123      *  @return The overflow bin number
0124      */
0125     int GetOverflowBinNumber() const;
0126 
0127     /**
0128      *  @brief  Get the cumulative sum of bin entries in the histogram
0129      *          (ignores overflow and underflow bins)
0130      * 
0131      *  @return The cumulative sum
0132      */
0133     float GetCumulativeSum() const;
0134 
0135     /**
0136      *  @brief  Get the cumulative sum of bin entries in a specified range of the histogram
0137      *          (includes overflow and underflow bins if specified)
0138      * 
0139      *  @param  xLowBin bin at start of specified x range
0140      *  @param  xHighBin bin at end of specified x range
0141      * 
0142      *  @return The cumulative sum
0143      */
0144     float GetCumulativeSum(const int xLowBin, const int xHighBin) const;
0145 
0146     /**
0147      *  @brief  Get the maximum value in the histogram and the corresponding bin number
0148      *          (ignores overflow and underflow bins)
0149      * 
0150      *  @param  maximumValue to receive the maximum value
0151      *  @param  maximumBinX to receive the coordinate of the bin containing the maximum value
0152      */
0153     void GetMaximum(float &maximumValue, int &maximumBinX) const;
0154 
0155     /**
0156      *  @brief  Get the maximum value in a specified range of the histogram and the corresponding bin numbers
0157      *          (includes overflow and underflow bins if specified)
0158      * 
0159      *  @param  xLowBin bin at start of specified x range
0160      *  @param  xHighBin bin at end of specified x range
0161      *  @param  maximumValue to receive the maximum value
0162      *  @param  maximumBinX to receive the coordinate of the bin containing the maximum value
0163      */
0164     void GetMaximum(const int xLowBin, const int xHighBin, float &maximumValue, int &maximumBinX) const;
0165 
0166     /**
0167      *  @brief  Get the mean x value of entries in the histogram
0168      *          (ignores overflow and underflow bins)
0169      * 
0170      *  @return The mean x value
0171      */
0172     float GetMeanX() const;
0173 
0174     /**
0175      *  @brief  Get the mean x value of entries in a specified range of the histogram
0176      *          (ignores overflow and underflow bins)
0177      * 
0178      *  @param  xLowBin bin at start of specified x range
0179      *  @param  xHighBin bin at end of specified x range
0180      * 
0181      *  @return The mean x value
0182      */
0183     float GetMeanX(const int xLowBin, const int xHighBin) const;
0184 
0185     /**
0186      *  @brief  Get the standard deviation of entries in the histogram
0187      *          (ignores overflow and underflow bins)
0188      * 
0189      *  @return The standard deviation of x entries
0190      */
0191     float GetStandardDeviationX() const;
0192 
0193     /**
0194      *  @brief  Get the standard deviation of x entries in a specified range of the histogram
0195      *          (ignores overflow and underflow bins)
0196      * 
0197      *  @param  xLowBin bin at start of specified x range
0198      *  @param  xHighBin bin at end of specified x range
0199      * 
0200      *  @return The standard deviation of x entries
0201      */
0202     float GetStandardDeviationX(const int xLowBin, const int xHighBin) const;
0203 
0204     /**
0205      *  @brief  Set the contents of a specified bin
0206      * 
0207      *  @param  binX the specified bin number
0208      *  @param  value the new value for the specified bin
0209      */
0210     void SetBinContent(const int binX, const float value);
0211 
0212     /**
0213      *  @brief  Add an entry to the histogram
0214      * 
0215      *  @param  valueX the value for the entry
0216      *  @param  weight the weight associated with this entry
0217      */
0218     void Fill(const float valueX, const float weight = 1.f);
0219 
0220     /**
0221      *  @brief  Scale contents of all histogram bins by a specified factor
0222      * 
0223      *  @param  scaleFactor the scale factor
0224      */
0225     void Scale(const float scaleFactor);
0226 
0227     /**
0228      *  @brief  Write the histogram to an xml document
0229      * 
0230      *  @param  pTiXmlDocument address of the xml document
0231      *  @param  xmlElementName the xml element name for the histogram
0232      */
0233     void WriteToXml(TiXmlDocument *const pTiXmlDocument, const std::string &xmlElementName) const;
0234 
0235 private:
0236     typedef std::map<int, float> HistogramMap;
0237 
0238     HistogramMap        m_histogramMap;         ///< The histogram map
0239 
0240     int                 m_nBinsX;               ///< The number of x bins
0241     float               m_xLow;                 ///< The min binned x value
0242     float               m_xHigh;                ///< The max binned x value
0243     float               m_xBinWidth;            ///< The x bin width
0244 };
0245 
0246 //------------------------------------------------------------------------------------------------------------------------------------------
0247 //------------------------------------------------------------------------------------------------------------------------------------------
0248 
0249 /**
0250  *  @brief  TwoDHistogram class
0251  */
0252 class TwoDHistogram
0253 {
0254 public:
0255     /**
0256      *  @brief  Constructor
0257      * 
0258      *  @param  nBinsX number of x bins
0259      *  @param  xLow min binned x value
0260      *  @param  xHigh max binned x value
0261      *  @param  nBinsY number of y bins
0262      *  @param  yLow min binned y value
0263      *  @param  yHigh max binned y value
0264      */
0265     TwoDHistogram(const unsigned int nBinsX, const float xLow, const float xHigh, const unsigned int nBinsY, const float yLow,
0266         const float yHigh);
0267 
0268     /**
0269      *  @brief  Constructor
0270      * 
0271      *  @param  pXmlHandle address of the handle for the xml element describing the histogram
0272      *  @param  xmlElementName the xml element name for the histogram
0273      */
0274     TwoDHistogram(const TiXmlHandle *const pXmlHandle, const std::string &xmlElementName);
0275 
0276     /**
0277      *  @brief  Copy constructor
0278      * 
0279      *  @param  rhs the histogram to copy
0280      */
0281     TwoDHistogram(const TwoDHistogram &rhs);
0282 
0283     /**
0284      *  @brief  Get the number of x bins
0285      * 
0286      *  @return The number of x bins
0287      */
0288     int GetNBinsX() const;
0289 
0290     /**
0291      *  @brief  Get the min binned x value
0292      * 
0293      *  @return The min binned x value
0294      */
0295     float GetXLow() const;
0296 
0297     /**
0298      *  @brief  Get the max binned x value
0299      * 
0300      *  @return The max binned x value
0301      */
0302     float GetXHigh() const;
0303 
0304     /**
0305      *  @brief  Get the x bin width
0306      * 
0307      *  @return The x bin width
0308      */
0309     float GetXBinWidth() const;
0310 
0311     /**
0312      *  @brief  Get the number of y bins
0313      * 
0314      *  @return The number of y bins
0315      */
0316     int GetNBinsY() const;
0317 
0318     /**
0319      *  @brief  Get the min binned y value
0320      * 
0321      *  @return The min binned y value
0322      */
0323     float GetYLow() const;
0324 
0325     /**
0326      *  @brief  Get the max binned y value
0327      * 
0328      *  @return The max binned y value
0329      */
0330     float GetYHigh() const;
0331 
0332     /**
0333      *  @brief  Get the y bin width
0334      * 
0335      *  @return The y bin width
0336      */
0337     float GetYBinWidth() const;
0338 
0339     /**
0340      *  @brief  Get the content of a specified bin
0341      * 
0342      *  @param  binX the specified x bin number
0343      *  @param  binY the specified y bin number
0344      * 
0345      *  @return The content of the specified bin
0346      */
0347     float GetBinContent(const int binX, const int binY) const;
0348 
0349     /**
0350      *  @brief  Get the x bin number for a specified x value
0351      * 
0352      *  @param  valueX the specified x value
0353      * 
0354      *  @return The x bin number
0355      */
0356     int GetBinNumberX(const float valueX) const;
0357 
0358     /**
0359      *  @brief  Get the min x bin number of the histogram
0360      *          (ignores overflow and underflow bins)
0361      * 
0362      *  @return The min x bin number
0363      */
0364     int GetMinBinNumberX() const;
0365 
0366     /**
0367      *  @brief  Get the max x bin number of the histogram
0368      *          (ignores overflow and underflow bins)
0369      * 
0370      *  @return The max x bin number
0371      */
0372     int GetMaxBinNumberX() const;
0373 
0374     /**
0375      *  @brief  Get the underflow x bin number of the histogram
0376      * 
0377      *  @return The underflow x bin number
0378      */
0379     int GetUnderflowBinNumberX() const;
0380 
0381     /**
0382      *  @brief  Get the overflow x bin number of the histogram
0383      * 
0384      *  @return The overflow x bin number
0385      */
0386     int GetOverflowBinNumberX() const;
0387 
0388     /**
0389      *  @brief  Get the y bin number for a specified value
0390      * 
0391      *  @param  valueY the specified y value
0392      * 
0393      *  @return The y bin number
0394      */
0395     int GetBinNumberY(const float valueY) const;
0396 
0397     /**
0398      *  @brief  Get the min y bin number of the histogram
0399      *          (ignores overflow and underflow bins)
0400      * 
0401      *  @return The min y bin number
0402      */
0403     int GetMinBinNumberY() const;
0404 
0405     /**
0406      *  @brief  Get the max y bin number of the histogram
0407      *          (ignores overflow and underflow bins)
0408      * 
0409      *  @return The max y bin number
0410      */
0411     int GetMaxBinNumberY() const;
0412 
0413     /**
0414      *  @brief  Get the underflow y bin number of the histogram
0415      * 
0416      *  @return The underflow y bin number
0417      */
0418     int GetUnderflowBinNumberY() const;
0419 
0420     /**
0421      *  @brief  Get the overflow y bin number of the histogram
0422      * 
0423      *  @return The overflow y bin number
0424      */
0425     int GetOverflowBinNumberY() const;
0426 
0427     /**
0428      *  @brief  Get the cumulative sum of bin entries in the histogram
0429      *          (ignores overflow and underflow bins)
0430      * 
0431      *  @return The cumulative sum
0432      */
0433     float GetCumulativeSum() const;
0434 
0435     /**
0436      *  @brief  Get the cumulative sum of bin entries in a specified range of the histogram
0437      *          (includes overflow and underflow bins if specified)
0438      * 
0439      *  @param  xLowBin bin at start of specified x range
0440      *  @param  xHighBin bin at end of specified x range
0441      *  @param  yLowBin bin at start of specified y range
0442      *  @param  yHighBin bin at end of specified y range
0443      * 
0444      *  @return The cumulative sum
0445      */
0446     float GetCumulativeSum(const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const;
0447 
0448     /**
0449      *  @brief  Get the maximum value in the histogram and the corresponding bin numbers
0450      *          (ignores overflow and underflow bins)
0451      * 
0452      *  @param  maximumValue to receive the maximum value
0453      *  @param  maximumBinX to receive the x coordinate of the bin containing the maximum value
0454      *  @param  maximumBinY to receive the y coordinate of the bin containing the maximum value
0455      */
0456     void GetMaximum(float &maximumValue, int &maximumBinX, int &maximumBinY) const;
0457 
0458     /**
0459      *  @brief  Get the maximum value in a specified range of the histogram and the corresponding bin numbers
0460      *          (includes overflow and underflow bins if specified)
0461      * 
0462      *  @param  xLowBin bin at start of specified x range
0463      *  @param  xHighBin bin at end of specified x range
0464      *  @param  yLowBin bin at start of specified y range
0465      *  @param  yHighBin bin at end of specified y range
0466      *  @param  maximumValue to receive the maximum value
0467      *  @param  maximumBinX to receive the x coordinate of the bin containing the maximum value
0468      *  @param  maximumBinY to receive the y coordinate of the bin containing the maximum value
0469      */
0470     void GetMaximum(const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin, float &maximumValue, int &maximumBinX,
0471         int &maximumBinY) const;
0472 
0473     /**
0474      *  @brief  Get the mean x value of entries in the histogram
0475      *          (ignores overflow and underflow bins)
0476      * 
0477      *  @return The mean x value
0478      */
0479     float GetMeanX() const;
0480 
0481     /**
0482      *  @brief  Get the mean x value of entries in a specified range of the histogram
0483      *          (ignores overflow and underflow bins)
0484      * 
0485      *  @param  xLowBin bin at start of specified x range
0486      *  @param  xHighBin bin at end of specified x range
0487      *  @param  yLowBin bin at start of specified y range
0488      *  @param  yHighBin bin at end of specified y range
0489      * 
0490      *  @return The mean x value
0491      */
0492     float GetMeanX(const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const;
0493 
0494     /**
0495      *  @brief  Get the standard deviation of x entries in the histogram
0496      *          (ignores overflow and underflow bins)
0497      * 
0498      *  @return The standard deviation of x entries
0499      */
0500     float GetStandardDeviationX() const;
0501 
0502     /**
0503      *  @brief  Get the standard deviation of x entries in a specified range of the histogram
0504      *          (ignores overflow and underflow bins)
0505      * 
0506      *  @param  xLowBin bin at start of specified x range
0507      *  @param  xHighBin bin at end of specified x range
0508      *  @param  yLowBin bin at start of specified y range
0509      *  @param  yHighBin bin at end of specified y range
0510      * 
0511      *  @return The standard deviation of x entries
0512      */
0513     float GetStandardDeviationX(const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const;
0514 
0515     /**
0516      *  @brief  Get the mean y value of entries in the histogram
0517      *          (ignores overflow and underflow bins)
0518      * 
0519      *  @return The mean y value
0520      */
0521     float GetMeanY() const;
0522 
0523     /**
0524      *  @brief  Get the mean y value of entries in a specified range of the histogram
0525      *          (ignores overflow and underflow bins)
0526      * 
0527      *  @param  xLowBin bin at start of specified x range
0528      *  @param  xHighBin bin at end of specified x range
0529      *  @param  yLowBin bin at start of specified y range
0530      *  @param  yHighBin bin at end of specified y range
0531      * 
0532      *  @return The mean y value
0533      */
0534     float GetMeanY(const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const;
0535 
0536     /**
0537      *  @brief  Get the standard deviation of y entries in the histogram
0538      *          (ignores overflow and underflow bins)
0539      * 
0540      *  @return The standard deviation of y entries
0541      */
0542     float GetStandardDeviationY() const;
0543 
0544     /**
0545      *  @brief  Get the standard deviation of y entries in a specified range of the histogram
0546      *          (ignores overflow and underflow bins)
0547      * 
0548      *  @param  xLowBin bin at start of specified x range
0549      *  @param  xHighBin bin at end of specified x range
0550      *  @param  yLowBin bin at start of specified y range
0551      *  @param  yHighBin bin at end of specified y range
0552      * 
0553      *  @return The standard deviation of y entries
0554      */
0555     float GetStandardDeviationY(const int xLowBin, const int xHighBin, const int yLowBin, const int yHighBin) const;
0556 
0557     /**
0558      *  @brief  Set the contents of a specified bin
0559      * 
0560      *  @param  binX the specified x bin number
0561      *  @param  binY the specified y bin number
0562      *  @param  value the new value for the specified bin
0563      */
0564     void SetBinContent(const int binX, const int binY, const float value);
0565 
0566     /**
0567      *  @brief  Add an entry to the histogram
0568      * 
0569      *  @param  valueX the x value for the entry
0570      *  @param  valueY the y value for the entry
0571      *  @param  weight the weight associated with this entry
0572      */
0573     void Fill(const float valueX, const float valueY, const float weight = 1.f);
0574 
0575     /**
0576      *  @brief  Scale contents of all histogram bins by a specified factor
0577      * 
0578      *  @param  scaleFactor the scale factor
0579      */
0580     void Scale(const float scaleFactor);
0581 
0582     /**
0583      *  @brief  Write the histogram to an xml document
0584      * 
0585      *  @param  pTiXmlDocument address of the xml document
0586      *  @param  xmlElementName the xml element name for the histogram
0587      */
0588     void WriteToXml(TiXmlDocument *const pTiXmlDocument, const std::string &xmlElementName) const;
0589 
0590 private:
0591     typedef std::map<int, float> HistogramMap;
0592     typedef std::map<int, HistogramMap> TwoDHistogramMap;
0593 
0594     TwoDHistogramMap    m_xyHistogramMap;       ///< The x->y->value 2d histogram map
0595     TwoDHistogramMap    m_yxHistogramMap;       ///< The y->x->value 2d histogram map
0596 
0597     int                 m_nBinsX;               ///< The number of x bins
0598     float               m_xLow;                 ///< The min binned x value
0599     float               m_xHigh;                ///< The max binned x value
0600     float               m_xBinWidth;            ///< The x bin width
0601 
0602     int                 m_nBinsY;               ///< The number of y bins
0603     float               m_yLow;                 ///< The min binned y value
0604     float               m_yHigh;                ///< The max binned y value
0605     float               m_yBinWidth;            ///< The y bin width
0606 };
0607 
0608 //------------------------------------------------------------------------------------------------------------------------------------------
0609 //------------------------------------------------------------------------------------------------------------------------------------------
0610 
0611 inline int Histogram::GetNBinsX() const
0612 {
0613     return m_nBinsX;
0614 }
0615 
0616 //------------------------------------------------------------------------------------------------------------------------------------------
0617 
0618 inline float Histogram::GetXLow() const
0619 {
0620     return m_xLow;
0621 }
0622 
0623 //------------------------------------------------------------------------------------------------------------------------------------------
0624 
0625 inline float Histogram::GetXHigh() const
0626 {
0627     return m_xHigh;
0628 }
0629 
0630 //------------------------------------------------------------------------------------------------------------------------------------------
0631 
0632 inline float Histogram::GetXBinWidth() const
0633 {
0634     return m_xBinWidth;
0635 }
0636 
0637 //------------------------------------------------------------------------------------------------------------------------------------------
0638 
0639 inline int Histogram::GetMinBinNumber() const
0640 {
0641     return 0;
0642 }
0643 
0644 //------------------------------------------------------------------------------------------------------------------------------------------
0645 
0646 inline int Histogram::GetMaxBinNumber() const
0647 {
0648     return (m_nBinsX - 1);
0649 }
0650 
0651 //------------------------------------------------------------------------------------------------------------------------------------------
0652 
0653 inline int Histogram::GetUnderflowBinNumber() const
0654 {
0655     return (this->GetMinBinNumber() - 1);
0656 }
0657 
0658 //------------------------------------------------------------------------------------------------------------------------------------------
0659 
0660 inline int Histogram::GetOverflowBinNumber() const
0661 {
0662     return (this->GetMaxBinNumber() + 1);
0663 }
0664 
0665 //------------------------------------------------------------------------------------------------------------------------------------------
0666 
0667 inline float Histogram::GetCumulativeSum() const
0668 {
0669     return this->GetCumulativeSum(this->GetMinBinNumber(), this->GetMaxBinNumber());
0670 }
0671 
0672 //------------------------------------------------------------------------------------------------------------------------------------------
0673 
0674 inline void Histogram::GetMaximum(float &maximumValue, int &maximumBinX) const
0675 {
0676     return this->GetMaximum(this->GetMinBinNumber(), this->GetMaxBinNumber(), maximumValue, maximumBinX);
0677 }
0678 
0679 //------------------------------------------------------------------------------------------------------------------------------------------
0680 
0681 inline float Histogram::GetMeanX() const
0682 {
0683     return this->GetMeanX(this->GetMinBinNumber(), this->GetMaxBinNumber());
0684 }
0685 
0686 //------------------------------------------------------------------------------------------------------------------------------------------
0687 
0688 inline float Histogram::GetStandardDeviationX() const
0689 {
0690     return this->GetStandardDeviationX(this->GetMinBinNumber(), this->GetMaxBinNumber());
0691 }
0692 
0693 //------------------------------------------------------------------------------------------------------------------------------------------
0694 //------------------------------------------------------------------------------------------------------------------------------------------
0695 
0696 inline int TwoDHistogram::GetNBinsX() const
0697 {
0698     return m_nBinsX;
0699 }
0700 
0701 //------------------------------------------------------------------------------------------------------------------------------------------
0702 
0703 inline float TwoDHistogram::GetXLow() const
0704 {
0705     return m_xLow;
0706 }
0707 
0708 //------------------------------------------------------------------------------------------------------------------------------------------
0709 
0710 inline float TwoDHistogram::GetXHigh() const
0711 {
0712     return m_xHigh;
0713 }
0714 
0715 //------------------------------------------------------------------------------------------------------------------------------------------
0716 
0717 inline float TwoDHistogram::GetXBinWidth() const
0718 {
0719     return m_xBinWidth;
0720 }
0721 
0722 //------------------------------------------------------------------------------------------------------------------------------------------
0723 
0724 inline int TwoDHistogram::GetNBinsY() const
0725 {
0726     return m_nBinsY;
0727 }
0728 
0729 //------------------------------------------------------------------------------------------------------------------------------------------
0730 
0731 inline float TwoDHistogram::GetYLow() const
0732 {
0733     return m_yLow;
0734 }
0735 
0736 //------------------------------------------------------------------------------------------------------------------------------------------
0737 
0738 inline float TwoDHistogram::GetYHigh() const
0739 {
0740     return m_yHigh;
0741 }
0742 
0743 //------------------------------------------------------------------------------------------------------------------------------------------
0744 
0745 inline float TwoDHistogram::GetYBinWidth() const
0746 {
0747     return m_yBinWidth;
0748 }
0749 //------------------------------------------------------------------------------------------------------------------------------------------
0750 
0751 inline int TwoDHistogram::GetMinBinNumberX() const
0752 {
0753     return 0;
0754 }
0755 
0756 //------------------------------------------------------------------------------------------------------------------------------------------
0757 
0758 inline int TwoDHistogram::GetMaxBinNumberX() const
0759 {
0760     return (m_nBinsX - 1);
0761 }
0762 
0763 //------------------------------------------------------------------------------------------------------------------------------------------
0764 
0765 inline int TwoDHistogram::GetUnderflowBinNumberX() const
0766 {
0767     return (this->GetMinBinNumberX() - 1);
0768 }
0769 
0770 //------------------------------------------------------------------------------------------------------------------------------------------
0771 
0772 inline int TwoDHistogram::GetOverflowBinNumberX() const
0773 {
0774     return (this->GetMaxBinNumberX() + 1);
0775 }
0776 //------------------------------------------------------------------------------------------------------------------------------------------
0777 
0778 inline int TwoDHistogram::GetMinBinNumberY() const
0779 {
0780     return 0;
0781 }
0782 
0783 //------------------------------------------------------------------------------------------------------------------------------------------
0784 
0785 inline int TwoDHistogram::GetMaxBinNumberY() const
0786 {
0787     return (m_nBinsY - 1);
0788 }
0789 
0790 //------------------------------------------------------------------------------------------------------------------------------------------
0791 
0792 inline int TwoDHistogram::GetUnderflowBinNumberY() const
0793 {
0794     return (this->GetMinBinNumberY() - 1);
0795 }
0796 
0797 //------------------------------------------------------------------------------------------------------------------------------------------
0798 
0799 inline int TwoDHistogram::GetOverflowBinNumberY() const
0800 {
0801     return (this->GetMaxBinNumberY() + 1);
0802 }
0803 
0804 //------------------------------------------------------------------------------------------------------------------------------------------
0805 
0806 inline float TwoDHistogram::GetCumulativeSum() const
0807 {
0808     return this->GetCumulativeSum(this->GetMinBinNumberX(), this->GetMaxBinNumberX(), this->GetMinBinNumberY(), this->GetMaxBinNumberY());
0809 }
0810 
0811 //------------------------------------------------------------------------------------------------------------------------------------------
0812 
0813 inline void TwoDHistogram::GetMaximum(float &maximumValue, int &maximumBinX, int &maximumBinY) const
0814 {
0815     return this->GetMaximum(this->GetMinBinNumberX(), this->GetMaxBinNumberX(), this->GetMinBinNumberY(), this->GetMaxBinNumberY(), maximumValue, maximumBinX, maximumBinY);
0816 }
0817 
0818 //------------------------------------------------------------------------------------------------------------------------------------------
0819 
0820 inline float TwoDHistogram::GetMeanX() const
0821 {
0822     return this->GetMeanX(this->GetMinBinNumberX(), this->GetMaxBinNumberX(), this->GetMinBinNumberY(), this->GetMaxBinNumberY());
0823 }
0824 
0825 //------------------------------------------------------------------------------------------------------------------------------------------
0826 
0827 inline float TwoDHistogram::GetStandardDeviationX() const
0828 {
0829     return this->GetStandardDeviationX(this->GetMinBinNumberX(), this->GetMaxBinNumberX(), this->GetMinBinNumberY(), this->GetMaxBinNumberY());
0830 }
0831 
0832 //------------------------------------------------------------------------------------------------------------------------------------------
0833 
0834 inline float TwoDHistogram::GetMeanY() const
0835 {
0836     return this->GetMeanY(this->GetMinBinNumberX(), this->GetMaxBinNumberX(), this->GetMinBinNumberY(), this->GetMaxBinNumberY());
0837 }
0838 
0839 //------------------------------------------------------------------------------------------------------------------------------------------
0840 
0841 inline float TwoDHistogram::GetStandardDeviationY() const
0842 {
0843     return this->GetStandardDeviationY(this->GetMinBinNumberX(), this->GetMaxBinNumberX(), this->GetMinBinNumberY(), this->GetMaxBinNumberY());
0844 }
0845 
0846 } // namespace pandora
0847 
0848 #endif // #ifndef PANDORA_HISTOGRAMS_H