Head end power car

A head end power car (also called a generator car) is a rail car that supplies head end power (HEP). Since most modern locomotives supply HEP they are mostly used by heritage railways that use older locomotives, or by railroad museums that take their equipment on excursions. Quite a few head end power cars started out as other forms of rolling stock that have been rebuilt with diesel generators and fuel tanks to supply HEP to the passenger equipment. 
Even if diesel powered carriages are more common, electric ones also exist and are used to provide power to trains when hauled by locos without HEP, or when not attached to a locomotive.