Here is the British Rail codes information.
British Railways Standard Headlamp Codes
Four positions are used for headlamp, one on the smokebox below the funnel, and three on the buffer beam, one in the middle, and the other two approximately one over each of the buffers.
Diagramtically, they are shown thus, looking towards the train, with O for a lamp, and x an empty bracket:
OxO (This combination of three lamps reserved for a royal train)
Group 1: Express Passenger Train. Breakdown Train going to clear the line, o Light Engine going to assist disabled train. Empty Coaching-Stock Train timed at express passenger train speed.
Group 2: Ordinary Passenger Train. Mixed Train. Breakdown Train not going to clear the line. Branch Passenger Train. Rail Motor Train or Railcar.
Group 3: Express Freight or Ballast Train authorised to run at a maximum speed of 35 mph. Empty Coaching-Stock Train not carrying headlamps for group 1.
Group 4: Parcels, Nespaper, Fish, Meat, Fruit, Milk, Horsebox, Cattle or Perishable Goods Train composed of vacuum-braked stock with brake pipe connected to engine. Express Freight Train. Livestock, Perishable or Ballast Train with not less than one-third of the vacuum-braked vehicles connected to the engine.
Group 5: Freight Mineral or Ballast Train. Train of empties carrying a through load to destination.(?)
Group 6: Express Freight, Fish, Meat, Fruit or Cattle Train. Ballast Train not running under group 3 or 4 headlamps. Special Train conveying 36 ton breakdown crane but not proceeding to an accident.
Group 7: Through Fast Train not running under group 3, 4 or 5 headlamps and carrying a through load.
Group 8: Light Engine or Light Engines coupled together. Engine and brakevan.
Group 9: Freight, Mineral or Ballast Train stopping at intermediate stations.
Group 10: Ballast, Freight or Inspection Train requiring to stop between signal boxes (in the section). Branch Freight Train.
N.B. Headlamp codes are subject to alteration in the case of "through" trains working over branch lines, and also to minor variations on the different Regions of British Railways.