Measurement of the Higgs trilinear self-coupling from the HH -> bb̄gammagamma and ttH(gammagamma) channels with the CMS detector