Commit 31ccba88 authored by Zach Marshall's avatar Zach Marshall
Browse files

Protecting HepMCTruthReader against null signal vertex

In some EVNT samples, the signal vertex is null. The code was
segfaulting in those cases. This tweak protects against such a crash.
parent 564a358c
......@@ -56,9 +56,10 @@ StatusCode HepMCTruthReader::execute() {
if (cntr==0) {
HepMC::GenVertex* signalProcessVtx = genEvt->signal_process_vertex();
ATH_MSG_INFO("Signal process vertex position: (" << signalProcessVtx->position().x()
<< ", " << signalProcessVtx->position().y() << ", " << signalProcessVtx->position().z() << "). Pointer: "
<< signalProcessVtx);
ATH_MSG_INFO("Signal process vertex position: (" << (signalProcessVtx?signalProcessVtx->position().x():0)
<< ", " << (signalProcessVtx?signalProcessVtx->position().y():0)
<< ", " << (signalProcessVtx?signalProcessVtx->position().z():0)
<< "). Pointer: " << signalProcessVtx);
}
printEvent(genEvt);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment