Example to illustrate smoothing using Markov algorithm (class TSpectrum).
void Smoothing() {
const Int_t nbins = 1024;
TString file = dir+
"/spectrum/TSpectrum.root";
h->SetTitle("Smoothed spectrum for m=3");
for (i = 0; i < nbins; i++) source[i]=h->GetBinContent(i + 1);
h->SetAxisRange(1,1024);
TH1F *smooth =
new TH1F(
"smooth",
"smooth",nbins,0.,nbins);
for (i = 0; i < nbins; i++) smooth->
SetBinContent(i + 1,source[i]);
}
- Author
- Miroslav Morhac
Definition in file Smoothing.C.