[ROOT] looping with TSpectrum

From: Hall, Carter R. (chall@slac.stanford.edu)
Date: Sat Sep 25 2004 - 02:28:08 MEST

Hello ROOTers - 

I have a peak search problem for which I'd like
to use TSpectrum, but I'm having some difficulty
getting it to work. The trouble seems to be related 
to the fact that I'm performing the search on multiple

I've tried several different ways to do this:

- creating the TSpectrum object before the loop, 
and using the same object on multiple histograms

- creating the TSpectrum object inside the loop, 
and deleting it at the end of each iteration

- creating an array of TSpectrum objects, one for
each histogram.

In all three cases, the peak search usually works fine
on the first few iterations, but the results become
spurious afterwards. The attached tarfile has 
three macros to illustrate this, and a rootfile
with ten histograms. The ten histograms are all
identical, so the peak search results should be
the same.

I'm using ROOT 4.00/08 on a Sun Enterprise 420.

Thanks in advance, 

Carter Hall

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET