What factors determine the need for lumbar puncture in patients with fever and headache?

What factors determine the need for lumbar puncture in patients with fever and headache?