  We present a calculation of the NLO QCD corrections to heavy flavor
photoproduction with longitudinally polarized beams. We apply our results to
study the spin asymmetry for total charm quark production which will be used
for a first direct determination of Delta g by the COMPASS experiment. We also
briefly discuss the main theoretical uncertainties inherent in this
calculation.
