modify the gemdphi calculation function to assign valid gemdphi to LCT when gem is available in reasonable position