diff --git a/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.cxx b/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.cxx index 5ead65452727c36307d8b4c038812ca9c3683f47..2074b566e044e8bc647237fa7ff5c127f9a94ffe 100644 --- a/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.cxx +++ b/Waveform/WaveRecAlgs/src/PseudoCaloHitToWaveformRecAlg.cxx @@ -42,12 +42,6 @@ PseudoCaloHitToWaveformRecAlg::execute(const EventContext& ctx) const { ATH_CHECK( caloHitHandle.isValid() ); ATH_MSG_DEBUG("Found ReadHandle for CaloHitCollection " << m_caloHitContainerKey); - if (caloHitHandle->size() == 0) { - ATH_MSG_DEBUG("CaloHitCollection found with zero length!"); - return StatusCode::SUCCESS; - } - - // Find the output waveform container SG::WriteHandle<xAOD::WaveformHitContainer> waveformHitContainerHandle(m_waveformHitContainerKey, ctx); ATH_CHECK( waveformHitContainerHandle.record( std::make_unique<xAOD::WaveformHitContainer>(), @@ -55,6 +49,10 @@ PseudoCaloHitToWaveformRecAlg::execute(const EventContext& ctx) const { ATH_MSG_DEBUG("WaveformsHitContainer '" << waveformHitContainerHandle.name() << "' initialized"); + if (caloHitHandle->size() == 0) { + ATH_MSG_DEBUG("CaloHitCollection found with zero length!"); + return StatusCode::SUCCESS; + } // "Reconstruct" the hits CHECK( m_recoTool->reconstruct<CaloHitCollection>(caloHitHandle.ptr(), diff --git a/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.cxx b/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.cxx index 2b896e63c8a67b845072b74489ffe5a39b162751..4b8b719781f95a8881391738f076acf8e5c9204b 100644 --- a/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.cxx +++ b/Waveform/WaveRecAlgs/src/PseudoScintHitToWaveformRecAlg.cxx @@ -42,12 +42,6 @@ PseudoScintHitToWaveformRecAlg::execute(const EventContext& ctx) const { ATH_CHECK( scintHitHandle.isValid() ); ATH_MSG_DEBUG("Found ReadHandle for ScintHitCollection " << m_scintHitContainerKey); - if (scintHitHandle->size() == 0) { - ATH_MSG_DEBUG("ScintHitCollection found with zero length!"); - return StatusCode::SUCCESS; - } - - // Find the output waveform container SG::WriteHandle<xAOD::WaveformHitContainer> waveformHitContainerHandle(m_waveformHitContainerKey, ctx); ATH_CHECK( waveformHitContainerHandle.record( std::make_unique<xAOD::WaveformHitContainer>(), @@ -55,6 +49,10 @@ PseudoScintHitToWaveformRecAlg::execute(const EventContext& ctx) const { ATH_MSG_DEBUG("WaveformsHitContainer '" << waveformHitContainerHandle.name() << "' initialized"); + if (scintHitHandle->size() == 0) { + ATH_MSG_DEBUG("ScintHitCollection found with zero length!"); + return StatusCode::SUCCESS; + } // "Reconstruct" the hits CHECK( m_recoTool->reconstruct<ScintHitCollection>(scintHitHandle.ptr(),