CCD photometry of galactic open clusters - I. NGC 7790.