How is opamp gain calculated in this circuit?
The gain of each stage

IC1a - there is a 10M feedback resistor. Normally you would expect to find a series resistor to the input, to give you a pure ratio Rf/Rg gain. However, the output of the photodiode is a current. This stage gives you volts out for current in, which has dimensions of resistance, not a pure ratio. In this case, the transimpedance is 10Mohms, 10v out for 1uA in.

IC1b, 2a, 2b - each has an Rg of 1k, and Rf of 10k, so the DC gain of each stage is 10. The Cs provide some bandpass filtering.

IC3 is a comparator, with very high gain around the threshhold point (zero gain at other input voltages), you will need to look at the data sheet for that.