Hi,
I’m writing some codes including “TSpectrum”, and I notice that when I run TSpectrum::Search, a histogram will “pop up”. It is a little bit annoying if you run it in the loop and only want to record the positions. So I looked up the source code(TSpectrum.cxx) and found this:
for(i=0;i<npeaks;i++) {
bin = Int_t(fPositionX[i] +0.5);
fPositionX[i] = hin->GetBinCenter(bin);
fPositionY[i] = hin->GetBinContent(bin);
}
if (strstr(option,"goff")) return npeaks;
hin->Draw();
TPolyMarker *pm = new TPolyMarker(npeaks,fPositionX, fPositionY);
pm->SetMarkerStyle(23);
pm->SetMarkerColor(kRed);
pm->SetMarkerSize(1.3);
pm->Draw();
return npeaks;
Apparently, hin->Draw()/pm->Draw() are the reason. If I comment them or change them to if(blabla) hin->Draw(), my problem will be solved.
So, I’d like to know how could I “only” recompile libSpectrum.so(If I do not guess it wrong) from the modified TSpectrum.cxx, or how could I change it in the most easily way.
Thanks.
yjc