A locomotive designated class BP20 would be a Baldwin passenger locomotive with 2000 horsepower. The real class BP20 locomotives were the unique-to-PRR passenger Baldwin Sharknoses.
A locomotive designated class ES12m would be a EMD switcher (shifter, if you prefer) with 1200 horsepower, equipped for multiple-unit control. The real class ES12m units were EMD SW-7 units.
A trickier designation is class ABF18. It does not hold to the above rules; A number of the Baldwin freight Sharknose locomotives were sent to Alco Products for repowering, and were subsequently reclassed ABF18. This indicated Alco/Baldwin freight units with 1800 horsepower. Who would have guessed?
Prior to this system coming into use, first a system used for steam locomotives was in use. Later it changed to a system like the above, excepting that instead of the numbers after the initial letters designating horsepower, they denoted the sequence in which that model of engine was acquired within the scope of its purpose and manufacturer. Thus for example the Baldwin Centipede, being the first passenger units acquired from Baldwin, were initially class BP1, and had another set of Baldwin passenger units been acquired before the classification system denoted above been adopted, they would have been class BP2. The Centipedes, by the way, fit as delivered into class BP60, but after they were run through Altoona and modified for helper service, they finished out their years as class BH50, meaning the units had been derated to 5000 horsepower.
Thanks to Andy Miller for reminding me of this.