4. Given the parabola $C: y^{2}=4 x$ with focus $F$, the intersection of the axis of symmetry and the directrix is point $T$, and $P$ is any point on the parabola $C$. When $\frac{|P F|}{|P T|}$ takes the minimum value, $\angle P T F$ equals
A. $\frac{\pi}{3}$
B. $\frac{\pi}{4}$
C. $\frac{\pi}{5}$
D. $\frac{\pi}{6}$
Let $P\left(t^{2}, 2 t\right), F(1,0), T(-1,0)$, then $\frac{|P T|^{2}}{|P F|^{2}}=\frac{\left(t^{2}+1\right)^{2}+4 t^{2}}{\left(t^{2}+1\right)^{2}}=1+\frac{4 t^{2}}{\left(t^{2}+1\right)^{2}} \leqslant 2 \Rightarrow \frac{|P F|}{|P T|} \geqslant \frac{\sqrt{2}}{2}$, equality holds when $t= \pm 1$, at this time $\triangle P F T$ is an isosceles right triangle, i.e., $\angle P T F=\frac{\pi}{4}$, so the answer is $B$.