diff --git a/Trigger/TrigT1/TrigT1CTP/src/ResultBuilder.cxx b/Trigger/TrigT1/TrigT1CTP/src/ResultBuilder.cxx index 890651d8809413cd852e3b32e6741f3ad622525a..78a8f419f534aaf810c79565d47bb44e004a2b11 100644 --- a/Trigger/TrigT1/TrigT1CTP/src/ResultBuilder.cxx +++ b/Trigger/TrigT1/TrigT1CTP/src/ResultBuilder.cxx @@ -38,6 +38,9 @@ LVL1CTP::ResultBuilder::ResultBuilder( const std::string& type, LVL1CTP::ResultBuilder::~ResultBuilder() { delete m_ctpDataFormat; + for(auto & x : m_internalTrigger) { + delete x.second; + } } @@ -78,10 +81,10 @@ LVL1CTP::ResultBuilder::createTriggerConfigMaps(const ConfigSource & cfgSrc) con } // build map of name to ctp thresholds - m_thrConfigMap = new ThresholdMap( cfgSrc.l1menu() ); + m_thrConfigMap = std::make_unique<ThresholdMap>( cfgSrc.l1menu() ); // build map of name to ctp items - m_itemConfigMap = new ItemMap( cfgSrc.l1menu() ); + m_itemConfigMap = std::make_unique<ItemMap>( cfgSrc.l1menu() ); } else if( cfgSrc.ctpConfig() != nullptr ) { @@ -102,9 +105,9 @@ LVL1CTP::ResultBuilder::createTriggerConfigMaps(const ConfigSource & cfgSrc) con m_internalTrigger[ rndm->name() ] = rndm; } - m_thrConfigMap = new ThresholdMap( cfgSrc.ctpConfig()->menu().thresholdVector()); + m_thrConfigMap = std::make_unique<ThresholdMap>( cfgSrc.ctpConfig()->menu().thresholdVector()); - m_itemConfigMap = new ItemMap( cfgSrc.ctpConfig()->menu().itemVector(), + m_itemConfigMap = std::make_unique<ItemMap>( cfgSrc.ctpConfig()->menu().itemVector(), cfgSrc.ctpConfig()->prescaleSet() ); } else { ATH_MSG_FATAL("No L1 trigger menu was provided"); diff --git a/Trigger/TrigT1/TrigT1CTP/src/ResultBuilder.h b/Trigger/TrigT1/TrigT1CTP/src/ResultBuilder.h index a211285f9b046af562b1646066a8f7dcb87da868..3694457bd1e839f1bb5fe7dfc0ec2cd2e9b4fafa 100644 --- a/Trigger/TrigT1/TrigT1CTP/src/ResultBuilder.h +++ b/Trigger/TrigT1/TrigT1CTP/src/ResultBuilder.h @@ -95,8 +95,8 @@ namespace LVL1CTP { std::vector<std::string> firedItems(const std::vector<uint32_t>& triggerWords) const; // configuration information - mutable ThresholdMap* m_thrConfigMap ATLAS_THREAD_SAFE { nullptr }; //!< Map between threshold objects and their CTP-internal description - mutable ItemMap* m_itemConfigMap ATLAS_THREAD_SAFE { nullptr }; //!< Map between item objects and their CTP-internal description + mutable std::unique_ptr<ThresholdMap> m_thrConfigMap ATLAS_THREAD_SAFE { nullptr }; //!< Map between threshold objects and their CTP-internal description + mutable std::unique_ptr<ItemMap> m_itemConfigMap ATLAS_THREAD_SAFE { nullptr }; //!< Map between item objects and their CTP-internal description mutable InternalTriggerMap m_internalTrigger ATLAS_THREAD_SAFE; //!< internal triggers BGRP and RNDM unsigned int m_ctpVersionNumber { 4 }; //!< CTP data format version (4 in most of Run 2 and in Run 3) CTPdataformatVersion* m_ctpDataFormat { nullptr }; //!< CTP data format details