Geared steam locomotive
A geared steam locomotive is a type of steam locomotive which uses gearing, usually reduction gearing, in the drivetrain, as opposed to the common directly driven design.
Rack railway
Originally almost all cog railways were powered by steam locomotives. The steam locomotive needs to be extensively modified to work effectively in this environment. Unlike a Diesel locomotive or electric locomotive, the steam locomotive only works when its powerplant (the boiler, in this case) is fairly level. The locomotive boiler requires water to cover the boiler tubes and firebox sheets at all times, particularly the crown sheet, the metal top of the firebox. If this is not covered with water, the heat of the fire will soften it enough to give way under the boiler pressure, leading to a catastrophic failure.