Code for Monte Carlo truth studies