Pain itself can be pleasurable accidentally in so far as it is accompanied by wonder, as in stage-plays; or in so far as it recalls a beloved object to one's memory, and makes one feel one's love for the thing, whose absence gives us pain. Consequently, since love is pleasant, both pain and whatever else results from love, in so far as they remind us of our love, are pleasant.
Summa Theologica, (Complete): (ed. Library of Alexandria, 1845) - ISBN: 9781465523815