new simulation code for beam test