Lefschetz-Riemann-Roch theorem and coherent trace formula