Example to illustrate smoothing using Markov algorithm (class TSpectrum).
void Smoothing() {
const Int_t nbins = 1024;
h->SetTitle(
"Smoothed spectrum for m=3");
for (i = 0; i < nbins; i++) source[i]=
h->GetBinContent(i + 1);
TH1F *smooth =
new TH1F(
"smooth",
"smooth",nbins,0.,nbins);
s->SmoothMarkov(source,1024,3);
for (i = 0; i < nbins; i++) smooth->
SetBinContent(i + 1,source[i]);
}
virtual void SetLineColor(Color_t lcolor)
Set the line color.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual void Draw(Option_t *option="")
Draw this histogram with options.
Advanced Spectra Processing.
static constexpr double s
- Author
- Miroslav Morhac
Definition in file Smoothing.C.