  Given a quasi-projective scheme M over complex numbers equipped with a
perfect obstruction theory and a morphism to a nonsingular quasi-projective
variety B, we show it is possible to find an affine bundle M'/ M that admits a
perfect obstruction theory relative to B. We study the resulting virtual cycles
on the fibers of M'/B and relate them to the image of the virtual cycle [M]^vir
under refined Gysin homomorphisms. Our main application is when M is a moduli
space of stable codimension 1 sheaves with a fixed determinant L on a
nonsingular projective surface or Fano threefold, B is the linear system |L|,
and the morphism to B is given by taking the divisor associated to a coherent
sheaf.
