35 ATH_MSG_INFO(
"Using " << m_eventsKey.fullKey() <<
" as the source collections for new truth collections");
37 ATH_MSG_INFO(
"New truth vertex collection key: " << m_outVtxKey.fullKey() );
39 return StatusCode::SUCCESS;
48 if (!importedTruthEvents.isValid()) {
49 ATH_MSG_ERROR(
"No TruthEvent collection with name " << m_eventsKey.fullKey() <<
" found in StoreGate!");
50 return StatusCode::FAILURE;
55 ATH_CHECK(writeHandleVtx.record(std::make_unique<xAOD::TruthVertexContainer>(),
56 std::make_unique<xAOD::TruthVertexAuxContainer>()));
58 ATH_MSG_DEBUG(
"Recorded new TruthVertexContainer with key: " << m_outVtxKey.fullKey());
61 for (
const auto *
event : *importedTruthEvents){
67 if (!old_vert &&
event->nTruthVertices()>0){
68 old_vert =
event->truthVertex(0);
74 newVertexCollection->
push_back( xTruthVertex );
78 xTruthVertex->
setX(old_vert->
x());
79 xTruthVertex->
setY(old_vert->
y());
80 xTruthVertex->
setZ(old_vert->
z());
81 xTruthVertex->
setT(old_vert->
t());
83 ATH_MSG_WARNING(
"No signal vertex or vertices associated to an input event!");
86 return StatusCode::SUCCESS;