Pressurized hydrogen-based superconductors are phonon-mediated superconductors that exhibit high phonon frequencies. In these superconductors, in addition to the density of states (DOS) at the Fermi energy ( \(E_F\) ), the energy dependence of the DOS around \(E_F\) becomes important for evaluating their transition temperature ( \(T_c\) ). Systems with peak structures in the DOS around \(E_F\) , such as \(Im\bar{3}m\) H \(_{3}\) S and \(Fm\bar{3}m\) LaH \(_{10}\) , highlight this point. We use the fully ab initio Eliashberg method to investigate this phenomenon in \(Im\bar{3}m\) CaH \(_{6}\) and \(Fm\bar{3}m\) ThH \(_{10}\) with a dip structure in their DOS around \(E_F\) . Our calculated \(T_c\) values (225–235 K for CaH \(_{6}\) at 200 GPa and 156–158 K for ThH \(_{10}\) at 170 GPa) are quantitatively consistent with the experimental results. Remarkably, our results from the self-consistent treatment of the electron Green’s function contrasts with those cases with a peak structure in the DOS. This finding unifies the understanding of how DOS structures influence the evaluation of \(T_c\) .