Hi and welcome to HCM,
After going through your history , i suspect there two possibilities either there is some infection in the premolar or the molar teeth. Infection at the roots of the teeth often radiate pain along the jaw line.
Infected teeth can be treated with root canal
procedure and the symptom of pain and swelling can be relieved permanently.
secondly , there can be infection in the gingival tissue leading to pain. This can be resolved by deep scaling and root planing of the teeth surfaces.
so i suggest you to get an OPG radiograph done which will show all the teeth,jaw , adjacent vital structures, periodontal bone loss
,extent of infection . accordingly treatment can be planned by your dentist
. i hope this helps you , take care.