Skip to content
Snippets Groups Projects
Commit de87090e authored by notarann's avatar notarann
Browse files

Reordering to get rid of empty waveform containers

parent 251b06f6
No related branches found
No related tags found
No related merge requests found
......@@ -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(),
......
......@@ -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(),
......
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