12 void Background_compton() {
14 const Int_t nbins = 256;
16 Double_t xmax = nbins;
17 Double_t source[nbins];
20 TH1F *d1 =
new TH1F(
"d1",
"",nbins,xmin,xmax);
22 TString dir = gROOT->GetTutorialDir();
23 TString file = dir+
"/spectrum/TSpectrum.root";
24 TFile *f =
new TFile(file.Data());
25 TH1F *back = (TH1F*) f->Get(
"back3");
26 back->SetTitle(
"Estimation of background with Compton edges under peaks");
27 back->GetXaxis()->SetRange(1,nbins);
30 TSpectrum *s =
new TSpectrum();
32 for (i = 0; i < nbins; i++) source[i]=back->GetBinContent(i + 1);
33 s->Background(source,nbins,10,TSpectrum::kBackDecreasingWindow,
34 TSpectrum::kBackOrder8,kTRUE,
35 TSpectrum::kBackSmoothing5,kTRUE);
36 for (i = 0; i < nbins; i++) d1->SetBinContent(i + 1,source[i]);
37 d1->SetLineColor(kRed);