Hi @fstocker,
This forum post looks similar to what you are trying to attain.
However, the following was suggested in RootTalk here:
TH2D histo(...);
// ...
TMatrix m(nbinsx+2, nbinsy+2, histo.GetArray(), "F")
Maybe @couet and/or @moneta can confirm the validity of the last method?
Cheers,
J.