diff --git a/hist/hist/inc/TH1.h b/hist/hist/inc/TH1.h index 78291eb9183f8..c74a497ab318f 100644 --- a/hist/hist/inc/TH1.h +++ b/hist/hist/inc/TH1.h @@ -83,6 +83,17 @@ class TH1 : public TNamed, public TAttLine, public TAttFill, public TAttMarker { kNeutral = 2, ///< Adapt to the global flag }; + /// Enumeration specifying inconsistencies between two histograms, + /// in increasing severity. + enum EInconsistencyBits { + kFullyConsistent = 0, + kDifferentLabels = BIT(0), + kDifferentBinLimits = BIT(1), + kDifferentAxisLimits = BIT(2), + kDifferentNumberOfBins = BIT(3), + kDifferentDimensions = BIT(4) + }; + friend class TH1Merger; protected: @@ -156,7 +167,6 @@ class TH1 : public TNamed, public TAttLine, public TAttFill, public TAttMarker { static bool CheckBinLabels(const TAxis* a1, const TAxis* a2); static bool CheckEqualAxes(const TAxis* a1, const TAxis* a2); static bool CheckConsistentSubAxes(const TAxis *a1, Int_t firstBin1, Int_t lastBin1, const TAxis *a2, Int_t firstBin2=0, Int_t lastBin2=0); - static int CheckConsistency(const TH1* h1, const TH1* h2); int LoggedInconsistency(const char* name, const TH1* h1, const TH1* h2, bool useMerge=false) const; public: @@ -199,6 +209,7 @@ class TH1 : public TNamed, public TAttLine, public TAttFill, public TAttMarker { virtual Double_t Chi2Test(const TH1* h2, Option_t *option = "UU", Double_t *res = nullptr) const; virtual Double_t Chi2TestX(const TH1* h2, Double_t &chi2, Int_t &ndf, Int_t &igood,Option_t *option = "UU", Double_t *res = nullptr) const; virtual Double_t Chisquare(TF1 * f1, Option_t *option = "") const; + static Int_t CheckConsistency(const TH1* h1, const TH1* h2); virtual void ClearUnderflowAndOverflow(); virtual Double_t ComputeIntegral(Bool_t onlyPositive = false); TObject* Clone(const char *newname = "") const override; diff --git a/hist/hist/src/TH1.cxx b/hist/hist/src/TH1.cxx index e9b2e79c44349..9ee730d01a5fb 100644 --- a/hist/hist/src/TH1.cxx +++ b/hist/hist/src/TH1.cxx @@ -594,21 +594,6 @@ extern void H1LeastSquareFit(Int_t n, Int_t m, Double_t *a); extern void H1LeastSquareLinearFit(Int_t ndata, Double_t &a0, Double_t &a1, Int_t &ifail); extern void H1LeastSquareSeqnd(Int_t n, Double_t *a, Int_t idim, Int_t &ifail, Int_t k, Double_t *b); -namespace { - -/// Enumeration specifying inconsistencies between two histograms, -/// in increasing severity. -enum EInconsistencyBits { - kFullyConsistent = 0, - kDifferentLabels = BIT(0), - kDifferentBinLimits = BIT(1), - kDifferentAxisLimits = BIT(2), - kDifferentNumberOfBins = BIT(3), - kDifferentDimensions = BIT(4) -}; - -} // namespace - ClassImp(TH1); //////////////////////////////////////////////////////////////////////////////// @@ -1675,8 +1660,10 @@ bool TH1::CheckConsistentSubAxes(const TAxis *a1, Int_t firstBin1, Int_t lastBin //////////////////////////////////////////////////////////////////////////////// /// Check histogram compatibility. +/// The returned integer is part of EInconsistencyBits +/// The value 0 means that the histograms are compatible -int TH1::CheckConsistency(const TH1* h1, const TH1* h2) +Int_t TH1::CheckConsistency(const TH1* h1, const TH1* h2) { if (h1 == h2) return kFullyConsistent;