Modified keepSelectedParticles; added event reconstruction code