11 void Background_decr() {
13 const Int_t nbins = 1024;
15 Double_t xmax = nbins;
16 Double_t source[nbins];
19 TH1F *d =
new TH1F(
"d",
"",nbins,xmin,xmax);
21 TString dir = gROOT->GetTutorialDir();
22 TString file = dir+
"/spectrum/TSpectrum.root";
23 TFile *f =
new TFile(file.Data());
24 TH1F *back = (TH1F*) f->Get(
"back1");
25 back->SetTitle(
"Estimation of background with decreasing window");
26 back->GetXaxis()->SetRange(1,nbins);
29 TSpectrum *s =
new TSpectrum();
31 for (i = 0; i < nbins; i++) source[i]=back->GetBinContent(i + 1);
34 s->Background(source,nbins,6,TSpectrum::kBackDecreasingWindow,
35 TSpectrum::kBackOrder2,kFALSE,
36 TSpectrum::kBackSmoothing3,kFALSE);
39 for (i = 0; i < nbins; i++) d->SetBinContent(i + 1,source[i]);
40 d->SetLineColor(kRed);