Redox reactions and mechanism of luminescence in BaFCl:Eu