void deconve() { // TFile *x = new TFile("df24.root","update"); TSpectrum pfinder; TFile *f = new TFile("Shift.root"); TH1F *hins = (TH1F*)f->Get("newhins"); TH1F *hinr = (TH1F*)f->Get("newhinr"); Int_t size = hins->GetXaxis()->GetNbins(); float *source, *resp; source = new float [size]; resp = new float [size]; Float_t total_source=0.; Float_t total_resp=0.; Int_t i; for (i=0;iGetBinContent(i+1); resp[i] = hinr->GetBinContent(i+1); } pfinder.Deconvolution(source,resp,size,1,1,1);//function which deconvolves source spectrum according to response spectrum // Deconvolution(float *source, const float *response,Int_t ssize, Int_t numberIterations,Int_t numberRepetitions, Double_t boost ); Int_t kkk; kkk=6545; TH1F *hout = new TH1F("Deconvolved","f24 521",size,0+kkk,size+kkk); for (i=0;iFill(i+0.5+kkk,source[i]); } gStyle->SetFrameFillColor(18); TCanvas *c1 = new TCanvas("c1","Background estimator",600,800); c1->SetFillColor(38); c1->Divide(1,2); c1->cd(1); // draw original spectrum and response signal hinr->SetLineColor(4); hinr->Draw(); hins->Draw("same"); // hins->Draw(); // draw deconvolution c1->cd(2); // hout->Rebin(2); hout->Draw(); hout->SetName("df24_521"); // x->cd(); // df24_521->Write(); // x->Write(); // x->Close(); c1->cd(); delete [] resp; delete [] source; }