How is a particular cylinder number detected by the CAM shaft signal based on the firing?

Depending on manufacturer and engine size the location on a cam shaft and firing order is registered through a magnet or sensor located on a cam gear those sensors are usually called a cam position sensor.If your car does not have a cam position sensor the next way to determine is by the crank position sensor.The crank position sensors purpose is to make sure that the crank and cam stay alligned.All this is monitored through the PCM or computer on your vehicle.