I usually need to write something like

\begin{align*}

|\sum\limits a_{n}| , |\int f(x) , dx |

\end{align*}

I want to automatically make symbol “|” larger when the sum or integral is in “| |”

So far, I can only type “\bigg” in front of “|” to enlarge the symbol. Any help? Thanks!