A fast tracking code for evaluating collective effects in linear accelerators