Characterization of a YAG:Ce calorimeter with high-energy proton beam