code to segment multielectrode spike trains into events