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