I am currently trying to create a 2D array of TH2D histograms and I am getting an illeagal pointer to class error when I try to fill an array.
I define the histograms as follows:
TH2D *sinogram_u2[NRING][NRING];
char hname[20];
for (j=0; j < NRING-1; j++);
{
for (k=0; k < NRING-1; k++);
{
sprintf(hname,“S_I%d_%d”,j,k);
sinogram_u2[j][k] = new TH2D(hname,“Unsigned Short Integer Sinogram”,NDET,-550,+550.,NDET,0.,pi);
}
}
Where NRING is a constant. This portion of the code seems to work. However, when I try to fill one of these histograms the routine dies.
I am using the following lines to fill the histograms: