Skip to content
Snippets Groups Projects
Commit 598477ea authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

HLTEDMCreator: pass EventContext explicitly

parent 28578712
Branches mon_stringview
No related tags found
No related merge requests found
Pipeline #10520653 failed
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
......@@ -263,7 +263,7 @@ StatusCode HLTEDMCreator::viewsMerge( ViewContainer const& views, const SG::Rea
}
StatusCode HLTEDMCreator::fixLinks() const {
StatusCode HLTEDMCreator::fixLinks( EventContext const& context ) const {
if ( m_fixLinks.value().empty() ) {
ATH_MSG_DEBUG("fixLinks: No collections defined for this tool");
return StatusCode::SUCCESS;
......@@ -285,7 +285,7 @@ StatusCode HLTEDMCreator::fixLinks() const {
++writeHandleArrayIndex;
ATH_MSG_DEBUG("Fixing links: confirm collection is there: " << writeHandleKey.key() << ", write handle array index: " << writeHandleArrayIndex);
SG::ReadHandle<xAOD::TrigCompositeContainer> readHandle( writeHandleKey.key() );
SG::ReadHandle<xAOD::TrigCompositeContainer> readHandle( writeHandleKey.key(), context );
if ( not readHandle.isValid() ) { // object missing, this is now an error as we should have literally just created it
ATH_MSG_ERROR(" Collection is not present. " << writeHandleKey.key() << " should have been created by createIfMissing.");
return StatusCode::FAILURE;
......@@ -294,8 +294,8 @@ StatusCode HLTEDMCreator::fixLinks() const {
ATH_MSG_DEBUG("Collection exists with size " << readHandle->size() << " Decision objects" );
ATH_MSG_DEBUG("Adding decorations: " << m_remapLinkColKeys.at( writeHandleArrayIndex ).key() << " and " << m_remapLinkColIndices.at( writeHandleArrayIndex ).key() );
SG::WriteDecorHandle<xAOD::TrigCompositeContainer, std::vector<SG::sgkey_t> > keyDecor( m_remapLinkColKeys.at( writeHandleArrayIndex ) );
SG::WriteDecorHandle<xAOD::TrigCompositeContainer, std::vector<xAOD::TrigComposite::index_type> > indexDecor( m_remapLinkColIndices.at( writeHandleArrayIndex ) );
SG::WriteDecorHandle<xAOD::TrigCompositeContainer, std::vector<SG::sgkey_t> > keyDecor( m_remapLinkColKeys.at( writeHandleArrayIndex ), context );
SG::WriteDecorHandle<xAOD::TrigCompositeContainer, std::vector<xAOD::TrigComposite::index_type> > indexDecor( m_remapLinkColIndices.at( writeHandleArrayIndex ), context );
// Examine each input TC
int decisionObjectIndex = -1;
......@@ -355,7 +355,7 @@ StatusCode HLTEDMCreator::createIfMissing( const EventContext& context, const Co
if ( handles.views.empty() ) { // no merging will be needed
// Note: This is correct. We are testing if we can read, and if we cannot then we write.
// What we write will either be a dummy (empty) container, or be populated from N in-View collections.
SG::ReadHandle<T> readHandle( writeHandleKey.key() );
SG::ReadHandle<T> readHandle( writeHandleKey.key(), context );
if ( readHandle.isValid() ) {
ATH_MSG_VERBOSE( writeHandleKey.key() << " is already present" );
generator.create(false, false);
......@@ -365,7 +365,7 @@ StatusCode HLTEDMCreator::createIfMissing( const EventContext& context, const Co
// The TriggerEDMDeserialiserAlg will already have created a DataLink to the Aux store
// for the interface container. Now we just need to create an empty Aux store.
if constexpr (!std::is_void_v<STORE>) {
SG::ReadHandle<STORE> readAuxHandle( writeHandleKey.key() + "Aux." );
SG::ReadHandle<STORE> readAuxHandle( writeHandleKey.key() + "Aux.", context );
if ( !readAuxHandle.isValid() ) {
SG::WriteHandle<STORE> writeAuxHandle( writeHandleKey.key() + "Aux." );
ATH_MSG_DEBUG("Creating missing Aux store for " << writeHandleKey.key());
......@@ -505,7 +505,7 @@ StatusCode HLTEDMCreator::createOutput(const EventContext& context) const {
CREATE_XAOD( MuonRoIContainer, MuonRoIAuxContainer );
// After view collections are merged, need to update collection links
ATH_CHECK( fixLinks() );
ATH_CHECK( fixLinks(context) );
#undef CREATE_XAOD
......
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRIGOUTPUTHANDLING_HLTEDMCREATOR_H
#define TRIGOUTPUTHANDLING_HLTEDMCREATOR_H 1
......@@ -223,7 +223,7 @@ class HLTEDMCreator: public extends<AthAlgTool, IHLTOutputTool> {
const SG::ReadHandleKeyArray< ViewContainer >& views;
};
StatusCode fixLinks() const;
StatusCode fixLinks( EventContext const& context ) const;
template<typename T, typename STORE, typename G, typename M >
StatusCode createIfMissing( const EventContext& context, const ConstHandlesGroup<T>& handles,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment