Problem with TSpectrum2 Deconvolution

Dear ROOT Experts

I am trying to deconvolute the two dimensional spectrum with TSpectrum2 class. But some how the programe crashes . It is difficult to figure out the problem. I have seen the TSpectrum2 class where it has been mention about the usage of Deconvolve class but with syntex TSpectrum *s = new TSpectrum(). I do not know how that thing is working for two dimensional case. Can anyone please help me. Here is my source code.

[code]
TFile *fl = TFile::Open(filename);
TH2D hm = (TH2D)fl->Get(“himage”);
Int_t nbinsx = hm->GetNbinsX();
Int_t nbinsy = hm->GetNbinsY();
Int_t i,j;
Float_t **source = new float *[nbinsx];
Float_t **resp = new float *[nbinsx];
for (i=0;i<nbinsx;i++)
{
source[i]=new float[nbinsy];
resp[i]=new float[nbinsy];
}

 //Double_t resp[500][500],source[500][500];

float value=0;
for(i=1;i<nbinsx;i++)
for(j=1;j<nbinsy;j++)
{
value = (float)(1/TMath::Sqrt(ii+jj));
resp[i][j] = value;
//cout<<value<<endl;
}
for(i=0;i<nbinsx;i++)
for(j=0;j<nbinsy;j++)
source[i][j] = hm->GetBinContent(i+1,j+1);
Int_t maxpos = 10;
TSpectrum2 *s = new TSpectrum2(maxpos);
TH2D *hmf = new TH2D(“hmf”,"",nbinsx,-50,50,nbinsy,-50,50);
s->Deconvolution(source,resp,nbinsx,nbinsy,10,1,1);
for(i=0;i<nbinsx,i++)
for(j=0;j<nbinsy;j++)
hmf->SetBinContent(i+1,j+1,source[i][j]);

gStyle->SetPalette(1);
hmf->Draw(“colz”);[/code]

related post: TSpectrum2 deconvolution