How to get current template file used by WordPress?

In this specific case you could simply follow the logic: determine if you’re on an archive page and what the current post type is. Like this:

if (is_archive() && 'books' == get_post_type) { do your thing }

Or you could use the function specific for checking this:

if (is_post_type_archive('books')) { do your thing }