TGraph2D SetPoint problems inside a non-for loop

Hi Wile,
Ok, I tried running the code on another root version : root_v5.30.06.Linux-slc5-gcc4.3 (binaries). Same problem.
I encountered a different problem with the installation, on the same OS

https://root-forum.cern.ch/t/root-v5-30-06-installation-problems-with-xrdsec-error-2/15422/1

but anyway its a separate issue.

I was wrong when I said the problem was in

g2Deff->SetPoint(ifilter,igoodChan, iocData_elem, avPixCount);

but it is actually at

g2Deff->Draw("surf4");

Not asking g2Deff->Draw(“surf4”) presents no problems. Am I missing some lines before g2Deff->Draw(“surf4”)?
Thanks.
F.