According to the costume department at the Theatre Museum, Covent Garden, the origin of a gentleman doffing his hat when greeting a lady was that he had a secret stash of scented herbs hidden in the crown of the hat - by waving the hat around as the lady got into sniffing distance, the hope was that she wouldn't be able to tell that he hadn't had a wash since 1542. Good idea !