compute sum, sqSum and CoG of clusters