  We study the photon-triggered light and heavy meson production in both p+p
and A+A collisions. We find that a parton energy loss approach that
successfully describes inclusive hadron attenuation in nucleus-nucleus
reactions at RHIC can simultaneously describe well the experimentally
determined photon-triggered light hadron fragmentation functions. Using the
same framework, we generalize our formalism to study photon-triggered heavy
meson production. We find that the nuclear modification of photon-tagged heavy
meson fragmentation functions in A+A collision is very different from that of
the photon-tagged light hadron case. While photon-triggered light hadron
fragmentation functions in A+A collisions are suppressed relative to p+p,
photon-triggered heavy meson fragmentation functions can be either enhanced or
suppressed, depending on the specific kinematic region. The anticipated smaller
energy loss for $b$-quarks manifests itself as a flatter photon-triggered
$B$-meson fragmentation function compared to that for the $D$-meson case. We
make detailed predictions for both RHIC and LHC energies. We conclude that a
comprehensive comparative study of both photon-tagged light and heavy meson
production can provide new insights in the details of the jet quenching
mechanism.
