--- PamCut/CollectionActions/Histo2DActions/Histo2DAction/Histo2DAction.h 2009/10/29 17:49:07 1.4 +++ PamCut/CollectionActions/Histo2DActions/Histo2DAction/Histo2DAction.h 2009/12/08 17:38:39 1.5 @@ -143,6 +143,14 @@ return _histo; } + /*! @brief Returns a pointer to the ROOT histogram. + * + * @return A pointer to the root histogram + */ + TH2 *GetRootHisto() { + return _rootHisto; + } + /*! Fills the ROOT and the vector histogram. * * @param xValue The value of the X coordinate associated to the event. @@ -287,18 +295,10 @@ void Histo2DAction::_InitHistos() { _CreateHisto(); - - if (_xBins.size() < 2) { - _xBins.resize(2); - _xBins[0] = 0.; - _xBins[1] = 1.; - } - - if (_yBins.size() < 2) { - _yBins.resize(2); - _yBins[0] = 0.; - _yBins[1] = 1.; - } + if (_xBins.size() < 2) // SetXAxis not called by the main program, or wrongly filled (only 1 bin limit) + SetXAxis("Default X", 10, 0., 1.); + if (_yBins.size() < 2) // SetYAxis not called by the main program, or wrongly filled (only 1 bin limit) + SetYAxis("Default Y", 10, 0., 1.); if (_rootHisto) { Double_t *auxXArray = new Double_t[_xBins.size()]; @@ -468,7 +468,7 @@ } template -inline void Histo2DAction::Fill(double xValue, double yValue, double weight) { +void Histo2DAction::Fill(double xValue, double yValue, double weight) { _rootHisto->Fill(xValue, yValue, weight); @@ -481,7 +481,7 @@ UOflow = true; } - if (xValue > _xBins.back()) { + if (xValue >= _xBins.back()) { xBin = _xBins.size(); UOflow = true; } @@ -491,7 +491,7 @@ UOflow = true; } - if (yValue > _yBins.back()) { + if (yValue >= _yBins.back()) { yBin = _yBins.size(); UOflow = true; }