  This article treats various aspects of the geometry of the moduli of r-spin
curves and its compactification. Generalized spin curves, or r-spin curves, are
a natural generalization of 2-spin curves (algebraic curves with a
theta-characteristic), and have been of interest lately because of the
similarities between the intersection theory of these moduli spaces and that of
the moduli of stable maps. In particular, these spaces are the subject of a
remarkable conjecture of E. Witten relating their intersection theory to the
Gelfand-Dikii (rth KdV) heirarchy. There is also a W-algebra conjecture for
these spaces, analogous to the Virasoro conjecture of quantum cohomology.
  We construct a smooth compactification of the stack of smooth r-spin curves,
describe the geometric meaning of its points, and prove that it is projective.
We also prove that when r is odd and g>1, the compactified stack of spin curves
and its coarse moduli space are irreducible, and when r is even and g>1, the
stack is the disjoint union of two irreducible components. We give similar
results for n-pointed spin curves, as required for Witten's conjecture, and
also generalize to the n-pointed case the classical fact that when g=1, the
moduli of r-spin curves is the disjoint union of d(r) components, where d(r) is
the number of positive divisors of r. These irreducibility properties are
important in the study of the Picard group of the stack, and also in the study
of the cohomological field theory related to Witten's conjecture (see
math.AG/9905034).
