is possible only, if unprotected sexual intercourse is done around ovulation time in regular period. In your case, it is not sign of pregnancy.
You are probably suffering from dysmenorrhoea (painful period) and needs to rule out underlying pathology if any by one USG scan & pelvic examination. So consult with your doctor regarding this.
Do some basic following things:
1) avoid salty food/ coffee in 2nd half of period,
2) Avoid stress
by yoga/deep breathing,
3) Control body wt by regular physical exercise
4) Take healthy diet with iron supplements
and drink lots of water
5) use some medication like anti spasmodic for cramp
6) maintain personal hygiene and need proper sleep.
Be well and take care.