Determinants and Moebius functions in trace monoids