A more microscopic view of the cross section is
where is number of incident particle, is the total cross section, is the particle density in the target, is the area, is the thickness of the target, and is particle detected.
The cross section is a constant, so, after integration,
If the beam is not uniform, is a function of . The integration has to be careful.