I work at a nuclear power plant. As one would hope and expect, there are times when one has to perform a task that requires uninterrupted concentration. An interruption can provide a "human-performance error trap." A formal (and actually proceduralized) "human-performance tool" is to use a "do not disturb" sign.
You simply make up a sign (8.5-inch by 11-inch, monochrome, laser-printed sheet of paper is fine) with the words "do not disturb" and your supervisor's name and phone number. You then hang it up on a string (rope, plastic chain, rubber band) across your cubicle entry (or put it on the outside of your closed door, if you are fortunate enough to have one). Anyone who wants to disturb you is "expected" to see your supervisor first in order to obtain permission to interrupt you during the performance of your task. (And woe to anyone at a nuclear power plant who deviates from "expectations"!)
Of course, another potential error trap is "assumptions," and I have just assumed that your firm's culture supports the concept of workers' respecting each other's requests and need to not be interrupted while performing some activity.
That would be the means to keep the people out of your space. To address ambient office noise, some of my colleagues wear ordinary hearing-protection devices (i.e., earmuffs or ear plugs) to reduce the noise level. As has already been mentioned, ear-buds or headphones with music or white-noise can also be used.
I hope this helps.