Beam position reconstruction for the g2p experiment in Hall A at Jefferson lab