diff --git a/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigMuCTPiROBMonitor.cxx b/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigMuCTPiROBMonitor.cxx index c5cfecf02083c8808999f5e3428abf7c136ae843..fe51fe2f90609e7e28dc42f6a196dfc21ff24cbc 100755 --- a/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigMuCTPiROBMonitor.cxx +++ b/HLT/Trigger/TrigMonitoring/TrigOnlineMonitor/src/TrigMuCTPiROBMonitor.cxx @@ -998,7 +998,9 @@ void TrigMuCTPiROBMonitor::decodeMuCTPi(OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment /* Create trailer */ ROIB::Trailer muCTPITrail( m_lvl1muCTPIRoIs.size(), errorStat ); /* Create MuCTPIResult object */ - m_lvl1muCTPIResult = new ROIB::MuCTPIResult( muCTPIHead, muCTPITrail, m_lvl1muCTPIRoIs ); + //explicity copy for m_lvl1muCTPIRoIs + m_lvl1muCTPIResult = new ROIB::MuCTPIResult( std::move(muCTPIHead), std::move(muCTPITrail), std::vector<ROIB::MuCTPIRoI>(m_lvl1muCTPIRoIs) ); + /* Dump object if requested */ if (msgLvl(MSG::DEBUG)) { ATH_MSG_DEBUG( m_lvl1muCTPIResult->dump() ); @@ -1068,7 +1070,7 @@ void TrigMuCTPiROBMonitor::decodeMuCTPi(OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment } // create MuCTPI RDO - m_daqmuCTPIResult = new MuCTPI_RDO( candidateMultiplicity, dataWord ); + m_daqmuCTPIResult = new MuCTPI_RDO( std::move(candidateMultiplicity), std::move(dataWord) ); // print contents if (msgLvl(MSG::DEBUG)) { diff --git a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/MuCTPI_RDOToRoIBResult.cxx b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/MuCTPI_RDOToRoIBResult.cxx index 00ca790692e4e616f5204f0885b5b33e5641d698..f05beb14497cafd3aaab8dcef3b142e174d2ec91 100644 --- a/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/MuCTPI_RDOToRoIBResult.cxx +++ b/PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerAlgs/src/MuCTPI_RDOToRoIBResult.cxx @@ -75,17 +75,17 @@ StatusCode MuCTPI_RDOToRoIBResult::execute() { // // Create the new MuCTPI result: // - ROIB::MuCTPIResult newResult( roibresult->muCTPIResult().header(), - roibresult->muCTPIResult().trailer(), - roi_vector ); + ROIB::MuCTPIResult newResult( ROIB::Header(roibresult->muCTPIResult().header()), + ROIB::Trailer(roibresult->muCTPIResult().trailer()), + std::move(roi_vector) ); // // Create and save the new RoIBResult object: // - ROIB::RoIBResult* new_roibresult = new ROIB::RoIBResult( newResult, - roibresult->cTPResult(), - roibresult->jetEnergyResult(), - roibresult->eMTauResult() ); + ROIB::RoIBResult* new_roibresult = new ROIB::RoIBResult( std::move(newResult), + ROIB::CTPResult(roibresult->cTPResult()), + std::vector< ROIB::JetEnergyResult >(roibresult->jetEnergyResult()), + std::vector< ROIB::EMTauResult >(roibresult->eMTauResult()) ); CHECK( evtStore()->record( new_roibresult, m_roibOutputKey ) ); ATH_MSG_VERBOSE( "Saved the fixed RoIBResult object with key: " << m_roibOutputKey ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoByteStream/src/L1TopoByteStreamTool.cxx b/Trigger/TrigT1/L1Topo/L1TopoByteStream/src/L1TopoByteStreamTool.cxx index 3aaff74f80a5a06d86208a7c5d3f1289dceee987..1f1d27c3f1c19b783f9d7e6fcf013637a08104f4 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoByteStream/src/L1TopoByteStreamTool.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoByteStream/src/L1TopoByteStreamTool.cxx @@ -267,6 +267,7 @@ StatusCode L1TopoByteStreamTool::convert(const ROBF* rob, L1TopoRDO*& result) { const uint32_t nstatus = rob->rod_nstatus(); ATH_MSG_VERBOSE("Number of status words: " << nstatus); std::vector<uint32_t> vStatusWords; + vStatusWords.reserve(nstatus); ATH_MSG_VERBOSE("Dumping ROD status words:"); for (uint32_t i = 0; i < nstatus; ++i, ++it_status) { vStatusWords.push_back(static_cast<uint32_t>(*it_status)); @@ -294,6 +295,7 @@ StatusCode L1TopoByteStreamTool::convert(const ROBF* rob, L1TopoRDO*& result) { ATH_MSG_VERBOSE("Dumping L1Topo data words:"); std::vector<uint32_t> vDataWords; + vDataWords.reserve(ndata); for (uint32_t i = 0; i < ndata; ++i, ++it_data) { vDataWords.push_back(static_cast<uint32_t>(*it_data)); ATH_MSG_VERBOSE(" 0x" << MSG::hex << std::setfill('0') << std::setw(8) @@ -302,8 +304,8 @@ StatusCode L1TopoByteStreamTool::convert(const ROBF* rob, L1TopoRDO*& result) { // create L1Topo RDO result = new L1TopoRDO(); - result->setDataWords(vDataWords); - result->setStatusWords(vStatusWords); + result->setDataWords(std::move(vDataWords)); + result->setStatusWords(std::move(vStatusWords)); if (error_status) { result->setError(L1Topo::Error::SLINK_STATUS_ERROR); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/Fibre.h b/Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/Fibre.h index 20caf4e43c0992893fe55ea55b4bc54164e0d3b1..7e91b66667c522614524384ebc77907b93dd53f2 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/Fibre.h +++ b/Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/Fibre.h @@ -22,7 +22,7 @@ namespace L1Topo { class Fibre { public: //! Construct from contents and encode word: vectors of up to 5 status flags and sizes. They will be inserted left to right in the order the are given. The correct ordering is left to the user. Note that status is encoded as a single bit as specified in the data format, copied from the least significant bit of the given integer. Similarly, the size is truncated to the least significant 4 bits of the given integer. - Fibre(const std::vector<uint32_t> status, const std::vector<uint32_t> count); + Fibre(std::vector<uint32_t> &&status, std::vector<uint32_t> &&count); //! Construct from word and encode contents Fibre(const uint32_t word); //! access method diff --git a/Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/L1TopoRDO.h b/Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/L1TopoRDO.h index 51d9b48878cc868b6c01edfe9a6ca410db2ce51f..f10f7738a0bfd81d5d82b364f6812ebcd921a776 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/L1TopoRDO.h +++ b/Trigger/TrigT1/L1Topo/L1TopoRDO/L1TopoRDO/L1TopoRDO.h @@ -29,19 +29,19 @@ class L1TopoRDO { public: //! Constructor - L1TopoRDO(); - //! Destructor - ~L1TopoRDO(); + L1TopoRDO() : + m_error(0), + m_sourceID(0){ } //! get the data words const std::vector<uint32_t>& getDataWords() const; //! set the data words - void setDataWords(const std::vector<uint32_t>); + void setDataWords(std::vector<uint32_t>&&) noexcept; //! get the status words const std::vector<uint32_t>& getStatusWords() const; //! set the status words - void setStatusWords(const std::vector<uint32_t>); + void setStatusWords(std::vector<uint32_t>&&) noexcept; //! get a vector of Errors found during RAW to RDO conversion; see enum and // print helpers diff --git a/Trigger/TrigT1/L1Topo/L1TopoRDO/src/Fibre.cxx b/Trigger/TrigT1/L1Topo/L1TopoRDO/src/Fibre.cxx index f3219041369d8f42acc2813dd6f5fee0e7cdf66d..282e21b97450d2e1f8c0e539b5ca017b67a1303d 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoRDO/src/Fibre.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoRDO/src/Fibre.cxx @@ -10,8 +10,8 @@ namespace L1Topo { - Fibre::Fibre(const std::vector<uint32_t> status, const std::vector<uint32_t> count) - :m_status(status), m_count(count), m_word(0) { + Fibre::Fibre(std::vector<uint32_t> &&status, std::vector<uint32_t> &&count) + :m_status(std::move(status)), m_count(std::move(count)), m_word(0) { this->encode(); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoRDO/src/L1TopoRDO.cxx b/Trigger/TrigT1/L1Topo/L1TopoRDO/src/L1TopoRDO.cxx index 631b9a3ece4bcdca104352fbb6fb5f82b3033164..6fd5d7b99d77161951e45fd86887f43cb8311de5 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoRDO/src/L1TopoRDO.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoRDO/src/L1TopoRDO.cxx @@ -11,25 +11,15 @@ #include <string> #include "L1TopoRDO/ModuleID.h" -L1TopoRDO::L1TopoRDO(): - m_error(0), - m_sourceID(0) -{ - //m_dataWords.push_back(0); -} - -L1TopoRDO::~L1TopoRDO() -{ -} const std::vector<uint32_t>& L1TopoRDO::getDataWords () const { return m_dataWords; } -void L1TopoRDO::setDataWords (const std::vector<uint32_t> dataWords) +void L1TopoRDO::setDataWords (std::vector<uint32_t> &&dataWords) noexcept { - m_dataWords = dataWords; + m_dataWords = std::move(dataWords); } const std::vector<uint32_t>& L1TopoRDO::getStatusWords () const @@ -37,9 +27,9 @@ const std::vector<uint32_t>& L1TopoRDO::getStatusWords () const return m_statusWords; } -void L1TopoRDO::setStatusWords (const std::vector<uint32_t> statusWords) +void L1TopoRDO::setStatusWords (std::vector<uint32_t> &&statusWords) noexcept { - m_statusWords = statusWords; + m_statusWords = std::move(statusWords); } std::vector<L1Topo::Error> L1TopoRDO::getErrors() const diff --git a/Trigger/TrigT1/L1Topo/L1TopoRDO/test/L1TopoRDO_test.cxx b/Trigger/TrigT1/L1Topo/L1TopoRDO/test/L1TopoRDO_test.cxx index b173a460582ba4d25de47790d25e6d00be05d23d..8f8f83adf4c23d87c537077e67d7beb63bd723f8 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoRDO/test/L1TopoRDO_test.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoRDO/test/L1TopoRDO_test.cxx @@ -17,6 +17,23 @@ #include <cassert> #include <cstdint> +using namespace L1Topo; +void trait_tests(){ + + static_assert(std::is_trivially_copy_constructible<Status>::value); + static_assert(std::is_trivially_destructible<Status>::value); + static_assert(std::is_trivially_copy_constructible<ModuleID>::value); + static_assert(std::is_trivially_destructible<ModuleID>::value); + static_assert(std::is_trivially_copy_constructible<L1TopoTOB>::value); + static_assert(std::is_trivially_destructible<L1TopoTOB>::value); + static_assert(std::is_nothrow_move_constructible<L1TopoTOB>::value); + static_assert(std::is_nothrow_move_constructible<L1TopoRDO>::value); + static_assert(std::is_trivially_copy_constructible<Header>::value); + static_assert(std::is_trivially_destructible<Header>::value); + static_assert(std::is_nothrow_move_constructible<Fibre>::value); + +} + // Check decoding of header word via example void test1() { @@ -207,9 +224,9 @@ void test9() 0x8b008079 }); L1TopoRDO rdo2; - rdo1.setDataWords(data1); + rdo1.setDataWords(std::move(data1)); rdo1.setSourceID(0x00910080); // module 0 - rdo2.setDataWords(data2); + rdo2.setDataWords(std::move(data2)); rdo2.setSourceID(0x00910090); // module 1 std::cout << rdo1 << rdo2; // construct reference value - complicated by 128 bit length @@ -281,13 +298,13 @@ void test12() std::vector<uint32_t> status = { 0, 1, 0, 0, 0 }; std::vector<uint32_t> count = { 0, 1, 0, 6, 13 }; uint32_t word(0xd0440668); // word that matches the above values 0x1101 0000 0100 0100 0000 0110 0110 1000 = 0xd0440668 - L1Topo::Fibre f1(status,count); + L1Topo::Fibre f1(std::move(status),std::move(count)); std::cout << "Fibre with status and sizes " << f1 << std::endl; std::cout << "Fibre word encoded from these " << L1Topo::formatHex8(f1.word()) << std::endl; std::cout << "Compare to word " << L1Topo::formatHex8(word) << std::endl; assert (f1.word()==word); L1Topo::Fibre f2(word); - L1Topo::Fibre f3(f2.status(),f2.count()); + L1Topo::Fibre f3(std::vector<uint32_t>(f2.status()),std::vector<uint32_t>(f2.count())); std::cout << "L1Topo::Fibre decoded from word " << L1Topo::formatHex8(f2.word()) << std::endl; std::cout << "L1Topo::Fibre re-encoded to word " << L1Topo::formatHex8(f3.word()) << std::endl; assert (f3.word() == f2.word()); diff --git a/Trigger/TrigT1/TrigT1CaloUtils/src/L1TopoDataMaker.cxx b/Trigger/TrigT1/TrigT1CaloUtils/src/L1TopoDataMaker.cxx index c1f0e99f34758011726f1d1573de5f4afeaa0d11..4c264fcf6178087387f5d25794d31a9ba86ee6d1 100644 --- a/Trigger/TrigT1/TrigT1CaloUtils/src/L1TopoDataMaker.cxx +++ b/Trigger/TrigT1/TrigT1CaloUtils/src/L1TopoDataMaker.cxx @@ -37,7 +37,7 @@ LVL1::L1TopoDataMaker::makeCPCMXTopoData(const ROIB::RoIBResult* roibResult, Dat /** retrieve EMTauResult from RoIBResult. <br> Use other tool to fill CPCMXTopoData from it. <br> */ - const std::vector<ROIB::EMTauResult> emTauResult = roibResult->eMTauResult(); + const std::vector<ROIB::EMTauResult> &emTauResult = roibResult->eMTauResult(); makeCPCMXTopoData(emTauResult, topoData) ; return; @@ -84,7 +84,7 @@ LVL1::L1TopoDataMaker::makeJetCMXTopoData(const ROIB::RoIBResult* roibResult, Da /** retrieve JetEnergyResult from RoIBResult. <br> Use other tool to fill JetMXTopoData from it. <br> */ - const std::vector<ROIB::JetEnergyResult> jetEnergyResult = roibResult->jetEnergyResult(); + const std::vector<ROIB::JetEnergyResult> &jetEnergyResult = roibResult->jetEnergyResult(); makeJetCMXTopoData(jetEnergyResult, topoData) ; return; @@ -130,7 +130,7 @@ LVL1::L1TopoDataMaker::makeEnergyTopoData(const ROIB::RoIBResult* roibResult, En /** retrieve JetEnergyResult from RoIBResult. <br> Use other tool to fill EnergyTopoData from it. <br> */ - const std::vector< ROIB::JetEnergyResult > jetEnergyResult = roibResult->jetEnergyResult(); + const std::vector< ROIB::JetEnergyResult > &jetEnergyResult = roibResult->jetEnergyResult(); makeEnergyTopoData(jetEnergyResult, topoData) ; return; diff --git a/Trigger/TrigT1/TrigT1EventTPCnv/src/CTP_RDOCnv_p1.cxx b/Trigger/TrigT1/TrigT1EventTPCnv/src/CTP_RDOCnv_p1.cxx index 896315e435dbb6b3215b2cbf4de01f9cc264bb11..4d903e17b76840aac5bf149110725babcb2473e8 100644 --- a/Trigger/TrigT1/TrigT1EventTPCnv/src/CTP_RDOCnv_p1.cxx +++ b/Trigger/TrigT1/TrigT1EventTPCnv/src/CTP_RDOCnv_p1.cxx @@ -26,7 +26,7 @@ void CTP_RDOCnv_p1::persToTrans( const CTP_RDO_p1* persObj, CTP_RDO* transObj, if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting CTP_RDO from persistent state..." << endmsg; - *transObj = CTP_RDO (0, persObj->m_dataWords); + *transObj = CTP_RDO (0, std::vector<uint32_t>(persObj->m_dataWords)); //manual copy of dataWords if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting CTP_RDO from persistent state [OK]" << endmsg; diff --git a/Trigger/TrigT1/TrigT1EventTPCnv/src/CTP_RDOCnv_p2.cxx b/Trigger/TrigT1/TrigT1EventTPCnv/src/CTP_RDOCnv_p2.cxx index 892d442f91a6658c1fdd0287b85806ab1e9cac6b..8ec0014c027dfe8cf3eae7c7d0a9a6b8e5443743 100644 --- a/Trigger/TrigT1/TrigT1EventTPCnv/src/CTP_RDOCnv_p2.cxx +++ b/Trigger/TrigT1/TrigT1EventTPCnv/src/CTP_RDOCnv_p2.cxx @@ -26,7 +26,7 @@ void CTP_RDOCnv_p2::persToTrans( const CTP_RDO_p2* persObj, CTP_RDO* transObj, if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting CTP_RDO from persistent state..." << endmsg; - *transObj = CTP_RDO (0, persObj->m_dataWords); + *transObj = CTP_RDO (0, std::vector<uint32_t>(persObj->m_dataWords)); transObj->setL1AcceptBunchPosition (persObj->m_l1AcceptPosition); if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting CTP_RDO from persistent state [OK]" << endmsg; diff --git a/Trigger/TrigT1/TrigT1EventTPCnv/src/MuCTPI_RDOCnv_p1.cxx b/Trigger/TrigT1/TrigT1EventTPCnv/src/MuCTPI_RDOCnv_p1.cxx index 65172cd1b157825c934d5d35bfb276c494a087e5..f694d1695f1f9c29524fa5f1a7d1fc1303a02399 100644 --- a/Trigger/TrigT1/TrigT1EventTPCnv/src/MuCTPI_RDOCnv_p1.cxx +++ b/Trigger/TrigT1/TrigT1EventTPCnv/src/MuCTPI_RDOCnv_p1.cxx @@ -26,8 +26,8 @@ void MuCTPI_RDOCnv_p1::persToTrans( const MuCTPI_RDO_p1* persObj, MuCTPI_RDO* tr if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting MuCTPI_RDO from persistent state..." << endmsg; - *transObj = MuCTPI_RDO (persObj->m_candidateMultiplicity, - persObj->m_dataWord); + *transObj = MuCTPI_RDO (std::vector< uint32_t >(persObj->m_candidateMultiplicity), + std::vector< uint32_t >(persObj->m_dataWord)); //manual copy if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting MuCTPI_RDO from persistent state [OK]" << endmsg; diff --git a/Trigger/TrigT1/TrigT1EventTPCnv/src/RoIBResultCnv_p1.cxx b/Trigger/TrigT1/TrigT1EventTPCnv/src/RoIBResultCnv_p1.cxx index 0226d83941b2cc0d74b8975512cae38f63575852..54b17222395c7669fad336fad4a90cf5e36067a3 100644 --- a/Trigger/TrigT1/TrigT1EventTPCnv/src/RoIBResultCnv_p1.cxx +++ b/Trigger/TrigT1/TrigT1EventTPCnv/src/RoIBResultCnv_p1.cxx @@ -26,29 +26,29 @@ void RoIBResultCnv_p1::persToTrans( const RoIBResult_p1* persObj, ROIB::RoIBResu if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting ROIB::RoIBResult from persistent state..." << endmsg; - ROIB::MuCTPIResult muc (ROIB::Header (persObj->m_muctpi.m_header), - ROIB::Trailer (persObj->m_muctpi.m_trailer), + ROIB::MuCTPIResult muc (ROIB::Header (std::vector< uint32_t >(persObj->m_muctpi.m_header)), + ROIB::Trailer (std::vector< uint32_t >(persObj->m_muctpi.m_trailer)), std::vector<ROIB::MuCTPIRoI> (persObj->m_muctpi.m_roiWords.begin(), persObj->m_muctpi.m_roiWords.end())); ROIB::CTPResult ctp (0, - ROIB::Header (persObj->m_ctp.m_header), - ROIB::Trailer (persObj->m_ctp.m_trailer), + ROIB::Header (std::vector< uint32_t >(persObj->m_ctp.m_header)), + ROIB::Trailer (std::vector< uint32_t >(persObj->m_ctp.m_trailer)), persObj->m_ctp.m_roiWords); std::vector< ROIB::JetEnergyResult > jetvec; for (const SubSysResult_p1& jeten : persObj->m_jetenergy) { - jetvec.emplace_back ( ROIB::Header(jeten.m_header), - ROIB::Trailer(jeten.m_trailer), + jetvec.emplace_back ( ROIB::Header(std::vector< uint32_t >(jeten.m_header)), + ROIB::Trailer(std::vector< uint32_t >(jeten.m_trailer)), std::vector<ROIB::JetEnergyRoI> (jeten.m_roiWords.begin(), jeten.m_roiWords.end()) ); } std::vector< ROIB::EMTauResult > emtauvec; for (const SubSysResult_p1& emtau : persObj->m_emtau) { - emtauvec.emplace_back ( ROIB::Header(emtau.m_header), - ROIB::Trailer(emtau.m_trailer), + emtauvec.emplace_back ( ROIB::Header(std::vector< uint32_t >(emtau.m_header)), + ROIB::Trailer(std::vector< uint32_t >(emtau.m_trailer)), std::vector<ROIB::EMTauRoI> (emtau.m_roiWords.begin(), emtau.m_roiWords.end()) ); } diff --git a/Trigger/TrigT1/TrigT1EventTPCnv/test/CTP_RDOCnv_p1_test.cxx b/Trigger/TrigT1/TrigT1EventTPCnv/test/CTP_RDOCnv_p1_test.cxx index a18bfaf0868f541e4347b1039ebc3ba79b896072..c3dd6fde88a23ef27120252fadbd7772cae9dd87 100644 --- a/Trigger/TrigT1/TrigT1EventTPCnv/test/CTP_RDOCnv_p1_test.cxx +++ b/Trigger/TrigT1/TrigT1EventTPCnv/test/CTP_RDOCnv_p1_test.cxx @@ -122,7 +122,7 @@ void test1() std::vector<unsigned int> data (2 + 3*(6+8+8+8)); for (size_t i=0; i < data.size(); i++) data[i] = i; - CTP_RDO trans1 (0, data); + CTP_RDO trans1 (0, std::move(data)); testit (trans1); } diff --git a/Trigger/TrigT1/TrigT1EventTPCnv/test/CTP_RDOCnv_p2_test.cxx b/Trigger/TrigT1/TrigT1EventTPCnv/test/CTP_RDOCnv_p2_test.cxx index d1c417ba4c16e309bedb2697a520a5719822af80..b083d233923adc90a9b5cfd69a11d5b6e0b7a9c2 100644 --- a/Trigger/TrigT1/TrigT1EventTPCnv/test/CTP_RDOCnv_p2_test.cxx +++ b/Trigger/TrigT1/TrigT1EventTPCnv/test/CTP_RDOCnv_p2_test.cxx @@ -122,7 +122,7 @@ void test1() std::vector<unsigned int> data (2 + 3*(6+8+8+8)); for (size_t i=0; i < data.size(); i++) data[i] = i; - CTP_RDO trans1 (0, data); + CTP_RDO trans1 (0,std::move(data)); trans1.setL1AcceptBunchPosition(1); testit (trans1); } diff --git a/Trigger/TrigT1/TrigT1EventTPCnv/test/RoIBResultCnv_p1_test.cxx b/Trigger/TrigT1/TrigT1EventTPCnv/test/RoIBResultCnv_p1_test.cxx index 3fa54bda98a230d39043207f1066082aeb2bff91..f20f07369c90c2deba4a8afde4b2653b5bb056cc 100644 --- a/Trigger/TrigT1/TrigT1EventTPCnv/test/RoIBResultCnv_p1_test.cxx +++ b/Trigger/TrigT1/TrigT1EventTPCnv/test/RoIBResultCnv_p1_test.cxx @@ -188,7 +188,7 @@ void test1() std::vector< EMTauRoI > {o+7, o+8, o+9}); } - RoIBResult trans1 (muc, ctp, jet, emtau); + RoIBResult trans1 (std::move(muc), std::move(ctp), std::move(jet), std::move(emtau)); testit (trans1); } diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx index c44a39b555368726345b20d2efb6b930654cd8ec..6511b8b16dbe61c04a1e100797cba9aa098a11ca 100644 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx +++ b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx @@ -445,7 +445,7 @@ namespace LVL1MUCTPI { } } } - CHECK( saveOutput_MuCTPI_RDO(can, dataWord) ); + CHECK( saveOutput_MuCTPI_RDO(can, std::move(dataWord)) ); return StatusCode::SUCCESS; } @@ -492,7 +492,7 @@ namespace LVL1MUCTPI { uint32_t can; std::vector< uint32_t > dataWord; CHECK( updateMuCTPI_RDO(can, dataWord) ); - CHECK( saveOutput_MuCTPI_RDO(can, dataWord) ); + CHECK( saveOutput_MuCTPI_RDO(can, std::move(dataWord)) ); return StatusCode::SUCCESS; } @@ -527,7 +527,7 @@ namespace LVL1MUCTPI { uint32_t can; std::vector< uint32_t > dataWord; CHECK( updateMuCTPI_RDO(can, dataWord) ); - CHECK( saveOutput_MuCTPI_RDO(can, dataWord) ); + CHECK( saveOutput_MuCTPI_RDO(can, std::move(dataWord)) ); return StatusCode::SUCCESS; } @@ -643,10 +643,10 @@ namespace LVL1MUCTPI { /** *Here we save the actual RDO, after all BCID offsets have been processed */ - StatusCode L1Muctpi::saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord) + StatusCode L1Muctpi::saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >&& dataWord) { if(!m_rdoOutputLocId.empty()){ - MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, dataWord ); + MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, std::move(dataWord) ); auto rdoHandle = SG::makeHandle(m_rdoOutputLocId); ATH_CHECK(rdoHandle.record(std::unique_ptr<MuCTPI_RDO>(muCTPI_RDO))); ATH_MSG_DEBUG( "MuCTPI_RDO object recorded with key: " diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h index f6f4d554490f8afcf87fba76ff2e011b046c8363..fcc2636debdc94b70ab53ccbeeeb2979f2bd2605 100644 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h +++ b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.h @@ -89,7 +89,7 @@ namespace LVL1MUCTPI { /// Update the data word for the RDO object StatusCode updateMuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord); /// Save the MuCTPI RDO object - StatusCode saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >& dataWord); + StatusCode saveOutput_MuCTPI_RDO(uint32_t& can, std::vector< uint32_t >&& dataWord); /// Save the outputs of the simulation into StoreGate StatusCode saveOutput(int bcidOffset = 0); diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx index 7cf27ffae1cedef4755f69de95cb9424beed125b..6a292ea540048ef26d2852ba1db3c0928bb8699c 100644 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx +++ b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx @@ -717,7 +717,7 @@ namespace LVL1MUCTPI { } // create MuCTPI RDO - MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, dataWord ); + MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( can, std::move(dataWord) ); CHECK( evtStore()->record( muCTPI_RDO, m_rdoOutputLocId ) ); ATH_MSG_DEBUG( "MuCTPI_RDO object recorded to StoreGate with key: " << m_rdoOutputLocId ); diff --git a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.cxx b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.cxx index e88c7a48ead5426dcdd82af0667b540feef4d395..569cfea8c2fffce773f92f2dfcf99c7dbded8c35 100644 --- a/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.cxx +++ b/Trigger/TrigT1/TrigT1MuctpiPhase1/src/MUCTPI_AthTool.cxx @@ -394,7 +394,7 @@ namespace LVL1MUCTPIPHASE1 { /// the standart processing is done for the central slice, with no Bcid offset if (bcidOffset == 0 ) { // store CTP result in interface object and put to StoreGate - const std::vector<unsigned int>& ctpData = m_theMuctpi->getCTPData(); + std::vector<unsigned int> ctpData = m_theMuctpi->getCTPData(); //TEMPORARILY REMOVED UNTIL MUCTPICTP UPDATED TO VECTOR! //LVL1::MuCTPICTP* theCTPResult = new LVL1::MuCTPICTP( ctpData ); //CHECK( evtStore()->record( theCTPResult, m_ctpOutputLocId ) ); @@ -414,23 +414,19 @@ namespace LVL1MUCTPIPHASE1 { } // data word - int candSize = daqData.size(); - std::vector<unsigned int> dataWords; - for( int iData = 0; iData < candSize; ++iData) { - dataWords.push_back(daqData[iData]); - } + std::vector<unsigned int> dataWords= daqData; // create MuCTPI RDO - MuCTPI_RDO * muCTPI_RDO = new MuCTPI_RDO( ctpData, dataWords ); + auto muCTPI_RDO = std::make_unique< MuCTPI_RDO >( std::move(ctpData), std::move(dataWords) ); SG::WriteHandle<MuCTPI_RDO> wh_muctpi_rdo(m_MuCTPI_RDOWriteKey); - ATH_CHECK(wh_muctpi_rdo.record(std::make_unique<MuCTPI_RDO>(*muCTPI_RDO))); + ATH_CHECK(wh_muctpi_rdo.record(std::move(muCTPI_RDO))); ATH_MSG_DEBUG( "MuCTPI_RDO object recorded to StoreGate"); // create MuCTPI xAOD auto xAODRoIs = SG::makeHandle(m_MuCTPI_xAODWriteKey); ATH_CHECK(xAODRoIs.record(std::make_unique<xAOD::MuonRoIContainer>(), std::make_unique<xAOD::MuonRoIAuxContainer>())); ATH_MSG_DEBUG("Recorded MuonRoIContainer with key " << m_MuCTPI_xAODWriteKey.key()); - for (const unsigned int word : dataWords) { + for (const unsigned int word : daqData) { xAODRoIs->push_back(new xAOD::MuonRoI); // RB: dummy values just to have the objects for downstream code development xAODRoIs->back()->initialize(word, 99, 99, "DummyThreshold", 99); @@ -440,7 +436,7 @@ namespace LVL1MUCTPIPHASE1 { ATH_MSG_DEBUG("Getting the output for L1Topo"); LVL1::MuCTPIL1Topo* l1topo = new LVL1::MuCTPIL1Topo(m_theMuctpi->getL1TopoData(bcidOffset).getCandidates()); SG::WriteHandle<LVL1::MuCTPIL1Topo> wh_l1topo(m_MuCTPIL1TopoKey); - ATH_CHECK(wh_l1topo.record(std::make_unique<LVL1::MuCTPIL1Topo>(*l1topo))); + ATH_CHECK(wh_l1topo.record(std::unique_ptr<LVL1::MuCTPIL1Topo>(l1topo))); } /// if we have a bcid offset, then just get the topo output and put it on storegate @@ -451,16 +447,16 @@ namespace LVL1MUCTPIPHASE1 { if (bcidOffset == -2){ SG::WriteHandle<LVL1::MuCTPIL1Topo> wh_l1topo(m_MuCTPIL1TopoKey_m2); - ATH_CHECK(wh_l1topo.record(std::make_unique<LVL1::MuCTPIL1Topo>(*l1topoBC))); + ATH_CHECK(wh_l1topo.record(std::unique_ptr<LVL1::MuCTPIL1Topo>(l1topoBC))); } else if (bcidOffset == -1){ SG::WriteHandle<LVL1::MuCTPIL1Topo> wh_l1topo(m_MuCTPIL1TopoKey_m1); - ATH_CHECK(wh_l1topo.record(std::make_unique<LVL1::MuCTPIL1Topo>(*l1topoBC))); + ATH_CHECK(wh_l1topo.record(std::unique_ptr<LVL1::MuCTPIL1Topo>(l1topoBC))); } else if (bcidOffset == +1){ SG::WriteHandle<LVL1::MuCTPIL1Topo> wh_l1topo(m_MuCTPIL1TopoKey_p1); - ATH_CHECK(wh_l1topo.record(std::make_unique<LVL1::MuCTPIL1Topo>(*l1topoBC))); + ATH_CHECK(wh_l1topo.record(std::unique_ptr<LVL1::MuCTPIL1Topo>(l1topoBC))); } else if (bcidOffset == +2){ SG::WriteHandle<LVL1::MuCTPIL1Topo> wh_l1topo(m_MuCTPIL1TopoKey_p2); - ATH_CHECK(wh_l1topo.record(std::make_unique<LVL1::MuCTPIL1Topo>(*l1topoBC))); + ATH_CHECK(wh_l1topo.record(std::unique_ptr<LVL1::MuCTPIL1Topo>(l1topoBC))); } } diff --git a/Trigger/TrigT1/TrigT1Result/CMakeLists.txt b/Trigger/TrigT1/TrigT1Result/CMakeLists.txt index 8364e08b2515d1c71b065f78d6237c590dfdece7..971d822fa801e690863f1526fbcd3715ee053dc7 100644 --- a/Trigger/TrigT1/TrigT1Result/CMakeLists.txt +++ b/Trigger/TrigT1/TrigT1Result/CMakeLists.txt @@ -18,3 +18,7 @@ atlas_add_dictionary( TrigT1ResultDict TrigT1Result/TrigT1ResultDict.h TrigT1Result/selection.xml LINK_LIBRARIES TrigT1Result ) + +atlas_add_test( TrigT1Result_test + SOURCES test/type_trait_tests.cxx + LINK_LIBRARIES TrigT1Result ) diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPResult.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPResult.h index a8f71039a94dd5a34ca33675a2ef9134b6cad2ba..f72d13d8c63b08fad6f05e15fa334eadcaa9b990 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPResult.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPResult.h @@ -53,16 +53,15 @@ namespace ROIB { public: //! default constructor: empty object - CTPResult(); + CTPResult() : m_ctpDataformat(0), + m_useRoIB(false), + m_l1aBunch(0) {} //! full constructor with CTP version, header, trailer and vector of data - CTPResult(unsigned int ctpVersion, const Header&, const Trailer&, const std::vector<CTPRoI>& ); + CTPResult(unsigned int ctpVersion, Header&&, Trailer&&, std::vector<CTPRoI>&& ); //! full constructor with CTP version, header, trailer and vector of data - CTPResult(unsigned int ctpVersion, const Header&, const Trailer&, const std::vector<uint32_t>& ); - - //! empty default destructor - ~CTPResult(); + CTPResult(unsigned int ctpVersion, Header&&, Trailer&&, const std::vector<uint32_t>& ); /* * Methods: diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPRoI.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPRoI.h index 1e73bc7881ed28d1413314fea5d726c4348c1e2e..93a4390e591c640b98bb37760b0515c238b5986f 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPRoI.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTPRoI.h @@ -37,7 +37,7 @@ namespace ROIB { : m_roIWord( 0 ) {} //! empty default destructor - ~CTPRoI() {} + ~CTPRoI() = default; /* Methods: */ diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTP_RDO.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTP_RDO.h index 0912c11df83bfaec39a02d845a6e5067a0fa8bca..90ae5723e89bab327a0316047c2ef33a788b1458 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTP_RDO.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTP_RDO.h @@ -35,7 +35,7 @@ class CTP_RDO { CTP_RDO(unsigned int ctpVersionNumber, const uint32_t nBCs = 1, uint32_t nExtraWords=0); /// Normal constructor taking the data words of one or several BCs as argument - CTP_RDO(unsigned int ctpVersionNumber, const std::vector<uint32_t>& data, uint32_t nExtraWords=0); + CTP_RDO(unsigned int ctpVersionNumber, std::vector<uint32_t>&& data, uint32_t nExtraWords=0); /// empty default destructor ~CTP_RDO(); @@ -91,7 +91,7 @@ class CTP_RDO { // constants - static const unsigned int SIZEOF_WORDS = 32; //!< number of bits in one data word (32) + static constexpr unsigned int SIZEOF_WORDS = 32; //!< number of bits in one data word (32) private: diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTP_RIO.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTP_RIO.h index e6e2d93d57e100f1324a569cd8b4b6250fd2597b..1f6e349181e103309d2600892742488fdf1b28c1 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTP_RIO.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/CTP_RIO.h @@ -33,7 +33,7 @@ public: uint32_t getDetectorEventType() const{return m_detEventType;} uint32_t getNumberDataWords() const{return m_nDataWords;} uint32_t getNumberStatusWords() const{return m_nStatusWords;} - std::vector<uint32_t> getStatusWords() const{return m_statusWords;} + const std::vector<uint32_t>& getStatusWords() const{return m_statusWords;} void sourceId(uint32_t val) {m_sourceId = val;} void runNumber(uint32_t val) {m_runNumber = val;} diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/EMTauResult.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/EMTauResult.h index 9f741f66006481570b1d22e3ddd81076a46d4a18..ff68084e003432e412c9c02250f4b42e4058a59f 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/EMTauResult.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/EMTauResult.h @@ -26,7 +26,7 @@ namespace ROIB { public: /* Constructor with header, trailer and RoI vector */ - EMTauResult( const Header&, const Trailer&, const std::vector< EMTauRoI >& ); + EMTauResult( Header&&, Trailer&&, std::vector< EMTauRoI >&& ); /* Default constructor */ EMTauResult(); ~EMTauResult(); diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/EMTauRoI.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/EMTauRoI.h index debc54cd44c7c866976710e115f61111ec8468c7..3383b1a1e69b7c79813af415967c46bcc4d94687 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/EMTauRoI.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/EMTauRoI.h @@ -24,7 +24,7 @@ namespace ROIB { EMTauRoI( uint32_t ); /* Init to 0 */ EMTauRoI(); - ~EMTauRoI(); + ~EMTauRoI() = default; /* Method to update the RoI word format */ void update(); diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/Header.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/Header.h index a6bcc6345126391ac780e9947d44735f0438fe07..4c07b3aa7a1530a454e965b66f93756fb9fc0843 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/Header.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/Header.h @@ -40,15 +40,15 @@ namespace ROIB { // constants: /** a ROD header as used in the LVL1 has 8 words, not counting the one hardware word in the beginning */ - static const unsigned int wordsPerHeader = 8; //!< number of words in header (Ref: ATL-DA-ES-0029) + static constexpr unsigned int wordsPerHeader = 8; //!< number of words in header (Ref: ATL-DA-ES-0029) //! default constructor: empty object Header() : m_header() {} //! constructor which fully specifies the initialiser values - Header( const std::vector<uint32_t>& v) - : m_header( v ) {} + Header( std::vector<uint32_t>&& v) + : m_header( std::move(v) ) {} Header(Header&&) noexcept = default; Header(const Header&) = default; diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/JetEnergyResult.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/JetEnergyResult.h index cfb0f36402ffc46f0e66fab68c3840283e8514ae..0c3d05486b65698856c1429996a102763a0ab9be 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/JetEnergyResult.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/JetEnergyResult.h @@ -25,10 +25,9 @@ namespace ROIB { public: /* Constructor with header, trailer and RoI vector */ - JetEnergyResult( const Header&, const Trailer&, const std::vector< JetEnergyRoI >& ); + JetEnergyResult( Header&&, Trailer&&, std::vector< JetEnergyRoI >&& ); /* Empty constructor */ JetEnergyResult(); - ~JetEnergyResult(); /* Member function returning the header */ const Header& header() const; diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/JetEnergyRoI.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/JetEnergyRoI.h index e08e198a9f9663f37d138b8185a73743cf088526..5787f34579725e7668e138fdc98d15d0dde9c0a8 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/JetEnergyRoI.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/JetEnergyRoI.h @@ -23,7 +23,7 @@ namespace ROIB { /* A RoI is a uint32_t */ JetEnergyRoI( uint32_t ); JetEnergyRoI(); - ~JetEnergyRoI(); + ~JetEnergyRoI() = default; /* Method to update the RoI word format Obselete*/ void update(); diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/L1TopoResult.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/L1TopoResult.h index 3e436710b0c8ebbc84a26f24a7c9edd4391d7221..bfea2a5669cb7a20d7d92de7c08eca2a4ddc313f 100644 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/L1TopoResult.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/L1TopoResult.h @@ -30,11 +30,7 @@ namespace ROIB { public: //! Constructor with header, trailer and RDO - L1TopoResult( const Header&, const Trailer&, const L1TopoRDO&); - //! Default constructor - L1TopoResult(); - //! Destructor - ~L1TopoResult(); + L1TopoResult( Header&&, Trailer&&, L1TopoRDO&&) noexcept; //! Get methods diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPIResult.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPIResult.h index ec0489d46daafcae56caf7000452015035b94efa..c439276828d312a54f171158ff29da32f6cdf880 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPIResult.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPIResult.h @@ -45,12 +45,15 @@ namespace ROIB { public: /// Constructor with header, trailer and RoI vector - MuCTPIResult( const Header& head, const Trailer& trail, const std::vector< MuCTPIRoI >& roIVector ); + MuCTPIResult( Header&& head, Trailer&& trail, std::vector< MuCTPIRoI > &&roIVector ); /// Default constructor MuCTPIResult(); /// Destructor - ~MuCTPIResult(); + ~MuCTPIResult() = default; + MuCTPIResult(MuCTPIResult&&) noexcept = default; + MuCTPIResult& operator=(MuCTPIResult&&) noexcept = default; + /// Member function returning the header const Header& header() const; /// Member function returning the trailer diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPIRoI.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPIRoI.h index 0e1c683c68c1dc81163b0cc3d309f3ef3db6a8e0..8c214388e7ecbc1a6a0b1c2c06ccfb75f8ccea6d 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPIRoI.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPIRoI.h @@ -44,7 +44,7 @@ namespace ROIB { /// Default constructor MuCTPIRoI(); /// Destructor - ~MuCTPIRoI(); + ~MuCTPIRoI()= default; /// Method returning the RoI word uint32_t roIWord() const; diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_DataWord_Decoder.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_DataWord_Decoder.h index d6c2de27e02ec2e40d86265cf11883cb50167a0a..e27ecc98b8084a0d06260685566e23fc0624878c 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_DataWord_Decoder.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_DataWord_Decoder.h @@ -36,7 +36,7 @@ public: /// Constructor MuCTPI_DataWord_Decoder( uint32_t dataword = 0 ); /// Destructor - ~MuCTPI_DataWord_Decoder(); + ~MuCTPI_DataWord_Decoder() = default; /// Flag showing whether there were more than 2 candidates in this candidate's sector uint16_t getSectorOverflow() const; diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h index 29e1f185bb5d382f857d842699de2a72991760aa..120f0355f460674cb3d78315f8dc52a42d5444be 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h @@ -39,7 +39,7 @@ public: /// Constructor MuCTPI_MultiplicityWord_Decoder( const uint32_t multword, const bool inclusiveTriggerMode); /// Destructor - ~MuCTPI_MultiplicityWord_Decoder(); + ~MuCTPI_MultiplicityWord_Decoder() = default; /// Function returning the total number of muon candidates uint16_t getNCandidates() const; diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_RDO.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_RDO.h index c922b6b5b32ff8a23c7ca02363a26a66ba7c8ebc..d671081166fad31a4402e275ac83177e706ab7f6 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_RDO.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_RDO.h @@ -53,8 +53,8 @@ public: * @param dataWord The muon candidate data words */ MuCTPI_RDO( const uint32_t candidateMultiplicity, - const std::vector< uint32_t >& dataWord ) - : m_dataWord( dataWord ) { + std::vector< uint32_t >&& dataWord ) + : m_dataWord( std::move(dataWord) ) { setCandidateMultiplicity( candidateMultiplicity ); } @@ -66,25 +66,23 @@ public: * @param candidateMultiplicity The multiplicity words with the 6 separate 3-bit muon multiplicities * @param dataWord The muon candidate data words */ - MuCTPI_RDO( const std::vector< uint32_t >& candidateMultiplicity, - const std::vector< uint32_t >& dataWord ) - : m_candidateMultiplicity( candidateMultiplicity ), - m_dataWord( dataWord ) { + MuCTPI_RDO( std::vector< uint32_t >&& candidateMultiplicity, + std::vector< uint32_t >&& dataWord ) + : m_candidateMultiplicity( std::move(candidateMultiplicity) ), + m_dataWord( std::move(dataWord) ) { } /// Default constructor /** * A parameter-less constructor to be able to use the class with POOL. */ - MuCTPI_RDO () - : m_candidateMultiplicity( 0 ), - m_dataWord( 0 ) {} + MuCTPI_RDO () = default; /// Destructor /** * The destructor doesn't really have to do anything. */ - ~MuCTPI_RDO () {} + ~MuCTPI_RDO () = default; /// Function <strong>adding</strong> a multiplicity word to the object /** @@ -144,88 +142,88 @@ public: } /// Binary 111 representing the maximal multiplicity value for a given threshold - static const uint32_t MULT_VAL = 7; + static constexpr uint32_t MULT_VAL = 7; /// Number of multiplicity bits reserved per threshold - static const uint32_t MULT_BITS = 3; + static constexpr uint32_t MULT_BITS = 3; /// Defining the number of p<sub>T</sub> thresholds in the system - static const uint32_t MULT_THRESH_NUM = 6; + static constexpr uint32_t MULT_THRESH_NUM = 6; /// Telling that the 3-bit BCID comes at "position 7" in the multiplicity word - static const uint32_t MULT_BCID_POS = 7; + static constexpr uint32_t MULT_BCID_POS = 7; /// Weird mask for the bit showing if more than two muon candidates were in the trigger sector - static const uint32_t CAND_OVERFLOW_MASK = 0x1; + static constexpr uint32_t CAND_OVERFLOW_MASK = 0x1; /// Position of the candidate overflow mask - static const uint32_t CAND_OVERFLOW_SHIFT = 0; + static constexpr uint32_t CAND_OVERFLOW_SHIFT = 0; /// Weird mask for the bit showing if more than one muon candidates were in the sector RoI - static const uint32_t ROI_OVERFLOW_MASK = 0x1; + static constexpr uint32_t ROI_OVERFLOW_MASK = 0x1; /// Position of the RoI overflow mask - static const uint32_t ROI_OVERFLOW_SHIFT = 1; + static constexpr uint32_t ROI_OVERFLOW_SHIFT = 1; /// Bit in the candidate's address turned on for endcap candidates - static const uint32_t ENDCAP_ADDRESS_MASK = 0x80; + static constexpr uint32_t ENDCAP_ADDRESS_MASK = 0x80; /// Bit in the candidate's address turned on for forward candidates - static const uint32_t FORWARD_ADDRESS_MASK = 0x40; + static constexpr uint32_t FORWARD_ADDRESS_MASK = 0x40; /// Mask for extracting the sector ID for endcap candidates from the data word - static const uint32_t ENDCAP_SECTORID_MASK = 0x3f; + static constexpr uint32_t ENDCAP_SECTORID_MASK = 0x3f; /// Mask for extracting the sector ID for forward candidates from the data word - static const uint32_t FORWARD_SECTORID_MASK = 0x1f; + static constexpr uint32_t FORWARD_SECTORID_MASK = 0x1f; /// Mask for extracting the sector ID for barrel candidates from the data word - static const uint32_t BARREL_SECTORID_MASK = 0x1f; + static constexpr uint32_t BARREL_SECTORID_MASK = 0x1f; /// Mask for the bit showing which hemisphere the candidate came from.(1: positive; 0: negative) - static const uint32_t SECTOR_HEMISPHERE_MASK = 0x1; + static constexpr uint32_t SECTOR_HEMISPHERE_MASK = 0x1; /// Mask for extracting the RoI for barrel candidates from the data words - static const uint32_t BARREL_ROI_MASK = 0x1f; + static constexpr uint32_t BARREL_ROI_MASK = 0x1f; /// Mask for extracting the RoI for endcap candidates from the data words - static const uint32_t ENDCAP_ROI_MASK = 0xff; + static constexpr uint32_t ENDCAP_ROI_MASK = 0xff; /// Mask for extracting the RoI for forward candidates from the data words - static const uint32_t FORWARD_ROI_MASK = 0x3f; + static constexpr uint32_t FORWARD_ROI_MASK = 0x3f; /// Position of the RoI bits in the data word - static const uint32_t ROI_SHIFT = 2; + static constexpr uint32_t ROI_SHIFT = 2; /// Mask for extracting the overlap bits for barrel candidates from the data words - static const uint32_t BARREL_OL_MASK = 0x3; + static constexpr uint32_t BARREL_OL_MASK = 0x3; /// Position of the overlap bits in barrel data words - static const uint32_t BARREL_OL_SHIFT = 9; + static constexpr uint32_t BARREL_OL_SHIFT = 9; /// Mask for extracting the overlap bits for endcap candidates from the data words - static const uint32_t ENDCAP_OL_MASK = 0x1; + static constexpr uint32_t ENDCAP_OL_MASK = 0x1; /// Position of the overlap bits in endcap data words - static const uint32_t ENDCAP_OL_SHIFT = 10; + static constexpr uint32_t ENDCAP_OL_SHIFT = 10; /// Mask for extracting the p<sub>T</sub> threshold passed by the candidate from the data word - static const uint32_t CAND_PT_MASK = 0x7; + static constexpr uint32_t CAND_PT_MASK = 0x7; /// Position of the p<sub>T</sub> threshold bits in the data words - static const uint32_t CAND_PT_SHIFT = 11; + static constexpr uint32_t CAND_PT_SHIFT = 11; /// Mask for extracting the last 3 bits of the BCID of the muon candidate from the data word - static const uint32_t CAND_BCID_MASK = 0x7; + static constexpr uint32_t CAND_BCID_MASK = 0x7; /// Position of the BCID bits in the data words - static const uint32_t CAND_BCID_SHIFT = 14; + static constexpr uint32_t CAND_BCID_SHIFT = 14; /// Mask for extracting the address of the muon candidate from the data word - static const uint32_t CAND_SECTOR_ADDRESS_MASK = 0xff; + static constexpr uint32_t CAND_SECTOR_ADDRESS_MASK = 0xff; /// Position of the muon candidate's address in the data word - static const uint32_t CAND_SECTOR_ADDRESS_SHIFT = 17; + static constexpr uint32_t CAND_SECTOR_ADDRESS_SHIFT = 17; /// Mask for extracting the bit from the data word showing whether the candidate had the highest p<sub>T</sub> in the sector - static const uint32_t CAND_HIGHEST_PT_MASK = 0x1; + static constexpr uint32_t CAND_HIGHEST_PT_MASK = 0x1; /// Position of the "highest p<sub>T</sub>" bit - static const uint32_t CAND_HIGHEST_PT_SHIFT = 25; + static constexpr uint32_t CAND_HIGHEST_PT_SHIFT = 25; /// Mask for extracting the bit from the data word showing if the muon candidate was sent to the RoIB - static const uint32_t CAND_SENT_ROI_MASK = 0x1; + static constexpr uint32_t CAND_SENT_ROI_MASK = 0x1; /// Position of the "candidate sent to RoIB" bit. - static const uint32_t CAND_SENT_ROI_SHIFT = 26; + static constexpr uint32_t CAND_SENT_ROI_SHIFT = 26; /// Position of the bit turned on for the multiplicity words that distinguishes them from the data words - static const uint32_t MULT_WORD_FLAG_SHIFT = 29; + static constexpr uint32_t MULT_WORD_FLAG_SHIFT = 29; /// Position of the bit specifying the candidate's sign - static const uint32_t CAND_TGC_CHARGE_SIGN_SHIFT = 27; + static constexpr uint32_t CAND_TGC_CHARGE_SIGN_SHIFT = 27; /// Position of the bit specifying if a candidate was vetoed in the multiplicity sum - static const uint32_t CAND_VETO_SHIFT = 28; + static constexpr uint32_t CAND_VETO_SHIFT = 28; private: /// Variable storing the multiplicity word(s) sent to the CTP diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_RIO.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_RIO.h index 7686b1cbfc87eaee7c3f8573ccff3c8bc090ce56..daedcc0f391e12ab76ae7e21c6886a04e725b7a2 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_RIO.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/MuCTPI_RIO.h @@ -49,7 +49,7 @@ public: /// Default constructor MuCTPI_RIO(); /// Destructor - ~MuCTPI_RIO(); + ~MuCTPI_RIO() = default; /// Function setting the BCID of the object void setBCID( const uint16_t bcId ) { m_bcId = bcId; } @@ -89,7 +89,7 @@ public: /// Get the number of status words as it was specified in the <strong>trailer</strong> uint32_t getHeaderNumberStatusWords() const { return m_headerNStatusWords; } /// Get the status words from the payload - std::vector< uint32_t > getHeaderStatusWords() const { return m_headerStatusWords; } + const std::vector< uint32_t >& getHeaderStatusWords() const { return m_headerStatusWords; } /// Set the ROD ID specidied in the header void headerSourceId( uint32_t val ) { m_headerSourceId = val; } @@ -167,8 +167,9 @@ private: /// Candidate multiplicity in MuCTPI_RIO::N_SUM number of p<sub>T</sub> thresholds - uint16_t m_sum[ N_SUM ]; + std::array<uint16_t, N_SUM> m_sum; +public: /** * $Date: 2007-07-05 13:26:22 $ * @@ -196,7 +197,7 @@ private: const uint16_t secID, const uint16_t sysId, const uint16_t hemisphere, const uint16_t roiNum, const bool accepted, const bool first, const bool duplicatedRoI, const bool duplicatedSector); /// Destructor - ~MyRoI(); + ~MyRoI() = default; /// Function dumping the stored information to the message stream void dumpData() const; @@ -234,7 +235,7 @@ private: }; // class MyRoI - +private: /// Variable holding the custom RoIs std::vector< MyRoI > m_roI; diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/RecRoIBResult.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/RecRoIBResult.h index cf9f97aed97ca5c515b8efcddfc91d2f03c5c8fa..ad3bece1b2edae18f6a7cd3230d4c896ca2a1842 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/RecRoIBResult.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/RecRoIBResult.h @@ -24,14 +24,15 @@ namespace ROIB { class RecRoIBResult { public: - /* Full Constructor */ - RecRoIBResult( const std::vector< LVL1::RecEmTauRoI >& recEmTauRoIs, - const std::vector< LVL1::RecMuonRoI >& recMuonRoIs, - const std::vector< LVL1::RecJetRoI >& recJetRoIs ); + /* Empty constructor */ - RecRoIBResult(); - /* Destructor */ - ~RecRoIBResult(); + RecRoIBResult() = default; + + /* Full Constructor */ + RecRoIBResult( std::vector< LVL1::RecEmTauRoI >&& recEmTauRoIs, + std::vector< LVL1::RecMuonRoI >&& recMuonRoIs, + std::vector< LVL1::RecJetRoI >&& recJetRoIs ); + /* Gets the RecEmTauRoI part of the L1 reconstructed RDO */ const std::vector< LVL1::RecEmTauRoI >& recEmTauRoIVector() const; diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/RoIBResult.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/RoIBResult.h index 705f6813f901591b1a1ae6cf329f5157b7ea03ff..df6675fcbb8e94b17dc3effc9661d0f4a9d814c8 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/RoIBResult.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/RoIBResult.h @@ -48,26 +48,21 @@ namespace ROIB { public: //! default constructor: empty object - RoIBResult(); - //! Full constructor, with all RODs provided - RoIBResult( const MuCTPIResult&, const CTPResult&, - const std::vector< JetEnergyResult >&, - const std::vector< EMTauResult >& ); + RoIBResult() = default; + //! Full move constructor, with all RODs provided RoIBResult( MuCTPIResult&&, CTPResult&&, std::vector< JetEnergyResult >&&, std::vector< EMTauResult >&& ); //! Constructor without Muon rod - RoIBResult( const CTPResult&, - const std::vector< EMTauResult >&, - const std::vector< JetEnergyResult >& ); + RoIBResult( CTPResult&&, + std::vector< EMTauResult >&&, + std::vector< JetEnergyResult >&& ); //! Constructor for only CTP and egamma rods - RoIBResult( const CTPResult&, const std::vector< EMTauResult >& ); + RoIBResult( CTPResult&&, std::vector< EMTauResult >&& ); //! Constructor for only CTP rod - RoIBResult( const CTPResult& ); - //! empty default destructor - ~RoIBResult(); + RoIBResult( CTPResult&& ); //! Gets the MuCTPI part of the L1 RDO const MuCTPIResult& muCTPIResult() const; @@ -80,7 +75,7 @@ namespace ROIB { //! Gets the L1Topo part of the L1 RDO const std::vector< L1TopoResult >& l1TopoResult() const; //! Sets the L1Topo part of the L1 RDO - void l1TopoResult(const std::vector< L1TopoResult >&); + void l1TopoResult(std::vector< L1TopoResult >&&) noexcept; //! dump raw object content to string /** method used for read/write testing and T/P separation */ @@ -99,15 +94,15 @@ namespace ROIB { J1_DOFL=16, J2_DOFL=32, MU_DOFL=64, MU_SUP1=128, MU_SUP2=256, MU_SOFL=512}; - const static unsigned int DOFL_bitMask = 16; - const static unsigned int SUP1_bitMask = 1 << 16; - const static unsigned int SUP2_bitMask = 1 << 17; + constexpr static unsigned int DOFL_bitMask = 16; + constexpr static unsigned int SUP1_bitMask = 1 << 16; + constexpr static unsigned int SUP2_bitMask = 1 << 17; - const static unsigned int emOverflow = EM1_DOFL | EM2_DOFL | EM3_DOFL | EM4_DOFL; - const static unsigned int jOverflow = J1_DOFL | J2_DOFL; - const static unsigned int anyOverflow = emOverflow | jOverflow | MU_DOFL; - const static unsigned int emLink[4]; - const static unsigned int jLink[2]; + constexpr static unsigned int emOverflow = EM1_DOFL | EM2_DOFL | EM3_DOFL | EM4_DOFL; + constexpr static unsigned int jOverflow = J1_DOFL | J2_DOFL; + constexpr static unsigned int anyOverflow = emOverflow | jOverflow | MU_DOFL; + constexpr static unsigned int emLink[4] = {EM1_DOFL, EM2_DOFL, EM3_DOFL, EM4_DOFL}; + constexpr static unsigned int jLink[2] = {J1_DOFL, J2_DOFL}; /* true if overlfow on any link (note that the SUP1, SUP2 and SOFL bits are not checked) */ diff --git a/Trigger/TrigT1/TrigT1Result/TrigT1Result/Trailer.h b/Trigger/TrigT1/TrigT1Result/TrigT1Result/Trailer.h index 4315fb9fecd634dc0d5c6d1083ec720f545725f2..327b95c8edfb3f4898bab7101edd9d4cd9c5e1de 100755 --- a/Trigger/TrigT1/TrigT1Result/TrigT1Result/Trailer.h +++ b/Trigger/TrigT1/TrigT1Result/TrigT1Result/Trailer.h @@ -40,7 +40,7 @@ namespace ROIB { // constants: /** a ROD trailer as used in the LVL1 has 5 words, not counting the one hardware word in the end */ - static const unsigned int wordsPerTrailer = 5; //!< number of words in trailer (Ref: ATL-DA-ES-0029.) + static constexpr unsigned int wordsPerTrailer = 5; //!< number of words in trailer (Ref: ATL-DA-ES-0029.) //! default constructor: empty object Trailer() @@ -52,8 +52,8 @@ namespace ROIB { Trailer& operator=(const Trailer&) =default; //! constructor which fully specifies the initialiser values - Trailer( const std::vector< uint32_t >& v) - : m_trailer( v ) {} + Trailer( std::vector< uint32_t > &&v) + : m_trailer( std::move(v) ) {} //! constructor specifying the number of data words and the error status Trailer( const uint32_t, const uint32_t ); diff --git a/Trigger/TrigT1/TrigT1Result/src/CTPResult.cxx b/Trigger/TrigT1/TrigT1Result/src/CTPResult.cxx index f47d2399fa0a2626df01cfef3e171e8e275a4364..2704a9068c88a71d2346ba3e137983e5feac879f 100755 --- a/Trigger/TrigT1/TrigT1Result/src/CTPResult.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/CTPResult.cxx @@ -23,22 +23,11 @@ namespace ROIB { - CTPResult::CTPResult() : - m_CTPResultHeader(), - m_CTPResultTrailer(), - m_CTPResultRoIVec(), - //m_ctpVersionNumber(0), - m_ctpDataformat(0), - m_useRoIB(false), - m_l1aBunch(0) - { - } - - CTPResult::CTPResult(unsigned int ctpVersion, const Header& head, const Trailer& trail, const std::vector<CTPRoI>& rois) : - m_CTPResultHeader( head ), - m_CTPResultTrailer( trail ), - m_CTPResultRoIVec( rois ), + CTPResult::CTPResult(unsigned int ctpVersion, Header&& head, Trailer &&trail, std::vector<CTPRoI>&& rois) : + m_CTPResultHeader( std::move(head) ), + m_CTPResultTrailer( std::move(trail) ), + m_CTPResultRoIVec( std::move(rois) ), //m_ctpVersionNumber( ctpVersion ), m_ctpDataformat( ctpVersion ), m_useRoIB(false), @@ -49,23 +38,21 @@ namespace ROIB { } - CTPResult::CTPResult(unsigned int ctpVersion, const Header& head, const Trailer& trail, const std::vector<uint32_t>& v ) : - m_CTPResultHeader( head ), - m_CTPResultTrailer( trail ), + CTPResult::CTPResult(unsigned int ctpVersion, Header&& head, Trailer&& trail, const std::vector<uint32_t>& v ) : + m_CTPResultHeader( std::move(head) ), + m_CTPResultTrailer( std::move(trail) ), //m_ctpVersionNumber( ctpVersion ), m_ctpDataformat( ctpVersion ), m_useRoIB(false), m_l1aBunch(0) { m_useRoIB = (head.sourceID() == 0x770001); + std::copy(v.begin(), v.end(), back_inserter(m_CTPResultRoIVec)); if (!m_useRoIB) m_l1aBunch = (head.formatVersion() >> m_ctpDataformat.getL1APositionShift()) & m_ctpDataformat.getL1APositionMask(); } - CTPResult::~CTPResult() {} - - const std::string CTPResult::dump() const { std::ostringstream s; diff --git a/Trigger/TrigT1/TrigT1Result/src/CTP_RDO.cxx b/Trigger/TrigT1/TrigT1Result/src/CTP_RDO.cxx index ce1e091f6517beb6cc261aadafd2a5112c8608c6..3dd5c3402c68741cb7449d236ae465c8b324b64b 100755 --- a/Trigger/TrigT1/TrigT1Result/src/CTP_RDO.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/CTP_RDO.cxx @@ -35,10 +35,10 @@ CTP_RDO::CTP_RDO(unsigned int ctpVersionNumber, const uint32_t nBCs, uint32_t nE m_dataWords.resize(m_ctpDataFormat.getNumberTimeWords()+(nBCs*m_ctpDataFormat.getDAQwordsPerBunch() )+nExtraWords); } -CTP_RDO::CTP_RDO(unsigned int ctpVersionNumber, const std::vector<uint32_t>& data, uint32_t nExtraWords) +CTP_RDO::CTP_RDO(unsigned int ctpVersionNumber, std::vector<uint32_t>&& data, uint32_t nExtraWords) : m_ctpVersionNumber(ctpVersionNumber), m_ctpDataFormat(ctpVersionNumber), - m_dataWords(data) + m_dataWords(std::move(data)) { m_numberOfAdditionalWords=nExtraWords; @@ -274,8 +274,7 @@ std::vector<uint32_t> CTP_RDO::getWords(WordType type) const offset = getCTPVersion().getTAVpos(); break; case EXTRA: - for (size_t i(m_dataWords.size()-m_numberOfAdditionalWords); i < m_dataWords.size(); ++i) - vec.push_back(m_dataWords[i]); + vec.assign(m_dataWords.begin() + (m_dataWords.size()-m_numberOfAdditionalWords), m_dataWords.end()); return vec; break; diff --git a/Trigger/TrigT1/TrigT1Result/src/EMTauResult.cxx b/Trigger/TrigT1/TrigT1Result/src/EMTauResult.cxx index e24cdee51420954ab59a534732848ac8a650115e..959a02f73bb1d3be20924f74191a0cc58e897402 100755 --- a/Trigger/TrigT1/TrigT1Result/src/EMTauResult.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/EMTauResult.cxx @@ -1,7 +1,7 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + // Local include(s): #include "TrigT1Result/EMTauResult.h" @@ -15,9 +15,9 @@ namespace ROIB { - EMTauResult::EMTauResult( const Header& head, const Trailer& trail, const std::vector< EMTauRoI >& roIVector ) - : m_EMTauResultHeader( head ), m_EMTauResultTrailer( trail ), - m_EMTauResultRoIVec( roIVector ) { + EMTauResult::EMTauResult( Header&& head, Trailer&& trail, std::vector< EMTauRoI >&& roIVector ) + : m_EMTauResultHeader( std::move(head) ), m_EMTauResultTrailer( std::move(trail) ), + m_EMTauResultRoIVec( std::move(roIVector) ) { } diff --git a/Trigger/TrigT1/TrigT1Result/src/EMTauRoI.cxx b/Trigger/TrigT1/TrigT1Result/src/EMTauRoI.cxx index 1176f9c807f692c86b7ce286fb5d200595453af7..62ea6815e74a9098f78152b473bd1c87cf9de541 100755 --- a/Trigger/TrigT1/TrigT1Result/src/EMTauRoI.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/EMTauRoI.cxx @@ -23,10 +23,6 @@ namespace ROIB { { } - EMTauRoI::~EMTauRoI() { - - } - void EMTauRoI::update() { // Obsolete a long time ago. m_roIWord = RoIFormatUpdater::UpdateEMTauRoI(m_roIWord) ; diff --git a/Trigger/TrigT1/TrigT1Result/src/JetEnergyResult.cxx b/Trigger/TrigT1/TrigT1Result/src/JetEnergyResult.cxx index 483d29ceeb7ef414a16d05a1f2c67468c8583a6a..18bb16b5c71d16e201c6e406afe3aca6f4fb71ae 100755 --- a/Trigger/TrigT1/TrigT1Result/src/JetEnergyResult.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/JetEnergyResult.cxx @@ -1,7 +1,7 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + // Local include(s): #include "TrigT1Result/JetEnergyResult.h" @@ -16,9 +16,9 @@ namespace ROIB { - JetEnergyResult::JetEnergyResult( const Header& head, const Trailer& trail, const std::vector< JetEnergyRoI >& roIVector ) - : m_JetEnergyResultHeader( head ), m_JetEnergyResultTrailer( trail ), - m_JetEnergyResultRoIVec( roIVector ) { + JetEnergyResult::JetEnergyResult( Header&& head, Trailer&& trail, std::vector< JetEnergyRoI >&& roIVector ) + : m_JetEnergyResultHeader( std::move(head) ), m_JetEnergyResultTrailer( std::move(trail) ), + m_JetEnergyResultRoIVec( std::move(roIVector) ) { } @@ -28,10 +28,6 @@ namespace ROIB { } - JetEnergyResult::~JetEnergyResult() { - - } - const Header& JetEnergyResult::header() const { return m_JetEnergyResultHeader; } diff --git a/Trigger/TrigT1/TrigT1Result/src/JetEnergyRoI.cxx b/Trigger/TrigT1/TrigT1Result/src/JetEnergyRoI.cxx index 6acf5c9090207bec9f5648a3df63facef92d752c..55038367c03e0bfb7d127ba53a389c5e63aae2c2 100755 --- a/Trigger/TrigT1/TrigT1Result/src/JetEnergyRoI.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/JetEnergyRoI.cxx @@ -23,10 +23,6 @@ namespace ROIB { { } - JetEnergyRoI::~JetEnergyRoI() { - - } - void JetEnergyRoI::update() { /// This was obselete a long time ago m_roIWord = RoIFormatUpdater::UpdateJetEnergyRoI( m_roIWord ); diff --git a/Trigger/TrigT1/TrigT1Result/src/L1TopoResult.cxx b/Trigger/TrigT1/TrigT1Result/src/L1TopoResult.cxx index 1708ec2b088e5e4e1b6ec8532f1d93a4f1fe49cf..23cc8132b5fda4f804fe94a7e9bb00a49c6bd775 100644 --- a/Trigger/TrigT1/TrigT1Result/src/L1TopoResult.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/L1TopoResult.cxx @@ -11,16 +11,8 @@ namespace ROIB { - L1TopoResult::L1TopoResult( const Header& header, const Trailer& trailer, const L1TopoRDO& rdo) - : m_header(header), m_trailer(trailer), m_RDO(rdo) - {} - - - L1TopoResult::L1TopoResult() - : m_header(), m_trailer(), m_RDO() - {} - - L1TopoResult::~L1TopoResult() + L1TopoResult::L1TopoResult( Header&& header, Trailer&& trailer, L1TopoRDO&& rdo) noexcept + : m_header(std::move(header)), m_trailer(std::move(trailer)), m_RDO(std::move(rdo)) {} const Header& L1TopoResult::header() const { diff --git a/Trigger/TrigT1/TrigT1Result/src/MuCTPIResult.cxx b/Trigger/TrigT1/TrigT1Result/src/MuCTPIResult.cxx index 3f3c40efae0e0e7e13fb934dca0f7af7bf0414a8..2b4e380dffab891b57aeea5d18c3ae07ffd2e410 100755 --- a/Trigger/TrigT1/TrigT1Result/src/MuCTPIResult.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/MuCTPIResult.cxx @@ -28,9 +28,9 @@ namespace ROIB { * @param trail Reference to the trailer to be used by the object * @param roIVector Vector of muon RoIs collected from the MuCTPI */ - MuCTPIResult::MuCTPIResult( const Header& head, const Trailer& trail, const vector< MuCTPIRoI >& roIVector ) - : m_MuCTPIResultHeader( head ), m_MuCTPIResultTrailer( trail ), - m_MuCTPIResultRoIVec( roIVector ) { + MuCTPIResult::MuCTPIResult( Header&& head, Trailer&& trail, vector< MuCTPIRoI >&& roIVector ) + : m_MuCTPIResultHeader( std::move(head) ), m_MuCTPIResultTrailer( std::move(trail) ), + m_MuCTPIResultRoIVec( std::move(roIVector) ) { } @@ -43,13 +43,6 @@ namespace ROIB { } - /** - * The destructor doesn't need to do anything actually. - */ - MuCTPIResult::~MuCTPIResult() { - - } - /** * Simply returning a constant reference to the variable * diff --git a/Trigger/TrigT1/TrigT1Result/src/MuCTPIRoI.cxx b/Trigger/TrigT1/TrigT1Result/src/MuCTPIRoI.cxx index 23bb73c9e31a6497ebabed14fe869d3ccd2446bc..4a68f823a2b54b7cd3934c6b0cfbc7df49ba7f5b 100755 --- a/Trigger/TrigT1/TrigT1Result/src/MuCTPIRoI.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/MuCTPIRoI.cxx @@ -27,11 +27,6 @@ namespace ROIB { MuCTPIRoI::MuCTPIRoI() : m_roIWord( 0 ) {} - /** - * As for many other classes, the destructor doesn't do anything. Why did we implement it then? - */ - MuCTPIRoI::~MuCTPIRoI() {} - /** * This method can be used to access the "original" RoI word. * diff --git a/Trigger/TrigT1/TrigT1Result/src/MuCTPI_DataWord_Decoder.cxx b/Trigger/TrigT1/TrigT1Result/src/MuCTPI_DataWord_Decoder.cxx index 3ade8210f10780358c5d29b8a8eb52816d47cac8..751d959aef58221f7a947df4c66576a509b77a46 100755 --- a/Trigger/TrigT1/TrigT1Result/src/MuCTPI_DataWord_Decoder.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/MuCTPI_DataWord_Decoder.cxx @@ -23,13 +23,6 @@ MuCTPI_DataWord_Decoder::MuCTPI_DataWord_Decoder( uint32_t dataword ) } -/** - * Another useless I-don't-do-anythin' destructor. - */ -MuCTPI_DataWord_Decoder::~MuCTPI_DataWord_Decoder() { - -} - /** * @return flag showing whether there were more than 2 candidates in this candidate's sector */ diff --git a/Trigger/TrigT1/TrigT1Result/src/MuCTPI_MultiplicityWord_Decoder.cxx b/Trigger/TrigT1/TrigT1Result/src/MuCTPI_MultiplicityWord_Decoder.cxx index 5e01c7b80070673d2d2fc07d6d314a6b41d6f1c2..5e7529e0fd5539348d0500d8541cd524303c90a6 100755 --- a/Trigger/TrigT1/TrigT1Result/src/MuCTPI_MultiplicityWord_Decoder.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/MuCTPI_MultiplicityWord_Decoder.cxx @@ -35,12 +35,6 @@ MuCTPI_MultiplicityWord_Decoder::MuCTPI_MultiplicityWord_Decoder( const uint32_t if (inclusiveTriggerMode) m_triggerMode = inclusive; } -/** - * Another useless I-don't-do-anythin' destructor. - */ -MuCTPI_MultiplicityWord_Decoder::~MuCTPI_MultiplicityWord_Decoder() { - -} /** * @return total number of muon candidates diff --git a/Trigger/TrigT1/TrigT1Result/src/MuCTPI_RIO.cxx b/Trigger/TrigT1/TrigT1Result/src/MuCTPI_RIO.cxx index 7d04ee430d48c5d87b1a9bd0f10ebf90418cce8c..5f41960891a9dbaf6202f1172d3768be0bcef4eb 100755 --- a/Trigger/TrigT1/TrigT1Result/src/MuCTPI_RIO.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/MuCTPI_RIO.cxx @@ -22,16 +22,8 @@ MuCTPI_RIO::MuCTPI_RIO() m_headerLVL1TriggerType( 0 ), m_headerDetEventType( 0 ), m_headerNDataWords( 0 ), m_headerNStatusWords( 0 ), m_bcId( 0 ), m_sum() { - m_roI.clear(); - m_headerStatusWords.clear(); } -/** - * Another useless I-don't-do-anythin' destructor. - */ -MuCTPI_RIO::~MuCTPI_RIO() { - -} /** * This function sets the muon candidate multiplicity sums in the 6 p<sub>T</sub> thresholds. @@ -197,13 +189,6 @@ MuCTPI_RIO::MyRoI::MyRoI( const uint16_t bcId, const uint16_t pTVal,const uint16 m_sectorID( secID ), m_sysId( sysId ), m_hemisphere( hemisphere ? true : false ), m_roINumber( roiNum ), m_accepted( accepted ), m_first( first ), m_duplicatedRoI( duplicatedRoI ), m_duplicatedSector( duplicatedSector ) {} -/** - * Another useless I-don't-do-anythin' destructor. - */ -MuCTPI_RIO::MyRoI::~MyRoI() { - -} - /** * This function is not responsible for actually printing the information, it just creates * a message stream to print the information to with MuCTPI_RIO::MyRoI::dumpData(MsgStream&) const. diff --git a/Trigger/TrigT1/TrigT1Result/src/RecRoIBResult.cxx b/Trigger/TrigT1/TrigT1Result/src/RecRoIBResult.cxx index e28e24ec9f8ae53be4139b0e3b7a1275292e477e..d7002a720bbad8d9bfde7c4bc84cdb15116c489c 100755 --- a/Trigger/TrigT1/TrigT1Result/src/RecRoIBResult.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/RecRoIBResult.cxx @@ -10,25 +10,15 @@ using namespace std; namespace ROIB { - RecRoIBResult::RecRoIBResult( const std::vector< LVL1::RecEmTauRoI >& recEmTauRoIs, - const std::vector< LVL1::RecMuonRoI >& recMuonRoIs, - const std::vector< LVL1::RecJetRoI >& recJetRoIs ) - : m_recRoIBResult_RecEmTauRoIVector( recEmTauRoIs ), - m_recRoIBResult_RecMuonRoIVector( recMuonRoIs ), - m_recRoIBResult_RecJetRoIVector( recJetRoIs ) { + RecRoIBResult::RecRoIBResult( std::vector< LVL1::RecEmTauRoI >&& recEmTauRoIs, + std::vector< LVL1::RecMuonRoI >&& recMuonRoIs, + std::vector< LVL1::RecJetRoI >&& recJetRoIs ) + : m_recRoIBResult_RecEmTauRoIVector( std::move(recEmTauRoIs) ), + m_recRoIBResult_RecMuonRoIVector( std::move(recMuonRoIs) ), + m_recRoIBResult_RecJetRoIVector( std::move(recJetRoIs) ) { } - RecRoIBResult::RecRoIBResult() - : m_recRoIBResult_RecEmTauRoIVector(), - m_recRoIBResult_RecMuonRoIVector(), - m_recRoIBResult_RecJetRoIVector() { - - } - - RecRoIBResult::~RecRoIBResult() { - - } const vector< LVL1::RecEmTauRoI >& RecRoIBResult::recEmTauRoIVector() const { return m_recRoIBResult_RecEmTauRoIVector; diff --git a/Trigger/TrigT1/TrigT1Result/src/RoIBResult.cxx b/Trigger/TrigT1/TrigT1Result/src/RoIBResult.cxx index 2f4a66c7bb52ac71dd41424f8f30fa47549d0eb7..84c659a334e02e0b35d191e387f221c33c60ec56 100755 --- a/Trigger/TrigT1/TrigT1Result/src/RoIBResult.cxx +++ b/Trigger/TrigT1/TrigT1Result/src/RoIBResult.cxx @@ -19,17 +19,6 @@ namespace ROIB { - const unsigned int RoIBResult::emLink[4] = {EM1_DOFL, EM2_DOFL, EM3_DOFL, EM4_DOFL}; - const unsigned int RoIBResult::jLink[2] = {J1_DOFL, J2_DOFL}; - - RoIBResult::RoIBResult( const MuCTPIResult& muctpi, const CTPResult& ctp, const std::vector< JetEnergyResult >& jetEnergy, - const std::vector< EMTauResult >& emtau ) - : m_RoIBResultMuCTPI( muctpi ), m_RoIBResultCTP( ctp ), - m_RoIBResultJetEnergy( jetEnergy ), m_RoIBResultEMTau( emtau ), - m_RoIBResultL1Topo() { - - } - RoIBResult::RoIBResult( MuCTPIResult&& muctpi, CTPResult&& ctp, std::vector< JetEnergyResult >&& jetEnergy, @@ -42,38 +31,28 @@ namespace ROIB { { } - RoIBResult::RoIBResult( const CTPResult& ctp, - const std::vector< EMTauResult >& emtau, - const std::vector< JetEnergyResult >& jetEnergy ) - : m_RoIBResultMuCTPI(), m_RoIBResultCTP( ctp ), - m_RoIBResultJetEnergy( jetEnergy ), m_RoIBResultEMTau( emtau ), + RoIBResult::RoIBResult( CTPResult&& ctp, + std::vector< EMTauResult >&& emtau, + std::vector< JetEnergyResult >&& jetEnergy ) + : m_RoIBResultMuCTPI(), m_RoIBResultCTP( std::move(ctp) ), + m_RoIBResultJetEnergy( std::move(jetEnergy) ), m_RoIBResultEMTau( std::move(emtau) ), m_RoIBResultL1Topo() { } - RoIBResult::RoIBResult( const CTPResult& ctp, const std::vector< EMTauResult >& emtau ) - : m_RoIBResultMuCTPI(), m_RoIBResultCTP( ctp ), - m_RoIBResultJetEnergy(), m_RoIBResultEMTau( emtau ), - m_RoIBResultL1Topo() { - } - - RoIBResult::RoIBResult( const CTPResult& ctp ) - : m_RoIBResultMuCTPI(), m_RoIBResultCTP( ctp ), - m_RoIBResultJetEnergy(), m_RoIBResultEMTau(), + RoIBResult::RoIBResult( CTPResult&& ctp, std::vector< EMTauResult >&& emtau ) + : m_RoIBResultMuCTPI(), m_RoIBResultCTP( std::move(ctp) ), + m_RoIBResultJetEnergy(), m_RoIBResultEMTau( std::move(emtau) ), m_RoIBResultL1Topo() { - } - RoIBResult::RoIBResult() - : m_RoIBResultMuCTPI(), m_RoIBResultCTP(), + RoIBResult::RoIBResult( CTPResult&& ctp ) + : m_RoIBResultMuCTPI(), m_RoIBResultCTP( std::move(ctp) ), m_RoIBResultJetEnergy(), m_RoIBResultEMTau(), m_RoIBResultL1Topo() { } - RoIBResult::~RoIBResult() { - } - const MuCTPIResult& RoIBResult::muCTPIResult() const { return m_RoIBResultMuCTPI; } @@ -94,8 +73,8 @@ namespace ROIB { return m_RoIBResultL1Topo; } - void RoIBResult::l1TopoResult(const std::vector< L1TopoResult >& vL1TopoResult){ - m_RoIBResultL1Topo = vL1TopoResult; + void RoIBResult::l1TopoResult(std::vector< L1TopoResult >&& vL1TopoResult) noexcept{ + m_RoIBResultL1Topo = std::move(vL1TopoResult); } const std::string RoIBResult::dump() const diff --git a/Trigger/TrigT1/TrigT1Result/test/type_trait_tests.cxx b/Trigger/TrigT1/TrigT1Result/test/type_trait_tests.cxx new file mode 100755 index 0000000000000000000000000000000000000000..27dba986eeedbddf51e51c247e2b690ab007cc2c --- /dev/null +++ b/Trigger/TrigT1/TrigT1Result/test/type_trait_tests.cxx @@ -0,0 +1,62 @@ +#include "TrigT1Result/MuCTPI_RIO.h" +#include "TrigT1Result/MuCTPIRoI.h" +#include "TrigT1Result/MuCTPIResult.h" +#include "TrigT1Result/MuCTPI_RDO.h" +#include "TrigT1Result/RecRoIBResult.h" +#include "TrigT1Result/RoIBResult.h" +#include "TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h" +#include "TrigT1Result/MuCTPI_DataWord_Decoder.h" +#include "TrigT1Result/Header.h" +#include "TrigT1Result/L1TopoResult.h" +#include "TrigT1Result/JetEnergyRoI.h" +#include "TrigT1Result/JetEnergyResult.h" +#include "TrigT1Result/EMTauRoI.h" +#include "TrigT1Result/EMTauResult.h" +#include "TrigT1Result/CTPRoI.h" +#include "TrigT1Result/CTPResult.h" +#include "TrigT1Result/CTP_RIO.h" +#include "TrigT1Result/CTP_RDO.h" +#include "TrigT1Result/Trailer.h" +# + +using namespace ROIB; + +int main(){ + static_assert(std::is_nothrow_move_constructible<Header>::value); + static_assert(std::is_nothrow_move_constructible<Trailer>::value); + static_assert(std::is_trivially_copy_constructible<MuCTPIRoI>::value); + static_assert(std::is_trivially_destructible<MuCTPIRoI>::value); + static_assert(std::is_nothrow_move_constructible<MuCTPIResult>::value); + static_assert(std::is_nothrow_move_assignable<MuCTPIResult>::value); + static_assert(std::is_trivially_copy_constructible<MuCTPI_RIO::MyRoI>::value); + static_assert(std::is_trivially_destructible<MuCTPI_RIO::MyRoI>::value); + + + + static_assert(std::is_nothrow_move_constructible<RecRoIBResult>::value); + static_assert(std::is_nothrow_move_constructible<RoIBResult>::value); + static_assert(std::is_trivially_copy_constructible<MuCTPI_MultiplicityWord_Decoder>::value); + static_assert(std::is_trivially_destructible<MuCTPI_MultiplicityWord_Decoder>::value); + static_assert(std::is_trivially_copy_constructible<MuCTPI_DataWord_Decoder>::value); + static_assert(std::is_trivially_destructible<MuCTPI_DataWord_Decoder>::value); + + static_assert(std::is_nothrow_move_constructible<L1TopoResult>::value); + static_assert(std::is_trivially_copy_constructible<JetEnergyRoI>::value); + static_assert(std::is_trivially_destructible<JetEnergyRoI>::value); + static_assert(std::is_nothrow_move_constructible<JetEnergyResult>::value); + static_assert(std::is_trivially_copy_constructible<EMTauRoI>::value); + static_assert(std::is_trivially_destructible<EMTauRoI>::value); + static_assert(std::is_nothrow_move_constructible<EMTauResult>::value); + static_assert(std::is_trivially_copy_constructible<CTPRoI>::value); + static_assert(std::is_trivially_destructible<CTPRoI>::value); + + //Dunno why this isn't movable but it isn't used much + //static_assert(std::is_nothrow_move_constructible<MuCTPI_RIO>::value); + //static_assert(std::is_nothrow_move_constructible<MuCTPI_RDO>::value); + + //Dunno what CTPdataformatVersion is so this will have to wait +// static_assert(std::is_trivially_copy_constructible<CTPResult>::value); +// static_assert(std::is_trivially_copy_constructible<CTP_RIO>::value); +// static_assert(std::is_trivially_copy_constructible<CTP_RDO>::value); + return 0; +} \ No newline at end of file diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/src/CTPByteStreamTool.cxx b/Trigger/TrigT1/TrigT1ResultByteStream/src/CTPByteStreamTool.cxx index f0ef78762999531687c0dcb6b291bf093ee0be42..a2bc4be74ab57349da5c2b4f4f3a11b4a3eb88d6 100755 --- a/Trigger/TrigT1/TrigT1ResultByteStream/src/CTPByteStreamTool.cxx +++ b/Trigger/TrigT1/TrigT1ResultByteStream/src/CTPByteStreamTool.cxx @@ -149,7 +149,7 @@ StatusCode CTPByteStreamTool::convert( const ROBF* rob, CTP_RDO*& result ) { uint32_t nExtraWords=0; nExtraWords=CTPfragment::numberExtraPayloadWords(rob); unsigned int ctpVersionNumber = CTPfragment::ctpFormatVersion(rob); - result = new CTP_RDO(ctpVersionNumber, vDataWords , nExtraWords); + result = new CTP_RDO(ctpVersionNumber, std::move(vDataWords) , nExtraWords); uint8_t l1apos = CTPfragment::lvl1AcceptBunch(rob); result->setL1AcceptBunchPosition(l1apos); diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/src/MuCTPIByteStreamTool.cxx b/Trigger/TrigT1/TrigT1ResultByteStream/src/MuCTPIByteStreamTool.cxx index a54ae1195bcb92b3d01be487ab04d6738bdb0191..a0fa201d743a593bb3c3edc2e81f6a0eed3c0b4d 100755 --- a/Trigger/TrigT1/TrigT1ResultByteStream/src/MuCTPIByteStreamTool.cxx +++ b/Trigger/TrigT1/TrigT1ResultByteStream/src/MuCTPIByteStreamTool.cxx @@ -157,7 +157,7 @@ StatusCode MuCTPIByteStreamTool::convert( const ROBF* rob, MuCTPI_RDO*& result ) } // create MuCTPI RDO - result = new MuCTPI_RDO( candidateMultiplicity, dataWord ); + result = new MuCTPI_RDO( std::move(candidateMultiplicity), std::move(dataWord) ); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/src/RecRoIBResultByteStreamTool.cxx b/Trigger/TrigT1/TrigT1ResultByteStream/src/RecRoIBResultByteStreamTool.cxx index 99d0999e22af23415242c821f32ab0c9f33ff4bc..28f0306a10c52dd7b184cf2c2e3ce216066d35c1 100755 --- a/Trigger/TrigT1/TrigT1ResultByteStream/src/RecRoIBResultByteStreamTool.cxx +++ b/Trigger/TrigT1/TrigT1ResultByteStream/src/RecRoIBResultByteStreamTool.cxx @@ -49,7 +49,7 @@ StatusCode RecRoIBResultByteStreamTool::initialize() { // --------------------------------------------------------------------------- // Load the threshold vectors // --------------------------------------------------------------------------- - std::vector<TrigConf::TriggerThreshold*> thresholds = m_configSvc->ctpConfig()->menu().thresholdVector(); + const std::vector<TrigConf::TriggerThreshold*> &thresholds = m_configSvc->ctpConfig()->menu().thresholdVector(); for (TrigConf::TriggerThreshold* threshold : thresholds) { switch (threshold->ttype()) { case TrigConf::L1DataDef::TriggerType::MUON: @@ -193,6 +193,6 @@ StatusCode RecRoIBResultByteStreamTool::convert(const std::vector<const ROBFragm } ATH_MSG_DEBUG("Building RecRoIBResult with " << emTauContent.size() << " EM/Tau RoIs, " << muonContent.size() << " Muon RoIs, " << jetContent.size() << " Jet/Energy RoIs"); - resultToFill = ROIB::RecRoIBResult(emTauContent, muonContent, jetContent); + resultToFill = ROIB::RecRoIBResult(std::move(emTauContent), std::move(muonContent), std::move(jetContent)); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigT1/TrigT1ResultByteStream/src/RoIBResultByteStreamTool.cxx b/Trigger/TrigT1/TrigT1ResultByteStream/src/RoIBResultByteStreamTool.cxx index 9beebb3175c590a02405cf4f598a381c9787c046..121ed14761430665e4607d70479bde44180df5a6 100755 --- a/Trigger/TrigT1/TrigT1ResultByteStream/src/RoIBResultByteStreamTool.cxx +++ b/Trigger/TrigT1/TrigT1ResultByteStream/src/RoIBResultByteStreamTool.cxx @@ -264,7 +264,7 @@ StatusCode RoIBResultByteStreamTool::convertFromBS(const std::vector<const ROBFr unsigned int ctpVersionNumber = ((rod[CTPdataformat::Helper::FormatVersionPos] >> CTPdataformat::CTPFormatVersionShift) & CTPdataformat::CTPFormatVersionMask); // Create CTPResult object - cTPResult = ROIB::CTPResult(ctpVersionNumber, header, trailer, content); + cTPResult = ROIB::CTPResult(ctpVersionNumber, std::move(header), std::move(trailer), std::move(content)); break; } @@ -288,7 +288,7 @@ StatusCode RoIBResultByteStreamTool::convertFromBS(const std::vector<const ROBFr ROIB::Trailer trailer = roibTrailer(status, content.size()); // Create MuCTPIResult object - muCTPIResult = ROIB::MuCTPIResult(header, trailer, content); + muCTPIResult = ROIB::MuCTPIResult(std::move(header), std::move(trailer), std::move(content)); break; } @@ -314,7 +314,7 @@ StatusCode RoIBResultByteStreamTool::convertFromBS(const std::vector<const ROBFr ROIB::Trailer trailer = roibTrailer(status, content.size()); // Create JetEnergyResult object - jetEnergyResult[index] = ROIB::JetEnergyResult(header, trailer, content); + jetEnergyResult[index] = ROIB::JetEnergyResult(std::move(header), std::move(trailer), std::move(content)); break; } @@ -340,7 +340,7 @@ StatusCode RoIBResultByteStreamTool::convertFromBS(const std::vector<const ROBFr ROIB::Trailer trailer = roibTrailer(status, content.size()); // Create EMTauResult object - eMTauResult[index] = ROIB::EMTauResult(header, trailer, content); + eMTauResult[index] = ROIB::EMTauResult(std::move(header), std::move(trailer), std::move(content)); break; } @@ -373,7 +373,7 @@ StatusCode RoIBResultByteStreamTool::convertFromBS(const std::vector<const ROBFr if (status.rod_error) content.setError(L1Topo::Error::ROD_ERROR); // Create L1TopoResult object - l1TopoResult.push_back(ROIB::L1TopoResult(header, trailer, content)); + l1TopoResult.emplace_back(std::move(header), std::move(trailer), std::move(content)); break; } @@ -399,11 +399,11 @@ StatusCode RoIBResultByteStreamTool::convertFromBS(const std::vector<const ROBFr // Create and record the RoIBResult auto roibResult = SG::makeHandle(m_roibResultWriteKey, eventContext); - ATH_CHECK(roibResult.record(std::make_unique<ROIB::RoIBResult>(muCTPIResult, cTPResult, jetEnergyResult, eMTauResult))); + ATH_CHECK(roibResult.record(std::make_unique<ROIB::RoIBResult>(std::move(muCTPIResult), std::move(cTPResult), std::move(jetEnergyResult), std::move(eMTauResult)))); ATH_MSG_DEBUG("Recorded RoIBResult with key " << m_roibResultWriteKey.key()); // Add L1Topo result - if (l1TopoFound) roibResult->l1TopoResult(l1TopoResult); + if (l1TopoFound) roibResult->l1TopoResult(std::move(l1TopoResult)); return StatusCode::SUCCESS; } @@ -472,7 +472,7 @@ ROIB::Trailer RoIBResultByteStreamTool::roibTrailer(const DataStatus& dataStatus words.push_back(2); // number of status words words.push_back(dataSize); // number of data words words.push_back(1); // status block position - return ROIB::Trailer(words); + return ROIB::Trailer(std::move(words)); } template<typename RoIType> std::vector<RoIType> RoIBResultByteStreamTool::roibContent(const ROBFragment& rob) const { @@ -504,7 +504,7 @@ L1TopoRDO RoIBResultByteStreamTool::l1topoContent(const ROBFragment& rob) const << static_cast<uint32_t>(*data) << MSG::dec); vDataWords.push_back(static_cast<uint32_t>(*data)); } - content.setDataWords(vDataWords); + content.setDataWords(std::move(vDataWords)); content.setSourceID(rob.rod_source_id()); return content; } diff --git a/Trigger/TrigT1/TrigT1RoIB/src/RoIBuilder.cxx b/Trigger/TrigT1/TrigT1RoIB/src/RoIBuilder.cxx index 419dd3824e45362f53db427afdb7a3fcfd68a788..0bb4426b87c609a4b4ed0d1305fe0b83d687d44a 100644 --- a/Trigger/TrigT1/TrigT1RoIB/src/RoIBuilder.cxx +++ b/Trigger/TrigT1/TrigT1RoIB/src/RoIBuilder.cxx @@ -177,7 +177,7 @@ namespace ROIB { } else { // prepare header - ctp_rdo_header = ctp_slink->getHeader(); + ctp_rdo_header = Header(std::vector<uint32_t>(ctp_slink->getHeader())); // get the data elements ctp_rdo_data = ctp_slink->getDataElements(); @@ -191,11 +191,12 @@ namespace ROIB { } // prepare trailer - ctp_rdo_trailer = ctp_slink->getTrailer(); + ctp_rdo_trailer = Trailer(std::vector<uint32_t>(ctp_slink->getTrailer())); } // build result - CTPResult ctp_rdo_result( ctp_slink->getCTPVersionNumber(), ctp_rdo_header, ctp_rdo_trailer, ctp_rdo_data ); + CTPResult ctp_rdo_result( ctp_slink->getCTPVersionNumber(), std::move(ctp_rdo_header), + std::move(ctp_rdo_trailer), ctp_rdo_data ); //ctp_rdo_data is not moved because it needs to be converted ATH_MSG_VERBOSE( "Dump CTPResult object:\n" + ctp_rdo_result.dump() ); // @@ -261,8 +262,8 @@ namespace ROIB { emtau_rdo_trailer.setSimulationError(); } - EMTauResult emtau_rdo_result( emtau_rdo_header, emtau_rdo_trailer, - emtau_rdo_data ); + EMTauResult emtau_rdo_result( std::move(emtau_rdo_header), std::move(emtau_rdo_trailer), + std::move(emtau_rdo_data) ); emtau_rdo_result_vector.push_back( emtau_rdo_result ); } @@ -324,9 +325,9 @@ namespace ROIB { jetenergy_rdo_trailer.setSimulationError(); } - JetEnergyResult jetenergy_rdo_result( jetenergy_rdo_header, - jetenergy_rdo_trailer, - jetenergy_rdo_data ); + JetEnergyResult jetenergy_rdo_result( std::move(jetenergy_rdo_header), + std::move(jetenergy_rdo_trailer), + std::move(jetenergy_rdo_data) ); jetenergy_rdo_result_vector.push_back( jetenergy_rdo_result ); } @@ -383,15 +384,17 @@ namespace ROIB { muctpi_rdo_trailer.setSimulationError(); } - MuCTPIResult muctpi_rdo_result( muctpi_rdo_header, muctpi_rdo_trailer, - muctpi_rdo_data ); + MuCTPIResult muctpi_rdo_result( std::move(muctpi_rdo_header), std::move(muctpi_rdo_trailer), + std::move(muctpi_rdo_data) ); // // Finally create RoIB RDO object: // - std::unique_ptr<RoIBResult> roib_rdo_result = std::make_unique< RoIBResult>( muctpi_rdo_result, ctp_rdo_result, - jetenergy_rdo_result_vector, - emtau_rdo_result_vector ); + std::unique_ptr<RoIBResult> roib_rdo_result = std::make_unique< RoIBResult>( + std::move(muctpi_rdo_result), + std::move(ctp_rdo_result), + std::move(jetenergy_rdo_result_vector), + std::move(emtau_rdo_result_vector) ); if( msgLvl( MSG::DEBUG ) ) { ATH_MSG_DEBUG( "RoIB Results:" ); roib_rdo_result->muCTPIResult().dumpData( msg( MSG::DEBUG ) ); diff --git a/Trigger/TrigTools/TrigMuonRoITools/src/TrigMuonRoITool.cxx b/Trigger/TrigTools/TrigMuonRoITools/src/TrigMuonRoITool.cxx index a695d73e99ae30d0016a2c59428938d3c45994a4..5984e48d513e0edf65fccd723ace8d7e1b02f46b 100644 --- a/Trigger/TrigTools/TrigMuonRoITools/src/TrigMuonRoITool.cxx +++ b/Trigger/TrigTools/TrigMuonRoITools/src/TrigMuonRoITool.cxx @@ -131,7 +131,7 @@ std::unique_ptr<TrigMuonRoITool::MuonRois> TrigMuonRoITool::decodeMuCTPi() { } // create MuCTPi RDO (DAQ muCTPi Result) - daqmuCTPIResult = new MuCTPI_RDO( candidateMultiplicity, dataWord ); + daqmuCTPIResult = new MuCTPI_RDO( std::move(candidateMultiplicity), std::move(dataWord) ); } // Retrieve the MuCTPi RDO via data handle