11 void Deconvolution() {
13 const Int_t nbins = 256;
15 Double_t xmax = nbins;
16 Double_t source[nbins];
17 Double_t response[nbins];
20 TString dir = gROOT->GetTutorialDir();
21 TString file = dir+
"/spectrum/TSpectrum.root";
22 TFile *f =
new TFile(file.Data());
23 TH1F *h = (TH1F*) f->Get(
"decon1");
24 h->SetTitle(
"Deconvolution");
25 TH1F *d = (TH1F*) f->Get(
"decon_response");
27 for (i = 0; i < nbins; i++) source[i]=h->GetBinContent(i + 1);
28 for (i = 0; i < nbins; i++) response[i]=d->GetBinContent(i + 1);
32 TSpectrum *s =
new TSpectrum();
33 s->Deconvolution(source,response,256,1000,1,1);
35 for (i = 0; i < nbins; i++) d->SetBinContent(i + 1,source[i]);
36 d->SetLineColor(kRed);