TH2D but seen as TH1D

Dear rooters,

I have a code performing (inverse) FFT of a 2D image:

Int_t nBins[2] = {nBinsX,nBinsY};
TVirtualFFT *fft_back = TVirtualFFT::FFT(2,nBins,“C2R M K”);
fft_back->SetPointsComplex(re_full,im_full);
fft_back->Transform();

TH1 *hb = 0; // putting here TH2 does not work
hb = TH1D::TransformHisto(fft_back,hb,“Re”);
// here hb is actually TH2D:
hb->Draw(“COLZ”); // inspect says hb is TH2D…
but when I try:
TH1D hbproj=(TH2D)hb->ProjectionX();

I get:
Error: Can’t call TH1::ProjectionX() in current scope analyse.C:105:
Possible candidates are…
(in TH1)
*** Interpreter error recovered ***

root 5.34.01.

what should I do to get the profile?

Cheers,

 Mariusz

TH1D hbproj = ((TH2D)hb)->ProjectionX();