24 declareInterface<DerivationFramework::IAugmentationTool>(
this);
36 ATH_MSG_INFO(
"Using " << m_eventsKey.fullKey() <<
" as the source collections for new truth collections");
38 ATH_MSG_INFO(
"New truth vertex collection key: " << m_outVtxKey.fullKey() );
40 return StatusCode::SUCCESS;
47 const EventContext& ctx{Gaudi::Hive::currentContext()};
50 if (!importedTruthEvents.isValid()) {
51 ATH_MSG_ERROR(
"No TruthEvent collection with name " << m_eventsKey.fullKey() <<
" found in StoreGate!");
52 return StatusCode::FAILURE;
57 ATH_CHECK(writeHandleVtx.record(std::make_unique<xAOD::TruthVertexContainer>(),
58 std::make_unique<xAOD::TruthVertexAuxContainer>()));
60 ATH_MSG_DEBUG(
"Recorded new TruthVertexContainer with key: " << m_outVtxKey.fullKey());
63 for (
const auto *
event : *importedTruthEvents){
69 if (!old_vert &&
event->nTruthVertices()>0){
70 old_vert =
event->truthVertex(0);
76 newVertexCollection->
push_back( xTruthVertex );
80 xTruthVertex->
setX(old_vert->
x());
81 xTruthVertex->
setY(old_vert->
y());
82 xTruthVertex->
setZ(old_vert->
z());
83 xTruthVertex->
setT(old_vert->
t());
85 ATH_MSG_WARNING(
"No signal vertex or vertices associated to an input event!");
88 return StatusCode::SUCCESS;