using Upvd_t = std::unique_ptr; TString dir = gROOT->GetTutorialDir(); TFITSHDU hdu(dir + "/fitsio/sample4.fits[1]"); std::array vs{Upvd_t(hdu.GetTabRealVectorCell(0, "mag")), Upvd_t(hdu.GetTabRealVectorCell(1, "mag"))}; for (auto &&v : vs) { for(auto i : ROOT::TSeqI(v->GetNoElements())) { if (i > 0) printf(", "); printf("%lg", (*v)[i]); // NOTE: the asterisk is for using the overloaded [] operator of the TVectorD object } printf(")\n"); } // We now dump all rows using the function GetTabRealVectorCells() std::unique_ptr vectorCollection(hdu.GetTabRealVectorCells("mag")); for (auto vObj : *vectorCollection) { auto &v = *static_cast(vObj); for (auto i : ROOT::TSeqI(v.GetNoElements())) { if (i > 0) printf(", "); printf("%lg", (v[i])); } printf(")\n"); } gROOT->GetListOfCanvases()->Draw()