Hello,
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.