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;
46 const EventContext& ctx{Gaudi::Hive::currentContext()};
49 if (!importedTruthEvents.isValid()) {
50 ATH_MSG_ERROR(
"No TruthEvent collection with name " << m_eventsKey.fullKey() <<
" found in StoreGate!");
51 return StatusCode::FAILURE;
56 ATH_CHECK(writeHandleVtx.record(std::make_unique<xAOD::TruthVertexContainer>(),
57 std::make_unique<xAOD::TruthVertexAuxContainer>()));
59 ATH_MSG_DEBUG(
"Recorded new TruthVertexContainer with key: " << m_outVtxKey.fullKey());
62 for (
const auto *
event : *importedTruthEvents){
68 if (!old_vert &&
event->nTruthVertices()>0){
69 old_vert =
event->truthVertex(0);
75 newVertexCollection->
push_back( xTruthVertex );
79 xTruthVertex->
setX(old_vert->
x());
80 xTruthVertex->
setY(old_vert->
y());
81 xTruthVertex->
setZ(old_vert->
z());
82 xTruthVertex->
setT(old_vert->
t());
84 ATH_MSG_WARNING(
"No signal vertex or vertices associated to an input event!");
87 return StatusCode::SUCCESS;