Not sure. In general this sounds a bit strange to me. You have multiple times the same reference? I have just googled. Maybe this works:
// get a list of sort columns and their data to pass to array_multisort
$sort = array();
foreach($products as $k=>$v) {
$sort['reference'][$k] = $v['reference'];
$sort['location'][$k] = $v['location'];
}
// sort by event_type desc and then title asc
array_multisort($sort['reference'], SORT_DESC, $sort['location'], SORT_ASC,$products);