The fabrication of CoPt nanowire and nanotube arrays by alternating magnetic field during deposition