diff --git a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCBIS78.h b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCBIS78.h index 463bc7676e16f24d2a76f37334753b44d97f8c7e..1453ca2c34eec1d196bf9258f5a7e3e1fe1ac37b 100644 --- a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCBIS78.h +++ b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCBIS78.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #ifndef TGC_BIS78_H @@ -26,7 +26,8 @@ class TGCBIS78 : public AthMessaging { bool operator == (const TGCBIS78& right) const = delete; bool operator != (const TGCBIS78& right) const = delete; - StatusCode retrieve(SG::ReadHandleKey<Muon::RpcBis78_TrigRawDataContainer> key); + StatusCode retrieve(const SG::ReadHandleKey<Muon::RpcBis78_TrigRawDataContainer>& key, + const EventContext& ctx); std::shared_ptr<const BIS78TrigOut> getOutput(int TGC_TriggerSector) const; @@ -37,7 +38,7 @@ class TGCBIS78 : public AthMessaging { void eraseOutput(); private: - static constexpr unsigned int kNPadBoards = 8; + static constexpr int kNPadBoards = 8; protected: std::shared_ptr<BIS78TrigOut> m_buffer[kNPadBoards];//buffer[BIS78 Trigger Processor] diff --git a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCNSW.h b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCNSW.h index 4b0f91d3dd579734ea63a112bede5ffca29c6ff7..2a58637863c240ebda20399c796e9d704948f388 100644 --- a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCNSW.h +++ b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCNSW.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 TGC_NSW_H @@ -27,7 +27,7 @@ class TGCNSW : public AthMessaging { bool operator == (const TGCNSW& right) const = delete; bool operator != (const TGCNSW& right) const = delete; - StatusCode retrieve(SG::ReadHandleKey<Muon::NSW_TrigRawDataContainer> key); + StatusCode retrieve(const SG::ReadHandleKey<Muon::NSW_TrigRawDataContainer>& key, const EventContext& ctx); std::shared_ptr<const NSWTrigOut> getOutput(LVL1TGCTrigger::TGCRegionType region ,int side, int TGC_TriggerSector) const; private: diff --git a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCTMDB.h b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCTMDB.h index aef6c833e8c651f0421e6c422e7b2b6aca864f94..6cdcb158c18306cc614d30fbc56c3f707ca2c8ce 100644 --- a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCTMDB.h +++ b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCTMDB.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 TrigT1TGC_TGCTMDB_H @@ -25,7 +25,7 @@ class TGCTMDB : public AthMessaging { int operator == (const TGCTMDB& right) const = delete; int operator != (const TGCTMDB& right) const = delete; - StatusCode retrieve(SG::ReadHandleKey<TileMuonReceiverContainer> key); + StatusCode retrieve(const SG::ReadHandleKey<TileMuonReceiverContainer>& key, const EventContext& ctx); std::shared_ptr<const TGCTMDBOut> getOutput(const TGCSide side, unsigned int moduleID) const; std::shared_ptr<const TGCTMDBOut> getOutput(const TGCSide side, int sectorID, unsigned int mod) const; diff --git a/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx b/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx index dfec7f71500ab2f02e39e35d49fe8395ed6baeda..7dc81e06b87f02d14ebadaf358e036c8144d58fd 100644 --- a/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx +++ b/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ // STL @@ -188,17 +188,17 @@ StatusCode LVL1TGCTrigger::execute() // Use TileMu only if BC_CURRENT if (doTileMu && bc == m_CurrentBunchTag) { - ATH_CHECK(m_system->getTMDB()->retrieve(m_keyTileMu)); + ATH_CHECK(m_system->getTMDB()->retrieve(m_keyTileMu, ctx)); } // Use NSW trigger output if(doNSW && bc==m_CurrentBunchTag){ // To implement BC-calculation - ATH_CHECK(m_system->getNSW()->retrieve(m_keyNSWTrigOut)); + ATH_CHECK(m_system->getNSW()->retrieve(m_keyNSWTrigOut, ctx)); } // Use RPC BIS78 trigger output if(doBIS78 && bc == m_CurrentBunchTag){ // Todo: implement BC-calculation - ATH_CHECK(m_system->getBIS78()->retrieve(m_keyBIS78TrigOut)); + ATH_CHECK(m_system->getBIS78()->retrieve(m_keyBIS78TrigOut, ctx)); } if (m_ProcessAllBunches || bc == m_CurrentBunchTag) { diff --git a/Trigger/TrigT1/TrigT1TGC/src/TGCBIS78.cxx b/Trigger/TrigT1/TrigT1TGC/src/TGCBIS78.cxx index a101d2545d1a5761eceef1e2928790de9f622f46..86ffb2e01de1568e4ddc89db013a9bb75d6dfa13 100644 --- a/Trigger/TrigT1/TrigT1TGC/src/TGCBIS78.cxx +++ b/Trigger/TrigT1/TrigT1TGC/src/TGCBIS78.cxx @@ -1,37 +1,34 @@ /* - 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 "TrigT1TGC/TGCBIS78.h" #include "TrigT1TGC/BIS78TrigOut.h" -#include <iostream> // will be removed + +#include "AthenaBaseComps/AthCheckMacros.h" + namespace LVL1TGC { TGCBIS78::TGCBIS78() : AthMessaging("LVL1TGC::TGCBIS78") { - for (size_t PadBoard=0; PadBoard < kNPadBoards; PadBoard++) { - std::vector<int> vecPadBoard; - vecPadBoard.push_back(PadBoard); - m_buffer[PadBoard].reset(new BIS78TrigOut(vecPadBoard)); + for (int PadBoard=0; PadBoard < kNPadBoards; PadBoard++) { + m_buffer[PadBoard] = std::make_shared<BIS78TrigOut>(std::vector<int>{PadBoard}); } } -StatusCode TGCBIS78::retrieve(SG::ReadHandleKey<Muon::RpcBis78_TrigRawDataContainer> key) { +StatusCode TGCBIS78::retrieve(const SG::ReadHandleKey<Muon::RpcBis78_TrigRawDataContainer>& key, + const EventContext& ctx) { ATH_MSG_DEBUG("retrieve"); this->eraseOutput(); //The following part will be available when RPC BIS78 Trigger Output is available. - SG::ReadHandle<Muon::RpcBis78_TrigRawDataContainer> readBIS78_TrigRawDataContainer(key); - if(!readBIS78_TrigRawDataContainer.isValid()){ - ATH_MSG_ERROR("Cannot retrieve RPC BIS78 TrigRawData Container."); - return StatusCode::FAILURE; - } - const Muon::RpcBis78_TrigRawDataContainer* bis78_TrigRawDataContainer = readBIS78_TrigRawDataContainer.cptr(); - for(const Muon::RpcBis78_TrigRawData* bis78_sector : *bis78_TrigRawDataContainer){ + SG::ReadHandle<Muon::RpcBis78_TrigRawDataContainer> readBIS78_TrigRawDataContainer(key, ctx); + ATH_CHECK( readBIS78_TrigRawDataContainer.isValid() ); + + for(const Muon::RpcBis78_TrigRawData* bis78_sector : *readBIS78_TrigRawDataContainer){ if ( bis78_sector->sideId() != 1 ) continue; // BIS78 is only in A side! for(const Muon::RpcBis78_TrigRawDataSegment* bis78_hit : *bis78_sector){ this->setOutput(bis78_sector->sectorId(), @@ -50,9 +47,7 @@ StatusCode TGCBIS78::retrieve(SG::ReadHandleKey<Muon::RpcBis78_TrigRawDataContai std::shared_ptr<const BIS78TrigOut> TGCBIS78::getOutput(int TGC_TriggerSector) const { - std::shared_ptr<BIS78TrigOut> trigBIS78_output; - trigBIS78_output.reset(new BIS78TrigOut()); - trigBIS78_output->clear(); + auto trigBIS78_output = std::make_shared<BIS78TrigOut>(); if ( TGC_TriggerSector<0 || TGC_TriggerSector>47 ) return 0; int BIS78_TriggerSect = (TGC_TriggerSector - 2)/6; if(TGC_TriggerSector < 2) BIS78_TriggerSect=7; diff --git a/Trigger/TrigT1/TrigT1TGC/src/TGCNSW.cxx b/Trigger/TrigT1/TrigT1TGC/src/TGCNSW.cxx index 2c2393d0530af48bad9d7fbda73e13debead5e6f..73f309d023f47200982f598a96f13d066076926f 100644 --- a/Trigger/TrigT1/TrigT1TGC/src/TGCNSW.cxx +++ b/Trigger/TrigT1/TrigT1TGC/src/TGCNSW.cxx @@ -1,37 +1,36 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ #include "TrigT1TGC/TGCNSW.h" #include "TrigT1TGC/NSWTrigOut.h" +#include "AthenaBaseComps/AthCheckMacros.h" + + namespace LVL1TGC { TGCNSW::TGCNSW() : AthMessaging("LVL1TGC::TGCNSW") { for (int side=0; side < 2; side++) { for (int TP=0; TP < NumberOfNSWTriggerProcesser; TP++) { - std::vector<int> vecTP; - vecTP.push_back(TP); - m_buffer[side][TP].reset(new NSWTrigOut(side, vecTP)); + m_buffer[side][TP] = std::make_shared<NSWTrigOut>(side, std::vector<int>{TP}); } } } -StatusCode TGCNSW::retrieve(SG::ReadHandleKey<Muon::NSW_TrigRawDataContainer> key) { +StatusCode TGCNSW::retrieve(const SG::ReadHandleKey<Muon::NSW_TrigRawDataContainer>& key, + const EventContext& ctx) { ATH_MSG_DEBUG("retrieve"); this->eraseOutput(); //The following part will be available when NSW Trigger Output is available. - SG::ReadHandle<Muon::NSW_TrigRawDataContainer> readNSW_TrigRawDataContainer(key); - if(!readNSW_TrigRawDataContainer.isValid()){ - ATH_MSG_ERROR("Cannot retrieve NSW TrigRawData Container."); - return StatusCode::FAILURE; - } - const Muon::NSW_TrigRawDataContainer* nsw_TrigRawDataContainer = readNSW_TrigRawDataContainer.cptr(); - for(const Muon::NSW_TrigRawData* nsw_sector : *nsw_TrigRawDataContainer){ + SG::ReadHandle<Muon::NSW_TrigRawDataContainer> readNSW_TrigRawDataContainer(key, ctx); + ATH_CHECK( readNSW_TrigRawDataContainer.isValid() ); + + for(const Muon::NSW_TrigRawData* nsw_sector : *readNSW_TrigRawDataContainer){ for(const Muon::NSW_TrigRawDataSegment* nsw_trk : *nsw_sector){ int nsw_sideId = (nsw_sector->sectorSide()=='A')?0:1; this->setOutput(nsw_sideId, // side @@ -60,9 +59,7 @@ TGCNSW::getOutput(LVL1TGCTrigger::TGCRegionType region ,int side,int TGC_Trigger return true; }; - std::shared_ptr<NSWTrigOut> trigNSW_output; - trigNSW_output.reset(new NSWTrigOut()); - trigNSW_output->clear(); + auto trigNSW_output = std::make_shared<NSWTrigOut>(); if ( (side<0)||(side>1) ) return 0; if (region == LVL1TGCTrigger::TGCRegionType::ENDCAP) { if ( TGC_TriggerSector<0 || TGC_TriggerSector>47 ) return 0; diff --git a/Trigger/TrigT1/TrigT1TGC/src/TGCTMDB.cxx b/Trigger/TrigT1/TrigT1TGC/src/TGCTMDB.cxx index 3a7ed85c59cb3d2058305e6312ba4fe5b9beb8b8..cd25344d87c4140f1e9f39761ea3632d16271c8c 100644 --- a/Trigger/TrigT1/TrigT1TGC/src/TGCTMDB.cxx +++ b/Trigger/TrigT1/TrigT1TGC/src/TGCTMDB.cxx @@ -1,9 +1,11 @@ /* - 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 "TrigT1TGC/TGCTMDB.h" +#include "AthenaBaseComps/AthCheckMacros.h" + namespace LVL1TGC { TGCTMDB::TGCTMDB() @@ -11,28 +13,25 @@ TGCTMDB::TGCTMDB() { for (size_t side=0; side < TGCSide::kNSide; side++) { for (size_t mod=0; mod < kNTileModule; mod++) { - m_buffer[side][mod].reset(new TGCTMDBOut(side, mod)); + m_buffer[side][mod] = std::make_shared<TGCTMDBOut>(side, mod); } } } -StatusCode TGCTMDB::retrieve(SG::ReadHandleKey<TileMuonReceiverContainer> key) +StatusCode TGCTMDB::retrieve(const SG::ReadHandleKey<TileMuonReceiverContainer>& key, + const EventContext& ctx) { ATH_MSG_DEBUG("fillTMDB"); // clear TMDB this->eraseOutput(); - SG::ReadHandle<TileMuonReceiverContainer> readTileMuonReceiverContainer(key); - if(!readTileMuonReceiverContainer.isValid()){ - ATH_MSG_ERROR("Cannot retrieve Tile Muon Receiver Container."); - return StatusCode::FAILURE; - } - const TileMuonReceiverContainer* tileMuRecCont = readTileMuonReceiverContainer.cptr(); + SG::ReadHandle<TileMuonReceiverContainer> readTileMuonReceiverContainer(key, ctx); + ATH_CHECK( readTileMuonReceiverContainer.isValid() ); // loop over all TileMuonReceiverObj in container - TileMuonReceiverContainer::const_iterator tmItr = tileMuRecCont->begin(); + TileMuonReceiverContainer::const_iterator tmItr = readTileMuonReceiverContainer->begin(); const TileMuonReceiverObj * tmObj_Thresholds = *tmItr; if ( (tmObj_Thresholds->GetThresholds()).size() == 4) { @@ -52,7 +51,7 @@ StatusCode TGCTMDB::retrieve(SG::ReadHandleKey<TileMuonReceiverContainer> key) // m_id and decision , etc ... from ++tmItr; - for ( ; tmItr != tileMuRecCont->end(); ++tmItr) { + for ( ; tmItr != readTileMuonReceiverContainer->end(); ++tmItr) { const TileMuonReceiverObj * tmObj = *tmItr; // Tile Module