17 const Int_t nbins = 1024;
25 TString file = dir +
"/legacy/spectrum/TSpectrum.root";
28 h->SetTitle(
"High resolution peak searching, number of iterations = 3");
29 h->GetXaxis()->SetRange(1, nbins);
33 for (i = 0; i < nbins; i++)
34 source[i] =
h->GetBinContent(i + 1);
42 for (i = 0; i < nfound; i++) {
45 fPositionX[i] =
h->GetBinCenter(bin);
46 fPositionY[i] =
h->GetBinContent(bin);
51 h->GetListOfFunctions()->Remove(pm);
54 pm =
new TPolyMarker(nfound, fPositionX, fPositionY);
55 h->GetListOfFunctions()->Add(pm);
60 for (i = 0; i < nbins; i++)
61 d->SetBinContent(i + 1, dest[i]);
62 d->SetLineColor(
kRed);
65 printf(
"Found %d candidate peaks\n", nfound);
66 for (i = 0; i < nfound; i++)
67 printf(
"posx= %f, posy= %f\n", fPositionX[i], fPositionY[i]);
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
1-D histogram with a float per channel (see TH1 documentation)
A PolyMarker is defined by an array on N points in a 2-D space.
Advanced Spectra Processing.
Int_t SearchHighRes(Double_t *source, Double_t *destVector, Int_t ssize, Double_t sigma, Double_t threshold, bool backgroundRemove, Int_t deconIterations, bool markov, Int_t averWindow)
Double_t * GetPositionX() const
const char * Data() const