Example to illustrate smoothing using Markov algorithm (class TSpectrum).
Øp_šé
void Smoothing()
{
const Int_t nbins = 1024;
TString file = dir +
"/legacy/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++)
}
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
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)
void Draw(Option_t *option="") override
Draw this histogram with options.
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...
Advanced Spectra Processing.
const char * SmoothMarkov(Double_t *source, Int_t ssize, Int_t averWindow)
const char * Data() const
- Author
- Miroslav Morhac
Definition in file Smoothing.C.