HELLO WELCOME TO HCM,
As becoz u have masturbated hardly , there is a possibility that the muscle that constitutes the penis have been suffered from soreness due to pumping them with excess of force...thats the reason u are getting pain while erection.. it will reduce gradually and nothing to worry about.
u take some simple pain killers like paracetamol
and use ofloxocin 200 mg twice daily for 5 days ..u will get relief.. also avoid masturbation
for 1 week...
hope this will help u