Classification of cocyclic Butson Hadamard matrices