How to choose a cassette?

I’m beginning to plan for my first A priority race, the 1/2 IM in Lubbock. I can’t figure out what cassette I need. From the event web site the bike course is “flat
with 8 challenging hills, ranging from 8-13% grade and a quarter of a mile to 1.2 miles in
length.” So the course is basically very flat indicating that I would want a cassette with a very narrow range but there are 8 tough, short hills.

In general, how do I go about choosing a cassette for a particular race? For this race, do I optimize for the flats and then just suffer on the hills?

I pre-road the cource this winter. I am going to use a 12-25. I want the lower ratio for the hills to save legs for the run. It’s ridable in a 23 but the 25 makes a lot more sence to me.

Stupid question but I thought I’d verify it before I go to far. On www.analyticcycling.com I was going through some of their gearing functions. I’m using 0.7m as the diameter of the wheel. Is this the correct total diameter? What I mean, does 700c refer to the tire or the wheel?

My philosophy is figure out what gear you need on the hardest climb and go one easier for your largest cog in case things get tough such as wind or you don’t feel good. Err on the side of caution. If you think you can do it in a 42/21 get a 42/23.