This is not an easy question to answer without being seen.
It IS possible that your cough is related to years of smoking. That is called Chronic Bronchitis. A good physical examination, a chest xray and lung function tests will help with this diagnosis.
You OCD could also be a primary cause or aggravating an existing Bronchitis.
Chronic cough can also be due to other causes.
Seeing your physician and having some basic tests would be a good idea to get some definitive answer to your questions.