Hi there, welcome. So there is something called 'restless leg syndrome' and it is a diagnosis that involves pain in legs. Do you notice the pain in your thigh when you are mostly at rest? There isn't a lot of good treatment for it unfortunately as doctors don't really know why it happens but possibly due to dopamine issues in the brain. It IS often genetic it seems as families can have it (more than one member). Things that are used to help are leg massages, warm baths, heating pad, some use ice packs (I know, both work though), good sleep habits. limiting caffeine and tobacco, a Relaxis vibrating pad and there are medications that have been used to treat it such as Requip and a couple of others with the indication.
I would ask your doctor about restless leg syndrome to see if it is a match to your symptoms. Not sure how orgasm plays a role but I guess you can't do that each time you need relief (like in class or out with the girls at a movie, ha). good luck
Me again, mostly it's my right thigh that hurts