Incorrect TSpectrum usage?


I am running ROOT4.02 on a windows machine and am trying to try out some of the transform/filter techniques in the TSpectrum class, but with very little success. I am able to search for peaks (function: Search1HighRes) and remove the background (function: Background1General) OK, but I cannot seem to get either of the functions Enhance1, Transform1 or Fillter1Zonal to work. They have the same syntax, so I am guessing it’s a similar problem.
My code looks something like this:

int size=raw_source->GetNbinsX();
TH1F* flip_raw_source=new TH1F("flip_raw_source","Flip Raw Source",(int)video_tree_clone->GetEntries(),0,(int)video_tree_clone->GetEntries());	
for(int j=0; j<size>Fill(j, -1.0*((double)raw_source->GetBinContent(j)) + 2.0*averageLevel);

float* source_points=CreateArray(flip_raw_source,size); // puts data points in an array
float* source_points_new=new float[size]; 

TSpectrum spec( size/m_sigma );
const char* enh1=spec.Enhance1(source_points, source_points_new,size, TRANSFORM1_HAAR, 0,0, size,1);

When I print out the values in source_points_new, they are still uninitialized. From reading the documentation, it appears to me that they should be the transformed points. is this incorrect? I have also tried getting points out using GetPositionX/Y(), but they are also very strange.
I have searched and cannot find any examples of how to use these functions, so I am posting on here for help.
Thanks for any suggestions.

I forwarded your problem to Miroslav Morhac the author of this class.
He sent the following answer:

[quote]Several remarks.
The last but one parameter xmax must be less than size. Otherwise you should
get HIGH REGION LIMIT ERROR. The goal of the function is to enhance a region
in transform domain (i.e. to multiply the coefficients in the given region)
and to transform the data back. Thus giving the enhance coefficient parameter
equal to one is useless (it does nothing). In principle it should be more than

  1. Now there exists new class (in CVS) TSpectrumTransform. Try to use this
    class. Using Enhance or Filter function you cannot see transformed data. For
    this purpose use Transform function.

Best regards Miro [/quote]

TSpectrumTransform is effectively a very new class introduced this week in the CVS head.


will have a look at that class, thank you.