diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx index eb4be8cb27c1ef2dfdef59319ca17e024549c658..340a2d6adc5fcd5393ded3140c6d2ca0d9da4748 100644 --- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx +++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.cxx @@ -22,7 +22,7 @@ InputMakerForRoI:: InputMakerForRoI( const std::string& name, StatusCode InputMakerForRoI::initialize() { ATH_MSG_DEBUG("Will produce output RoI collections: " << m_RoIs); - CHECK( m_RoIs.initialize() ); + CHECK( m_RoIs.initialize( SG::AllowEmpty ) ); return StatusCode::SUCCESS; } @@ -35,7 +35,7 @@ StatusCode InputMakerForRoI::execute( const EventContext& context ) const { ATH_CHECK(outputHandle.isValid()); // Prepare Outputs - std::unique_ptr< TrigRoiDescriptorCollection > oneRoIColl( new TrigRoiDescriptorCollection() ); + std::unique_ptr<TrigRoiDescriptorCollection> oneRoIColl = std::make_unique<TrigRoiDescriptorCollection>(); // use also this: ElementLinkVector<xAOD::MuonRoIContainer> getMuonRoILinks = obj->objectCollectionLinks<xAOD::MuonRoIContainer>("ManyMuonRoIs"); std::vector <ElementLink<TrigRoiDescriptorCollection> > RoIsFromDecision; // used to check for duplicate features linked to different inputHandles @@ -70,11 +70,15 @@ StatusCode InputMakerForRoI::execute( const EventContext& context ) const { } // loop over decisions - // Finally, record output - ATH_MSG_DEBUG("Produced "<<oneRoIColl->size() <<" output RoIs"); - auto roi_outputHandle = SG::makeHandle(m_RoIs, context); - ATH_CHECK( roi_outputHandle.record(std::move(oneRoIColl)) ); - + // Finally, record output + if (m_RoIs.empty()) { + ATH_MSG_DEBUG("No concrete output ROI collection required from this InputMaker."); + } else { + ATH_MSG_DEBUG("Produced "<<oneRoIColl->size() <<" output RoIs"); + auto roi_outputHandle = SG::makeHandle(m_RoIs, context); + ATH_CHECK( roi_outputHandle.record(std::move(oneRoIColl)) ); + } + // call base class helper method to print some debug messages summarising the content of the outputHandles. if (msgLvl(MSG::DEBUG)) { debugPrintOut(context, outputHandle); diff --git a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h index fda2d2b0cc6a0f4668c589cb4f37f2cee27198a9..9f5119fd46c7a6a628a24efa4bd3ea233c0fd1ae 100644 --- a/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h +++ b/Trigger/TrigSteer/DecisionHandling/src/InputMakerForRoI.h @@ -26,7 +26,8 @@ virtual StatusCode execute(const EventContext&) const override; private: - SG::WriteHandleKey<TrigRoiDescriptorCollection> m_RoIs {this,"RoIs", "Unspecified", "Name of the RoIs extracted from the decisions"}; + SG::WriteHandleKey<TrigRoiDescriptorCollection> m_RoIs {this,"RoIs", "", + "Name of the collection of ROI extrated from the input Decision Objects. Used as cocnrete starting handle for step's reconstruction."}; };