From cce8b1458846eadc5480860680926e5fa8d23200 Mon Sep 17 00:00:00 2001
From: Rene Brun <Rene.Brun@cern.ch>
Date: Fri, 1 Jun 2001 07:04:18 +0000
Subject: [PATCH] Fix a problem in TSpectrum::Search. The peak positions were
 shifted by one bin.

git-svn-id: http://root.cern.ch/svn/root/trunk@2347 27541ba8-7e3a-0410-8455-c3a389f83636
---
 hist/src/TSpectrum.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hist/src/TSpectrum.cxx b/hist/src/TSpectrum.cxx
index b4419f1eb0d..02bdc198c7b 100644
--- a/hist/src/TSpectrum.cxx
+++ b/hist/src/TSpectrum.cxx
@@ -1,4 +1,4 @@
-// @(#)root/hist:$Name:  $:$Id: TSpectrum.cxx,v 1.3 2000/10/05 06:56:38 brun Exp $
+// @(#)root/hist:$Name:  $:$Id: TSpectrum.cxx,v 1.4 2000/10/31 14:07:38 brun Exp $
 // Author: Miroslav Morhac   27/05/99
 
 /////////////////////////////////////////////////////////////////////////////
@@ -578,7 +578,7 @@ Int_t TSpectrum::Search(TH1 *hin, Double_t sigma, Option_t *option)
 
       npeaks=Search1(source,size,sigma);
       for(i=0;i<npeaks;i++) {
-         bin = Int_t(fPositionX[i] +0.5);
+         bin = 1+Int_t(fPositionX[i] +0.5);
          fPositionX[i] = hin->GetBinCenter(bin);
          fPositionY[i] = hin->GetBinContent(bin);
       }
-- 
GitLab