presence of mind

The ability to stay calm and think clearly in emergencies.