Headaches can be caused by a lot of different things. Was it only one time or every time? Just that beer or every beer out of that keg system? You will have to try to switch things up and isolate the cause. Just from experience most headaches are caused by dehydration. 90% of us don't drink enough water, not too mention probably too much alcohol. Could be the beer itself or chemicals associated with cleaning. Could also be working with the CO2. Everyone's body is different and what would cause symptoms in one person won't in another. Try another beer from that keg system, that might give you your first clue if it's the system or the beer itself . Oh and make sure your hydrated ! Hope you figure it out.