void read_TH2D(){ TFile *f = new TFile("TH2D.root"); TH2D *h2 = (TH2D*)f->Get("PDM"); Int_t x, y; Float_t photons; for (x=0; x<48; x++) { cout<<"----------" <GetBinContent(x,y); cout<<"bin("<Draw(); }