Example to illustrate the Markov smoothing (class TSpectrum2).
void Smooth() {
const Int_t nbinsx = 256;
const Int_t nbinsy = 256;
TString file = dir+
"/spectrum/TSpectrum2.root";
auto smooth = (
TH2F*)
f->Get(
"smooth1");
for (
i = 0;
i < nbinsx;
i++){
for (j = 0; j < nbinsy; j++){
source[
i][j] = smooth->GetBinContent(
i + 1,j + 1);
}
}
s->SmoothMarkov(source,nbinsx,nbinsx,3);
for (
i = 0;
i < nbinsx;
i++){
for (j = 0; j < nbinsy; j++)
smooth->SetBinContent(
i + 1,j + 1, source[
i][j]);
}
smooth->Draw("SURF2");
}
R__EXTERN TStyle * gStyle
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
2-D histogram with a float per channel (see TH1 documentation)
Advanced 2-dimensional spectra processing.
const char * Data() const
- Authors
- Miroslav Morhac, Olivier Couet
Definition in file Smooth.C.