Bioshock 2's machine gun, also called the minigun, sprays a lot of ammunition at a high rate. This makes it a particularly useful weapon against crowds of opponents, though you can't easily aim the gun at individual targets. You'll eventually get to upgrade the gun with with the Recoil Reduction and Damage Increase enhancements, raising the gun's accuracy and strength. You'll find your first machine gun in glass cabinet in Ryan's Amusements. You cannot break the glass, but you will be able to retrieve it a little further into the game.
Walk west through the Ryan's Amusements park security wing. You will see the minigun behind glass next to a Power to the People upgrade station.
Walk further down the hallway to the manager's office. Inside it, you will see a broken window. Through the window, you'll see a control panel.
Hack the control panel using your hack tool. The door to the left of you will open.
Walk through the door. Pick up a ticket from a desk inside the room.
Turn around and retrace your steps, returning to the glass cabinet. An enemy will have broken the glass. Kill him and take the gun.
Wait until you have the machine gun before using the upgrade station.