The working principle of hybrid perovskite gamma-ray photon counter