It could be a possible reaction with the medications you're taking and depending on how long it's been since you've had sex, if it was amazing and you haven't had it for a long time, then you could be relishing upon it and having the pleasurable feelings being elicited. It could be due to stimulation from parts of the frontal and pre-frontal cortex, nucleus accumbens and rest of of the DA, 5-HT and other systems. When you think about the recent event (which would've caused all those areas plus others to be activated a lot), then they would be activated while you think of them (consciously or subconsciously) to produce the effects.
A more psychological explanation could be that if you're usually feeling somewhat down then having this great sexual experience could have temporarily shattered the depression and is causing the euphoric-like high because an urge that hasn't been met for a while was finally met exceptionally well.