The ECU (Jaguar calls it Engine Control Module , ECM) does exactly that. It takes inputs from many sensors and adjusts the fuelling and ignition timing dynamically so that the engine runs correctly under all operating conditions. If yours cannot be repaired (and there are several specialists in the US who seem to be able to repair these) you will have to find another one from a car that has been scrapped.
ECMs are programmed to match the update status of the car the other modules that it communicates with so it is important to get one with the same number. If you still have the module, the number is on the label and the last two letters are especially important because these describe the version. If you do not have it, if you look in the boot, on the inside of the back panel of the car, there should be a list of all the modules fitted to your car and the revision numbers.
The ECM itself is located under the bonnet on the passenger side of the vehicle towards the firewall. It is under a cover which is fixed with tamper proof screws. Also under this cover you’ll find the transmission control module.