The phrase "to prevent the shooting" means taking action to stop or avoid a situation where someone uses a firearm to cause harm or take someone's life. Full definition
Students were then given the chance to question the administration on its plans for preventing shootings at their school. (nycleadershipacademy.org)
He realized that if he wanted to reduce deaths from firearms, he needed to prevent shootings in the first place. (scientificamerican.com)
Supporters of gun rights have argued the remedies proposed by gun control advocates won't prevent another shooting, leaving them to push for school safety measures. (nystateofpolitics.com)