From 5debcf32c9baf2005a59836d263773c73b942001 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Wed, 14 Aug 2013 19:17:01 +0200 Subject: [PATCH 1/2] fix overflows --- src/TH1Keys.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TH1Keys.cc b/src/TH1Keys.cc index 752677c99a579..cf4b0ac49db8e 100644 --- a/src/TH1Keys.cc +++ b/src/TH1Keys.cc @@ -165,9 +165,9 @@ void TH1Keys::FillH1() const RooNDKeysPdf pdf("","",*x_,*dataset_,options_,rho_); cache_ = pdf.createHistogram(GetName(), *x_); if (cache_->Integral()) cache_->Scale(1.0/cache_->Integral()); + cache_->Scale(dataset_->sumEntries() * globalScale_); cache_->SetBinContent(0, underflow_); cache_->SetBinContent(cache_->GetNbinsX()+1, overflow_); - cache_->Scale(dataset_->sumEntries() * globalScale_); RooMsgService::instance().setGlobalKillBelow(gKill); } isCacheGood_ = true; From 086350b15a246371635d2c6fbdcfb1c5c8839ddb Mon Sep 17 00:00:00 2001 From: Giovanni Date: Wed, 14 Aug 2013 19:20:04 +0200 Subject: [PATCH 2/2] fix globalScale in overflows --- src/TH1Keys.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TH1Keys.cc b/src/TH1Keys.cc index cf4b0ac49db8e..1cfe3c2c563f2 100644 --- a/src/TH1Keys.cc +++ b/src/TH1Keys.cc @@ -166,8 +166,8 @@ void TH1Keys::FillH1() const cache_ = pdf.createHistogram(GetName(), *x_); if (cache_->Integral()) cache_->Scale(1.0/cache_->Integral()); cache_->Scale(dataset_->sumEntries() * globalScale_); - cache_->SetBinContent(0, underflow_); - cache_->SetBinContent(cache_->GetNbinsX()+1, overflow_); + cache_->SetBinContent(0, underflow_ * globalScale_); + cache_->SetBinContent(cache_->GetNbinsX()+1, overflow_ * globalScale_); RooMsgService::instance().setGlobalKillBelow(gKill); } isCacheGood_ = true;