Focused alertness, quick-thinking resourcefulness, stability of thought and feeling, or good sense, especially in spite of circumstances which are distracting, stressful, or otherwise challenging.
self-command
noun
The conscious control of one's own behaviour.
How often have the words presence of mind and self-command occurred in a corpus of books? (source: Google Ngram Viewer )