A layer correlation technique for pion energy calibration at the 2004 ATLAS Combined Beam Test