Hierarchical Codebook-Based Beam Training for RIS-Assisted mmWave Communication Systems