Fix bug for eventline computation

replace the update of from varible by beg
clear the interval array after each event number computation