Mnemonic anchor: in a teenager, the triad of evening fever + weight loss + a fixed adherent pelvic mass is genital tuberculosis until proven otherwise.
Work by elimination. A fibroid with degeneration is rare in an 18-year-old and would not produce a wasting, febrile illness. Ectopic pregnancy is acute, needs sexual activity and a positive beta-hCG, and presents over days, not six months. A granulosa cell tumour is a sex-cord stromal tumour that pours out estrogen and typically causes abnormal uterine bleeding, breast changes and precocity, not anorexia and night sweats.
What remains fits TB perfectly: the bacilli seed the fallopian tubes, caseation forms a pyosalpinx, peri-salpingitis glues the tube to the ovary, and the result is a matted tubo-ovarian mass with nodules in the pouch of Douglas. The constitutional symptoms (low-grade pyrexia, malaise, anorexia, anemia, weight loss) and secondary amenorrhea complete the clinical fit.
Ref: Dutta Gynaecology 6e.