diff --git a/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx b/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx index 88cb344401697496485be012d6b01cb7772b35e3..d9af3ca4fdf99170eee504fe82860b97eb397685 100644 --- a/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx +++ b/Reconstruction/eflowRec/src/PFTrackPreselAlg.cxx @@ -1,17 +1,14 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #include "PFTrackPreselAlg.h" #include "StoreGate/ReadHandle.h" #include "StoreGate/WriteHandle.h" +#include "StoreGate/WriteDecorHandle.h" #include "AthContainers/ConstDataVector.h" #include <memory> -namespace { - const SG::AuxElement::Decorator<char> decPass("passPFTrackPresel"); -} - PFTrackPreselAlg::PFTrackPreselAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) { @@ -23,7 +20,12 @@ StatusCode PFTrackPreselAlg::initialize() { ATH_CHECK( m_inputTracksKey.initialize() ); ATH_CHECK( m_outputTracksKey.initialize() ); + + m_outputDecorKey = m_inputTracksKey.key()+"."+m_outputDecorKey.key(); + ATH_CHECK( m_outputDecorKey.initialize() ); + ATH_CHECK( m_trackSelTool.retrieve() ); + return StatusCode::SUCCESS; } @@ -35,6 +37,9 @@ StatusCode PFTrackPreselAlg::execute(const EventContext &ctx) const ATH_MSG_ERROR("Failed to retrieve " << m_inputTracksKey); return StatusCode::FAILURE; } + + SG::WriteDecorHandle<xAOD::TrackParticleContainer, char> decPass(m_outputDecorKey, ctx); + auto output = std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(SG::VIEW_ELEMENTS); for (const xAOD::TrackParticle* itrk : *input) { @@ -48,5 +53,6 @@ StatusCode PFTrackPreselAlg::execute(const EventContext &ctx) const } auto outputHandle = SG::makeHandle(m_outputTracksKey, ctx); ATH_CHECK(outputHandle.put(std::move(output)) != nullptr); + return StatusCode::SUCCESS; } diff --git a/Reconstruction/eflowRec/src/PFTrackPreselAlg.h b/Reconstruction/eflowRec/src/PFTrackPreselAlg.h index 3d3d923dceaeef7981b156d8ee149b63c1a49cdc..217a1c907d58d0b22104b1ef951028a6729d5592 100644 --- a/Reconstruction/eflowRec/src/PFTrackPreselAlg.h +++ b/Reconstruction/eflowRec/src/PFTrackPreselAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef EFLOWREC_PFTRACKPRESELALG_H #define EFLOWREC_PFTRACKPRESELALG_H @@ -7,6 +7,7 @@ #include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "StoreGate/ReadHandleKey.h" #include "StoreGate/WriteHandleKey.h" +#include "StoreGate/WriteDecorHandleKey.h" #include "xAODTracking/TrackParticleContainer.h" #include "GaudiKernel/ToolHandle.h" #include "InDetTrackSelectionTool/IInDetTrackSelectionTool.h" @@ -31,6 +32,8 @@ class PFTrackPreselAlg : public AthReentrantAlgorithm { this, "InputTracks", "", "The input track selection"}; SG::WriteHandleKey<xAOD::TrackParticleContainer> m_outputTracksKey{ this, "OutputTracks", "", "The output preselected track collection"}; + SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_outputDecorKey{ + this, "OutputDecor" , "passPFTrackPresel", "Output decoration"}; ToolHandle<InDet::IInDetTrackSelectionTool> m_trackSelTool{ this, "TrackSelTool", "", "The track selection tool"}; Gaudi::Property<float> m_upperPtCut{