Analysis code for T1041 test beam run