From b49b6c89f09d87c61b37d3351afaa95350a40c55 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 12 Apr 2021 10:02:08 +0200 Subject: [PATCH] Revert "StepTHn: use AddAt rather than Get+Set (#5897)" This reverts commit bbc73979252cfb546a998d73f2713fb75c0325b6. --- Framework/Core/include/Framework/StepTHn.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Framework/Core/include/Framework/StepTHn.h b/Framework/Core/include/Framework/StepTHn.h index 4a33cb8714e41..71f1288b06533 100644 --- a/Framework/Core/include/Framework/StepTHn.h +++ b/Framework/Core/include/Framework/StepTHn.h @@ -43,9 +43,6 @@ class StepTHn : public TNamed } return mTarget[step]; } - - virtual void AddAt(TArray* array, Double_t c, Int_t i) = 0; - Int_t getNSteps() { return mNSteps; } Int_t getNVar() { return mNVars; } @@ -96,11 +93,6 @@ class StepTHnT : public StepTHn StepTHnT(const char* name, const char* title, const int nSteps, const int nAxes, const int* nBins, const double* xmin, const double* xmax); ~StepTHnT() override = default; - void AddAt(TArray* a, double c, int bin) final - { - static_cast(a)->AddAt(c, bin); - } - protected: TArray* createArray(const TArray* src = nullptr) const override { @@ -194,9 +186,10 @@ void StepTHn::Fill(Int_t istep, const Ts&... valuesAndWeight) } } - this->AddAt(mValues[istep], weight, bin); + // TODO probably slow; add StepTHnT::add ? + mValues[istep]->SetAt(mValues[istep]->GetAt(bin) + weight, bin); if (mSumw2[istep]) { - this->AddAt(mSumw2[istep], weight, bin); + mSumw2[istep]->SetAt(mSumw2[istep]->GetAt(bin) + weight, bin); } }