  Let K \subset Y be a knot in a three manifold which admits a longitude-framed
surgery such that the surgered manifold has first Betti number greater than
that of Y. We find a formula which computes the twisted Floer homology of the
surgered manifold, in terms of twisted knot Floer homology. Using this, we
compute the twisted Heegaard Floer homology \underline{HF}^+ of the mapping
torus of a diffeomorphism of a closed Riemann surface whose mapping class is
periodic, giving an almost complete description of the structure of these
groups. When the mapping class is nontrivial, we find in particular that in the
"second-to-highest" Spin^c structure, this is isomorphic to a free module (over
a certain ring) whose rank is equal to the Lefschetz number of the
diffeomorphism. After taking a tensor product with Z/2Z, this agrees precisely
with the symplectic Floer homology of the diffeomorphism, as calculated by
Gautschi.
