"goff" option of TSpectrum::Search() function


I have a “funny” problem.
I have a Root Gui. In that I am looking for peaks in a histogram. And I found that if I turn on the “” option instead of “goff”, then when I am running the peak finding in the background suddenly a TCanvas pops up with my histogram and the TPolyMarkers on the found peaks.

If I turn this feature off - by putting “goff” option - then I have no access to the TPolymarkers thru the list of functions of the histogram. And there are no TCanvas pop-ups - which is good…

Isn’t there a way that I could access the TPolymarkersof my histogram but the histogram isn’t drawn on a TCanvas (suddenly) but I can draw it anytime I want - with the TPolyMarkers on it?




TH1 *h; //your histogram TSpectrum s; int npeaks = s.Search(h,1,"goff"); TPolyMarker *pm = new TPolyMarker(npeaks, s.GetPositionX(),s.GetPositionY()); h->SetMarkerStyle(21); h->GetListOfFunctions()->Add(pm);
then to draw the histogram with the polymarkers


Hi Rene,

Great - good trick!