diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiBasicCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiBasicCleaner.h index c66a4611e51556d0503e97e1d47b245ca30f3fbf..ac617d0e71ca50a2904d3fddf8add6229980d8ec 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiBasicCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiBasicCleaner.h @@ -28,7 +28,7 @@ public: float negativeEThreshold); ~AntiBasicCleaner(){} - bool operator()(const pHypoJet&) const override; + bool operator()(const HypoJet::IJet&) const override; std::string getName() const noexcept override; }; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiLlpCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiLlpCleaner.h index ee8e2d62759a036bec7d708c5ac4879a64f3cf65..02bc2461749040651c9a2b52998aa866964db45c 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiLlpCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiLlpCleaner.h @@ -31,7 +31,7 @@ public: ~AntiLlpCleaner(){} - bool operator()(const pHypoJet& jet) const override; + bool operator()(const HypoJet::IJet& jet) const override; std::string getName() const noexcept override; }; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiLooseCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiLooseCleaner.h index 13785181d35b31e385d777499a868df3f1000bcc..16e87aaa03779804986bf44f8a255bfbe34dd353 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiLooseCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiLooseCleaner.h @@ -31,7 +31,7 @@ public: ~AntiLooseCleaner(){} - bool operator()(const pHypoJet& jet) const override; + bool operator()(const HypoJet::IJet& jet) const override; std::string getName() const noexcept override; }; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiTightCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiTightCleaner.h index 6493eb0283bf29d68216490d642bfae69f5984f3..cc0a90ec2dc297e983ae4c7f24449ff430037d3c 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiTightCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiTightCleaner.h @@ -31,7 +31,7 @@ public: ~AntiTightCleaner() {} - bool operator()(const pHypoJet& jet) const override; + bool operator()(const HypoJet::IJet& jet) const override; std::string getName() const noexcept override; }; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/BasicCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/BasicCleaner.h index c1ed78d04b4cb8fe3898c9a0fa2998e466db5359..08c0c9ddb39bf6b9b2185e4348080257893af4e9 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/BasicCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/BasicCleaner.h @@ -29,7 +29,7 @@ class BasicCleaner: public ICleaner{ ~BasicCleaner() {} - bool operator()(const pHypoJet& jet) const override; + bool operator()(const HypoJet::IJet& jet) const override; std::string toString() const noexcept override; std::string getName() const noexcept override; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h index 89bbaf2e8d4529f10cb51c91b8e0a62398c5745d..21d9eae791bfa23bbe44aa9fcaa58a5fe92e8740 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h @@ -29,7 +29,7 @@ class CleanerBridge{ m_pCleaner(cleaner){} bool operator()(const pHypoJet& jet) const{ - return m_pCleaner -> operator()(jet); + return m_pCleaner -> operator()(*jet); } std::string toString() const { diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/EtaEtCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/EtaEtCleaner.h index 5b46fc67a6fbb0906fd916c7dc754704d9ae2e1f..32d89c34bdb48ab8d95c11aac544453d3d978413 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/EtaEtCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/EtaEtCleaner.h @@ -29,7 +29,7 @@ public: ~EtaEtCleaner(){} - bool operator()(const pHypoJet&) const override; + bool operator()(const HypoJet::IJet&) const override; std::string toString() const noexcept override; std::string getName() const noexcept override; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h index bd6906818eb5ac0583321653f978f33cc67b9ddd..249502d3e9d290889a4434be1114fbcc31eb704b 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h @@ -22,8 +22,8 @@ #include <queue> #include <ostream> -//using pHypoJet = std::shared_ptr<const HypoJet::IJet>; -using pHypoJet = const HypoJet::IJet*; +using pHypoJet = std::shared_ptr<const HypoJet::IJet>; +//using pHypoJet = const HypoJet::IJet*; using HypoJetVector = std::vector<pHypoJet>; using HypoJetIter = HypoJetVector::iterator; using HypoJetCIter = HypoJetVector::const_iterator; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h index 03859c040bb91c7cca8f6c106076f4b4792ac5cf..fa27d22a5017b69741df29cb62a0d2a5f1e7f8d4 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/ICleaner.h @@ -23,7 +23,7 @@ class ICleaner{ public: // Abstract interface used by a factory function virtual ~ICleaner(){} - virtual bool operator()(const pHypoJet&) const = 0; + virtual bool operator()(const HypoJet::IJet&) const = 0; virtual std::string toString() const noexcept = 0; virtual std::string getName() const noexcept= 0; }; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/LlpCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/LlpCleaner.h index 68ea64eb2b441128ec86e12276454f31457831b7..a562cda15d204ca83a9762d215ecbc0a83386ef4 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/LlpCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/LlpCleaner.h @@ -30,7 +30,7 @@ class LlpCleaner: public ICleaner{ ~LlpCleaner() {} - bool operator()(const pHypoJet& jet) const override; + bool operator()(const HypoJet::IJet& jet) const override; std::string toString() const noexcept override; std::string getName() const noexcept override; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/LooseCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/LooseCleaner.h index 783102c5f59da5efa754e092dec0dc2236b383d8..33d3420406c049b6d133b8b2717023eb4fd4983a 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/LooseCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/LooseCleaner.h @@ -30,7 +30,7 @@ class LooseCleaner: public ICleaner{ ~LooseCleaner() {} - bool operator()(const pHypoJet& jet) const override; + bool operator()(const HypoJet::IJet& jet) const override; std::string toString() const noexcept override; std::string getName() const noexcept override; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/NullCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/NullCleaner.h index 9d1aa77f8bb8640ace5fa81595579663b701bb62..1fbb1ad8f2759e52c01ab5d562a65199c85c9187 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/NullCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/NullCleaner.h @@ -29,7 +29,7 @@ class NullCleaner: public ICleaner{ public: ~NullCleaner(){} - bool operator()(const pHypoJet&) const override; + bool operator()(const HypoJet::IJet&) const override; std::string toString() const noexcept override; std::string getName() const noexcept override; }; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/TightCleaner.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/TightCleaner.h index dd7f06bc5993a834f3702aabf39d9ef42f4f4aaf..f4df147ffb88c9bb730e27986041013d090f91fe 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/TightCleaner.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/TrigHLTJetHypo/TrigHLTJetHypoUtils/TightCleaner.h @@ -30,7 +30,7 @@ class TightCleaner: public ICleaner{ ~TightCleaner() {} - bool operator()(const pHypoJet& jet) const override; + bool operator()(const HypoJet::IJet& jet) const override; std::string toString() const noexcept override; std::string getName() const noexcept override; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.cxx index 073719bbe194f33b3c82403fa2c7f62bca97ab03..99330271f40f08a325eb8b67dd626629717d9864 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.cxx @@ -28,8 +28,8 @@ AcceptAllConditionMT::isSatisfied(const HypoJetVector& ips, std::stringstream ss1; - for(auto ip : ips){ - address = static_cast<const void*>(ip); + for(const auto& ip : ips){ + address = static_cast<const void*>(ip.get()); ss1 << " " << address << " " << ip->eta() << " e " << ip->e() << '\n'; } ss1 << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.cxx index af5cb4b646a4f3478c97f24924c007db0e1e4dc4..e8d90d442117937d17ddaac319f10ab7e30d0079 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.cxx @@ -42,7 +42,7 @@ bool CompoundConditionMT::isSatisfied(const HypoJetVector& ips, << " pass: " << std::boolalpha << pass << '\n'; for(const auto& ip : ips){ - auto j_addr = static_cast<const void*>(ip); + auto j_addr = static_cast<const void*>(ip.get()); std::stringstream ss1; ss1 << " jet : ("<< j_addr << ")\n"; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx index ab69025c4b9d87927bce4e76229303a1de89125e..676eb38b2e80097515c0c032aff79a77ad68ea43 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx @@ -68,8 +68,8 @@ DijetConditionMT::isSatisfied(const HypoJetVector& ips, std::stringstream ss1; - for(auto ip : ips){ - address = static_cast<const void*>(ip); + for(const auto& ip : ips){ + address = static_cast<const void*>(ip.get()); ss1 << " " << address << " " << ip->eta() << " e " << ip->e() << '\n'; } ss1 << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.cxx index c100fec837cc36fa799315cb0f5dc15ad804f0de..c7c0027bbd4fb270b69263279e497a76dfdf55d8 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.cxx @@ -48,8 +48,8 @@ DijetDEtaConditionMT::isSatisfied(const HypoJetVector& ips, std::stringstream ss1; - for(auto ip : ips){ - address = static_cast<const void*>(ip); + for(const auto& ip : ips){ + address = static_cast<const void*>(ip.get()); ss1 << " " << address << " " << ip->eta() << " e " << ip->e() << '\n'; } ss1 << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.cxx index 567bcaa29aa53960849caf7944f4f3fd6424ea6c..8d20b49abd1e38b6c6985fb1fa1364f16297185d 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.cxx @@ -49,8 +49,8 @@ DijetDPhiConditionMT::isSatisfied(const HypoJetVector& ips, std::stringstream ss1; - for(auto ip : ips){ - address = static_cast<const void*>(ip); + for(const auto& ip : ips){ + address = static_cast<const void*>(ip.get()); ss1 << " " << address << " " << ip->eta() << " e " << ip->e() << '\n'; } ss1 << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.cxx index 37a455694117833ff23b3d837076c1499fe37a2b..e368c5fd561f6c02dfffdb24d67349ffc9bf1bbf 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.cxx @@ -49,8 +49,8 @@ DijetMassConditionMT::isSatisfied(const HypoJetVector& ips, std::stringstream ss1; - for(auto ip : ips){ - address = static_cast<const void*>(ip); + for(const auto& ip : ips){ + address = static_cast<const void*>(ip.get()); ss1 << " " << address << " " << ip->eta() << " e " << ip->e() << '\n'; } ss1 << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.cxx index 4c6560f02fa158d3f45ab7318a7f27f913edbfc5..a3e27ceddbc46bd10295db53abcd1da133b4f427 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.cxx @@ -29,7 +29,7 @@ bool EtConditionMT::isSatisfied(const pHypoJet& ip, << " et thresh " << m_min << " pass: " << std::boolalpha << pass << '\n'; - auto j_addr = static_cast<const void*>(ip); + auto j_addr = static_cast<const void*>(ip.get()); std::stringstream ss1; ss1 << " jet : ("<< j_addr << ")" " et " << et << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.cxx index db606451a340dc218feca61f6fbddc93f0a4deb7..273bd2eff7ee18f43f75d3ade3fb7ac49d96927c 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.cxx @@ -31,7 +31,7 @@ EtaConditionAbsMT::isSatisfied(const pHypoJet& ip, << " eta[" << m_min << ", " << m_max << "]" << " pass: " << std::boolalpha << pass << '\n'; - auto j_addr = static_cast<const void*>(ip); + auto j_addr = static_cast<const void*>(ip.get()); std::stringstream ss1; ss1 << " jet : ("<< j_addr << ") abseta " << abseta << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.cxx index 9bf9e30a203fb693355337ed6e7f38b301aaf6fa..d26c5820d2b17acb263a9a990e36b1fe1bf77cca 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.cxx @@ -30,7 +30,7 @@ bool EtaConditionSignedMT::isSatisfied(const pHypoJet& ip, << " eta[" << m_min << ", " << m_max << "]" << " pass: " << std::boolalpha << pass << '\n'; - auto j_addr = static_cast<const void*>(ip); + auto j_addr = static_cast<const void*>(ip.get()); std::stringstream ss1; ss1 << " jet : ("<< j_addr << ") signed eta " << eta << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx index bee5de795ed2b0df13d07fa4f4999d502340fcdb..b64816f56ccb5277a9b6066d4b34bd1e7df304ce 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx @@ -39,7 +39,7 @@ EtaEtAsymmetricConditionMT::isSatisfied(const pHypoJet& ip, std::stringstream ss1; - auto j_addr = static_cast<const void*>(ip); + auto j_addr = static_cast<const void*>(ip.get()); ss1 << " jet: (" << j_addr << ")" << " eta " << eta << " et " << et << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx index 3522bc51cd86f7bcf92061615352eb00f6746c48..2b53c70f5ff632bc7904b58d2f0ef03410d2aec0 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx @@ -37,7 +37,7 @@ bool EtaEtConditionMT::isSatisfied(const pHypoJet& ip, << " et thresh " << m_threshold << " pass: " << std::boolalpha << pass << '\n'; - auto j_addr = static_cast<const void*>(ip); + auto j_addr = static_cast<const void*>(ip.get()); std::stringstream ss1; ss1 << " jet : ("<< j_addr << ")" " abseta " << abseta << " et " << et << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx index 870b26b0f427567b9477b18a5c4e6f9310e3ac87..3a56736c333e8929a90b83472101f3b33b87e15b 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx @@ -435,7 +435,7 @@ std::string FastReducer::dataStructuresToStr() const { for(const auto& pair : m_indJetGroup){ ss << pair.first << " ["; for(const auto& j : pair.second){ - ss << static_cast<const void*>(j) << " "; + ss << static_cast<const void*>(j.get()) << " "; } ss << "]\n"; } @@ -492,7 +492,7 @@ void FastReducer::recordJetGroup(std::size_t ind, std::stringstream ss1; for(auto ip : jg){ - const void* address = static_cast<const void*>(ip); + const void* address = static_cast<const void*>(ip.get()); ss1 << "\n " << address << " eta " << ip->eta() << " e " << ip->e() << " et " << ip->et(); diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx index 2f92a1fd0fe46d2f4c386f1e7476d19b338b8450..0a9cad16e74c79f40f1a691660df3e07162df3d4 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx @@ -4,7 +4,7 @@ #include "./HTConditionMT.h" #include "./ITrigJetHypoInfoCollector.h" -#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h" +#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h" #include <sstream> #include <cmath> @@ -39,7 +39,7 @@ HTConditionMT::isSatisfied(const HypoJetVector& ips, return std::accumulate(ips_c.begin(), iter, 0.0, - [](double sum, const HypoJet::IJet* jp){ + [](double sum, const pHypoJet& jp){ return sum + jp->et();}) > m_htMin; } else { if(infoCollector) { @@ -49,7 +49,7 @@ HTConditionMT::isSatisfied(const HypoJetVector& ips, return std::accumulate(ips.begin(), ips.end(), 0.0, - [](double sum, const HypoJet::IJet* jp){ + [](double sum, const pHypoJet& jp){ return sum + jp->et();}) > m_htMin; } } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.cxx index 4c1d1478f2aea62af3b169d841d35b3fead3990f..d6acdda7213d858ccb855a5ff37e8163487a6b62 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.cxx @@ -58,8 +58,8 @@ bool JVTConditionMT::isSatisfied(const HypoJetVector& ips, const std::unique_ptr std::stringstream ss1; - for(auto ip : ips){ - address = static_cast<const void*>(ip); + for(const auto& ip : ips){ + address = static_cast<const void*>(ip.get()); ss1 << " " << address << " " << ip->eta() << " pt " << ip->pt() << '\n'; } ss1 << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.cxx index ea09ac6a94068b23adf11cfa5d802cb776dc9244..effde3e73e02cb004ca1cb4758f6d69a44dcfc04 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.cxx @@ -25,7 +25,7 @@ bool MomentConditionMT::isSatisfied(const pHypoJet& ip, if (!(ip -> getAttribute(m_moment, momentValue))){ if(collector){ - auto j_addr = static_cast<const void*>(ip); + auto j_addr = static_cast<const void*>(ip.get()); std::stringstream ss0; ss0 << "MomentCondition: " @@ -50,7 +50,7 @@ bool MomentConditionMT::isSatisfied(const pHypoJet& ip, << " moment " << m_moment << " pass: " << std::boolalpha << pass << '\n'; - auto j_addr = static_cast<const void*>(ip); + auto j_addr = static_cast<const void*>(ip.get()); std::stringstream ss1; ss1 << " jet : ("<< j_addr << ") " "moment " << m_moment << " value: " << momentValue<< '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.cxx index 11302690ace4d2dcf32c3b73510ff7dcdb02dc35..601f4524fcac7a907ceb62f15c9d6f31d8f28946 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.cxx @@ -51,8 +51,8 @@ QjetMassConditionMT::isSatisfied(const HypoJetVector& ips, std::stringstream ss1; - for(auto ip : ips){ - address = static_cast<const void*>(ip); + for(const auto& ip : ips){ + address = static_cast<const void*>(ip.get()); ss1 << " " << address << " eta " << ip->eta() << " e " << ip->e() << " et: " << ip->et() << '\n'; } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.cxx index 02b601e0bb45634df4f03093db295e63f3796856..6695cf6e2b0cf0c857ab362ba93229729af5332b 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.cxx @@ -31,7 +31,7 @@ SMCConditionMT::isSatisfied(const pHypoJet& ip, << " mass[" << m_min << ", " << m_max << "]" << " pass: " << std::boolalpha << pass << '\n'; - auto j_addr = static_cast<const void*>(ip); + auto j_addr = static_cast<const void*>(ip.get()); std::stringstream ss1; ss1 << " jet : ("<< j_addr << ") jet mass " << mass << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypo2.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypo2.cxx index 0dfa822f868603b97f3a843c22247f1d0eb7b156..9421828473ca56a969de02b3950ade1af03bb721 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypo2.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypo2.cxx @@ -260,7 +260,7 @@ class xAODJetAsIJetFactory{ public: xAODJetAsIJetFactory(): m_ind(-1){} pHypoJet operator() (const xAOD::Jet* j){ - return new HypoJet::xAODJetAsIJet(j, ++m_ind);} + return pHypoJet(new HypoJet::xAODJetAsIJet(j, ++m_ind));} private: unsigned int m_ind; }; @@ -324,9 +324,6 @@ HLT::ErrorCode TrigHLTJetHypo2::hltExecute(const HLT::TriggerElement* outputTE, ATH_MSG_ERROR("Trig bits storage failed"); return status;} - // delete the xAOD::Jet wrappers - for(auto i : hypoJets){delete i;} - return HLT::OK; } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoBase.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoBase.cxx index 90966c1bec3f3691c1ffd67e40306d69c121017b..b9fa0f08c8b99c7e9a6bb031a56d0ab172cd489a 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoBase.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoBase.cxx @@ -188,7 +188,7 @@ class xAODJetAsIJetFactory{ public: xAODJetAsIJetFactory(): m_ind(-1){} pHypoJet operator() (const xAOD::Jet* j){ - return new HypoJet::xAODJetAsIJet(j, ++m_ind);} + return pHypoJet(new HypoJet::xAODJetAsIJet(j, ++m_ind));} private: unsigned int m_ind; }; @@ -252,9 +252,6 @@ HLT::ErrorCode TrigHLTJetHypoBase::hltExecute(const HLT::TriggerElement* outputT ATH_MSG_ERROR("Trig bits storage failed"); return status;} - // delete the xAOD::Jet wrappers - for(auto i : hypoJets){delete i;} - return HLT::OK; } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiBasicCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiBasicCleaner.cxx index b92096fdf7a32b4051587e8aec20ab6668588be7..1b3734e9280f9b408ab73590f92a13d3c41e6038 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiBasicCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiBasicCleaner.cxx @@ -20,7 +20,7 @@ AntiBasicCleaner::AntiBasicCleaner(float n90Threshold, float negativeEThreshold): BasicCleaner(n90Threshold, presamplerThreshold, negativeEThreshold){} -bool AntiBasicCleaner::operator()(const pHypoJet& jet) const{ +bool AntiBasicCleaner::operator()(const HypoJet::IJet& jet) const{ return !BasicCleaner::operator()(jet); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiLlpCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiLlpCleaner.cxx index b03fd88df6ac92abde427310c5a1e104f3438905..95f94e77abbf8e15ded8b371601acbfbcfe08647 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiLlpCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiLlpCleaner.cxx @@ -27,7 +27,7 @@ AntiLlpCleaner::AntiLlpCleaner(float fSampMaxLlpThreshold, hecqLlpThreshold, avLarQFLlpThreshold){} -bool AntiLlpCleaner::operator()(const pHypoJet& jet) const{ +bool AntiLlpCleaner::operator()(const HypoJet::IJet& jet) const{ return !LlpCleaner::operator()(jet); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiLooseCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiLooseCleaner.cxx index 3dbdc9e3bd55ca259730718e678af8840b49c748..e0749e58cab5481783a53f66e59306cf3c6af65e 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiLooseCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiLooseCleaner.cxx @@ -26,7 +26,7 @@ AntiLooseCleaner::AntiLooseCleaner(float fSampMaxLooseThreshold, emfHighLooseThreshold, hecfLooseThreshold){} -bool AntiLooseCleaner::operator()(const pHypoJet& jet) const{ +bool AntiLooseCleaner::operator()(const HypoJet::IJet& jet) const{ return !LooseCleaner::operator()(jet); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiTightCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiTightCleaner.cxx index f067c5f627bde096fdff76a09ba10a6433b83d7a..e6632ff05e296fb679f4ee69ee04cf9fdf256893 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiTightCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/AntiTightCleaner.cxx @@ -26,7 +26,7 @@ AntiTightCleaner::AntiTightCleaner(float fSampMaxTightThreshold, emfHighTightThreshold, hecfTightThreshold){} -bool AntiTightCleaner::operator()(const pHypoJet& jet) const{ +bool AntiTightCleaner::operator()(const HypoJet::IJet& jet) const{ return TightCleaner::operator()(jet); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/BasicCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/BasicCleaner.cxx index 19760a297a8eb16c7723ddcc659680cd5ea5ffa1..523bb5fe02cb8716826f136cf292d4888db4aedc 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/BasicCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/BasicCleaner.cxx @@ -26,13 +26,13 @@ BasicCleaner::BasicCleaner(float n90Threshold, m_negativeEThreshold(negativeEThreshold){ } -bool BasicCleaner::operator()(const pHypoJet& jet) const { +bool BasicCleaner::operator()(const HypoJet::IJet& jet) const { /* make cuts on jet attributes to select clean jets */ bool isClean{true}; float n90jet; - if (jet -> getAttribute("N90Constituents", n90jet)){ + if (jet.getAttribute("N90Constituents", n90jet)){ //std::cout << "TrigHLTJetHypoHelpers: N90Constituents = " << n90jet << '\n'; if(n90jet < m_n90Threshold){isClean = false;} } else { @@ -43,7 +43,7 @@ bool BasicCleaner::operator()(const pHypoJet& jet) const { //example of code to compute presamplerFraction /* std::vector<float> vecvalue; - if (jet->getAttribute(xAOD::JetAttribute::EnergyPerSampling, vecvalue)) { + if (jet.getAttribute(xAOD::JetAttribute::EnergyPerSampling, vecvalue)) { int vecsize = vecvalue.size(); std::cout << "TrigHLTJetHypoHelpers: Got EnergyPerSampling vector, size: " << vecsize << '\n'; if (vecsize != 0) { @@ -60,7 +60,7 @@ bool BasicCleaner::operator()(const pHypoJet& jet) const { //see Reconstruction/Jet/JetUtils/Root/JetCaloQualityUtils.cxx double presamplerE = vecvalue[CaloSampling::PreSamplerB] + vecvalue[CaloSampling::PreSamplerE]; std::cout << "TrigHLTJetHypoHelpers: presamplerE = " << presamplerE << '\n'; - double jetE = jet->jetP4(xAOD::JetEMScaleMomentum).E(); + double jetE = jet.jetP4(xAOD::JetEMScaleMomentum).E(); std::cout << "TrigHLTJetHypoHelpers: jetE = " << jetE << '\n'; double presamplerF = 0; if(jetE!=0) presamplerF = presamplerE/jetE; @@ -74,7 +74,7 @@ bool BasicCleaner::operator()(const pHypoJet& jet) const { //use of presamplerFraction needs further study, for now not used /* float presamplerfractionjet; - if(jet -> getAttribute<float>("presamplerFraction", presamplerfractionjet)){ + if(jet.getAttribute<float>("presamplerFraction", presamplerfractionjet)){ if(presamplerfractionjet > m_presamplerThreshold) {isClean = false;} } else { throw UncleanableJet("Cleaner Cannot retrieve presamplerFraction"); @@ -82,7 +82,7 @@ bool BasicCleaner::operator()(const pHypoJet& jet) const { */ float negEjet; - if(jet -> getAttribute("NegativeE", negEjet)){ + if(jet.getAttribute("NegativeE", negEjet)){ //std::cout << "TrigHLTJetHypoHelpers: NegativeE = " << negEjet << '\n'; if(negEjet < m_negativeEThreshold){isClean = false;} } else { diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/EtaEtCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/EtaEtCleaner.cxx index d9e386715b234342361a605280bb8335130dd0fe..9de5db74fa4621cf3b6f39c37b3c213528e8ee5e 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/EtaEtCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/EtaEtCleaner.cxx @@ -26,9 +26,9 @@ EtaEtCleaner::EtaEtCleaner(double etaMin, m_etaMin(etaMin), m_etaMax(etaMax), m_etMin(etMin), m_etMax(etMax){ } -bool EtaEtCleaner::operator()(const pHypoJet& jet) const{ - auto eta = std::abs(jet->eta()); - auto et = jet->et(); +bool EtaEtCleaner::operator()(const HypoJet::IJet& jet) const{ + auto eta = std::abs(jet.eta()); + auto et = jet.et(); return eta >= m_etaMin and eta < m_etaMax and et >= m_etMin and et < m_etMax; } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/HTCondition.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/HTCondition.cxx index 13198fd6a8c2d2e70e70478b0d82390fc21f4620..c296c950bfcb10f844fab2e906ec8ba9db7514b7 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/HTCondition.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/HTCondition.cxx @@ -3,7 +3,7 @@ */ #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HTCondition.h" -#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h" +#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h" #include <sstream> #include <cmath> @@ -19,7 +19,7 @@ HTCondition::isSatisfied(const HypoJetVector& ips) const { return std::accumulate(ips.begin(), ips.end(), 0.0, - [](double sum, const HypoJet::IJet* jp){ + [](double sum, const pHypoJet& jp){ return sum + jp->et();}) > m_htMin; } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/HypoJetDefs.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/HypoJetDefs.cxx index e6b77cec17cad8e1ffa6b88c8b3dc919db52f7e0..e29de4a36ddad603c6d38637a144b1c63196a913 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/HypoJetDefs.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/HypoJetDefs.cxx @@ -9,7 +9,7 @@ std::ostream& operator << (std::ostream& out, const HypoJetVector& hjv) { auto hjv_addr = static_cast<const void*>(&hjv); out << "HypoJetVector (" << hjv_addr << ")\n"; for(const auto& j : hjv) { - out << static_cast<const void*>(j) + out << static_cast<const void*>(j.get()) << " e " << j->e() << " et " << j->et() << " eta " << j->eta() << '\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/LlpCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/LlpCleaner.cxx index eaf664a50aeab6f9e4ec66a70b0303a3791e3283..6c7ab3444cbdb41b9e56763bb896bbcdd6db81d7 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/LlpCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/LlpCleaner.cxx @@ -30,15 +30,15 @@ LlpCleaner::LlpCleaner(float fSampMaxLlpThreshold, m_avLarQFLlpThreshold(avLarQFLlpThreshold){ } -bool LlpCleaner::operator()(const pHypoJet& jet) const { +bool LlpCleaner::operator()(const HypoJet::IJet& jet) const { /* make cuts on jet attributes to select jets from long-lived particles */ bool isClean{true}; float fsmJet; float neJet; - if(jet -> getAttribute("FracSamplingMax", fsmJet)){ - if(jet -> getAttribute("NegativeE", neJet)){ + if(jet.getAttribute("FracSamplingMax", fsmJet)){ + if(jet.getAttribute("NegativeE", neJet)){ if(fsmJet > m_fSampMaxLlpThreshold && std::abs(neJet) > m_negELlpThreshold){isClean = false;} } else { @@ -52,9 +52,9 @@ bool LlpCleaner::operator()(const pHypoJet& jet) const { float hecfJet; float hecqJet; float alqfJet; - if(jet -> getAttribute("HECFrac", hecfJet)){ - if(jet -> getAttribute("HECQuality", hecqJet)){ - if(jet -> getAttribute("AverageLArQF", alqfJet)){ + if(jet.getAttribute("HECFrac", hecfJet)){ + if(jet.getAttribute("HECQuality", hecqJet)){ + if(jet.getAttribute("AverageLArQF", alqfJet)){ if(hecfJet > m_hecfLlpThreshold && std::abs(hecqJet) > m_hecqLlpThreshold && alqfJet > m_avLarQFLlpThreshold){isClean = false;} } else { diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/LooseCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/LooseCleaner.cxx index 1ff40dc12d9c0dcaf7c95cc3712d4ccc0d9f09c0..e87eee79344c098aab31c29a121f5163a542810a 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/LooseCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/LooseCleaner.cxx @@ -30,27 +30,27 @@ LooseCleaner::LooseCleaner(float fSampMaxLooseThreshold, m_hecfLooseThreshold(hecfLooseThreshold){ } -bool LooseCleaner::operator()(const pHypoJet& jet) const { +bool LooseCleaner::operator()(const HypoJet::IJet& jet) const { /* make cuts on jet attributes to select clean jets */ bool isClean{true}; float fsmJet; - if(jet -> getAttribute("FracSamplingMax", fsmJet)){ - if(fsmJet > m_fSampMaxLooseThreshold && std::abs(jet->eta()) < m_etaLooseThreshold){isClean = false;} + if(jet.getAttribute("FracSamplingMax", fsmJet)){ + if(fsmJet > m_fSampMaxLooseThreshold && std::abs(jet.eta()) < m_etaLooseThreshold){isClean = false;} } else { throw UncleanableJet("Cleaner Cannot retrieve FracSamplingMax"); } float emfJet; - if(jet -> getAttribute("EMFrac", emfJet)){ + if(jet.getAttribute("EMFrac", emfJet)){ if(emfJet < m_emfLowLooseThreshold || emfJet > m_emfHighLooseThreshold){isClean = false;} } else { throw UncleanableJet("Cleaner Cannot retrieve EMFrac"); } float hecfJet; - if(jet -> getAttribute("HECFrac", hecfJet)){ + if(jet.getAttribute("HECFrac", hecfJet)){ if(hecfJet > m_hecfLooseThreshold){isClean = false;} } else { throw UncleanableJet("Cleaner Cannot retrieve HECFrac"); diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/NullCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/NullCleaner.cxx index b2375d7d84089940016710caaacd289f08506ae6..f8bab410566444b5f8b6d4623d845853809072ad 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/NullCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/NullCleaner.cxx @@ -15,7 +15,7 @@ #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/NullCleaner.h" #include <sstream> -bool NullCleaner::operator()(const pHypoJet&) const {return true;} +bool NullCleaner::operator()(const HypoJet::IJet&) const {return true;} std::string NullCleaner::toString() const noexcept { std::stringstream ss; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/TightCleaner.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/TightCleaner.cxx index 4de1ff73dd1c618b9b2c4e5da8ab372f399b66d7..fc3786f3c4f7a7739bc94f8d430e4cc788dec398 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/TightCleaner.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigHLTJetHypoUtils/TightCleaner.cxx @@ -29,27 +29,27 @@ TightCleaner::TightCleaner(float fSampMaxTightThreshold, m_hecfTightThreshold(hecfTightThreshold){ } -bool TightCleaner::operator()(const pHypoJet& jet) const { +bool TightCleaner::operator()(const HypoJet::IJet& jet) const { /* make cuts on jet attributes to select clean jets */ bool isClean{true}; float fsmJet; - if(jet -> getAttribute("FracSamplingMax", fsmJet)){ - if(fsmJet > m_fSampMaxTightThreshold && std::abs(jet->eta()) < m_etaTightThreshold){isClean = false;} + if(jet.getAttribute("FracSamplingMax", fsmJet)){ + if(fsmJet > m_fSampMaxTightThreshold && std::abs(jet.eta()) < m_etaTightThreshold){isClean = false;} } else { throw UncleanableJet("Cleaner Cannot retrieve FracSamplingMax"); } float emfJet; - if(jet -> getAttribute("EMFrac", emfJet)){ + if(jet.getAttribute("EMFrac", emfJet)){ if(emfJet < m_emfLowTightThreshold || emfJet > m_emfHighTightThreshold){isClean = false;} } else { throw UncleanableJet("Cleaner Cannot retrieve EMFrac"); } float hecfJet; - if(jet -> getAttribute("HECFrac", hecfJet)){ + if(jet.getAttribute("HECFrac", hecfJet)){ if(hecfJet > m_hecfTightThreshold){isClean = false;} } else { throw UncleanableJet("Cleaner Cannot retrieve HECFrac"); diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/xAODJetAsIJetFactory.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/xAODJetAsIJetFactory.cxx index ab7261bdc2a1c00bbfb7b2dc96baca1f7023b027..dca0a3945709a2df5f88a7eb34cf3022d61e9f1a 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/xAODJetAsIJetFactory.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/xAODJetAsIJetFactory.cxx @@ -6,6 +6,6 @@ xAODJetAsIJetFactory::xAODJetAsIJetFactory(): m_ind(-1){} pHypoJet xAODJetAsIJetFactory::operator() (const xAOD::Jet* j){ - return new HypoJet::xAODJetAsIJet(j, ++m_ind); + return pHypoJet(new HypoJet::xAODJetAsIJet(j, ++m_ind)); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/xAODJetCollector.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/xAODJetCollector.h index 5c2290e3a3a0c2b727b486e1afbdf8758d186d7f..f6c6cdb026fee9071eea39ae34d1eeab66dc3699 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/xAODJetCollector.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/xAODJetCollector.h @@ -6,7 +6,6 @@ #define TRIGLHLTJETHYPO_XAODJETCOLLECTOR_H #include "xAODJet/Jet.h" -#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h" #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h" #include <vector> @@ -16,9 +15,6 @@ // xAODJetCollector - an object send to a (possibly recursive) // TrigJetHypoToolHelpers to obtain xAOD jets -namespace HypoJet{ - class IJet; -} class xAODJetCollector { @@ -35,7 +31,7 @@ public: auto new_end = std::partition(hypoJets.begin(), hypoJets.end(), - [](const HypoJet::IJet* j){ + [](const pHypoJet& j){ return (j->xAODJet()).has_value();}); // add xAOD::Jet* to m_jets std::vector<const xAOD::Jet*> xJets; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/JetHypoExerciserCompareAlg.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/JetHypoExerciserCompareAlg.cxx index 9fb795a5eb334e1b69be9e260964cc06b3ed7c47..dfe58d2cea8d15b54392bb2adba388f10cc0885f 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/JetHypoExerciserCompareAlg.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/JetHypoExerciserCompareAlg.cxx @@ -212,8 +212,8 @@ StatusCode JetHypoExerciserCompareAlg::execute() { bool jagree{true}; for (std::size_t i = 0; i < njets; i++) { - ATH_MSG_INFO(" jet 0 : " << static_cast<const void*>(collected0.at(i)) << - " jet 1 : " << static_cast<const void*>(collected1.at(i))); + ATH_MSG_INFO(" jet 0 : " << static_cast<const void*>(collected0.at(i).get()) << + " jet 1 : " << static_cast<const void*>(collected1.at(i).get())); if (collected0.at(i) != collected1.at(i)) { ATH_MSG_INFO(" jets above differ "); @@ -234,7 +234,6 @@ StatusCode JetHypoExerciserCompareAlg::execute() { } - for (auto p : jv) {delete p;} return StatusCode::SUCCESS; } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/RandomSignalEventGenerator.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/RandomSignalEventGenerator.cxx index 33decdcd1a1c45bb29d7cd10696bae0caaef0859..345882842a0be206abe9cfd1d7cd019f4ca00b9c 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/RandomSignalEventGenerator.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/RandomSignalEventGenerator.cxx @@ -80,7 +80,7 @@ RandomSignalHypoJetVectorGenerator::get() { if(m_flip()){ tlv.SetZ(-tlv.Z()); // randomly flip the sign of the +vly generated tlv. } - result.push_back(new TLorentzVectorAsIJet(tlv)); + result.push_back(std::shared_ptr<const HypoJet::IJet>(new TLorentzVectorAsIJet(tlv))); } if(m_nbkgd){ @@ -92,7 +92,7 @@ RandomSignalHypoJetVectorGenerator::get() { if(m_flip()){ tlv.SetZ(-tlv.Z()); // randomly flip the sign of the +vly generated tlv. } - result.push_back(new TLorentzVectorAsIJet(tlv)); + result.push_back(std::shared_ptr<const HypoJet::IJet>(new TLorentzVectorAsIJet(tlv))); } } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/SimpleHypoJetVectorGenerator.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/SimpleHypoJetVectorGenerator.cxx index 890b2c2ad3ab124695f66d829014265dcd983243..4668443f0f0a3517e3ed91f6d5cb9e97f781109f 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/SimpleHypoJetVectorGenerator.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/exerciser/SimpleHypoJetVectorGenerator.cxx @@ -63,7 +63,7 @@ SimpleHypoJetVectorGenerator::get() { const auto& eta = m_etas[i]; const auto& et = m_es[i]; auto tlv = factory->make(eta, et); - result.push_back(new TLorentzVectorAsIJet(tlv)); + result.push_back(std::shared_ptr<const HypoJet::IJet>(new TLorentzVectorAsIJet(tlv))); } if(m_nbkgd){ @@ -81,7 +81,7 @@ SimpleHypoJetVectorGenerator::get() { const auto& en = en_distribution(generator); // depending on the factory, en is e or et auto tlv = factory->make(eta, en); - result.push_back(new TLorentzVectorAsIJet(tlv)); + result.push_back(std::shared_ptr<const HypoJet::IJet>(new TLorentzVectorAsIJet(tlv))); } } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/SpecifiedJetsCondition.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/SpecifiedJetsCondition.cxx index 719ae1b186fbb9ec7753ce77b7aefbf9e65584ad..b98f837f6dec2949b8a066a0445c5cc63bc87447 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/SpecifiedJetsCondition.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/SpecifiedJetsCondition.cxx @@ -49,7 +49,7 @@ std::string SpecifiedJetsCondition::toString() const noexcept { ss << "group " << count << '\n'; ++count; for(const auto& j : jg){ - auto j_addr = static_cast<const void*>(j); + auto j_addr = static_cast<const void*>(j.get()); ss << j_addr << " "; } } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/Timer.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/Timer.cxx index 48f13f9ebfa84f039cd52b33e40a369c66289737..156bd2f77e822609ca7bb264d72bbeccb9218533 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/Timer.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/Timer.cxx @@ -35,13 +35,13 @@ class Timer{ void timeit(){ HypoJetVector jets; - TLorentzVectorAsIJet j0 (m_tl0); - TLorentzVectorAsIJet j1 (m_tl1); + auto j0 = std::make_shared<TLorentzVectorAsIJet>(m_tl0); + auto j1 =std::make_shared<TLorentzVectorAsIJet>(m_tl1); HypoJetVector jets0; - jets0.push_back(&j0); + jets0.push_back(j0); HypoJetVector jets1; - jets1.push_back(&j1); + jets1.push_back(j1); HypoJetGroupVector jetGroups{jets0, jets1}; std::vector<double> etaMins{-1., -1., -1.}; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/makeHypoJets.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/makeHypoJets.cxx index 4fdfae1690fd87c07be55e55f25f356fae3ee60f..f9ffaf623a02440772d470ccd9f3529c5af2084d 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/makeHypoJets.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/src/makeHypoJets.cxx @@ -15,7 +15,7 @@ HypoJetVector makeHypoJets(const std::vector<double>& etas){ TLorentzVectorFactory factory; auto make_jet = [&factory](double eta){ - return new TLorentzVectorAsIJet(factory.make(eta, 10.)); + return std::shared_ptr<const HypoJet::IJet>(new TLorentzVectorAsIJet(factory.make(eta, 10.))); }; std::transform(etas.begin(), diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/DijetDEtaMassConditionTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/DijetDEtaMassConditionTest.cxx index 04af84e359fdb2fd987f4d450d75e988156f9ba4..a3f27d25e6bb06c6f234e9ddffa69f4f7516693c 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/DijetDEtaMassConditionTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/DijetDEtaMassConditionTest.cxx @@ -80,16 +80,16 @@ TEST_F(DijetDEtaMassConditionTest, artefacts){ TEST_F(DijetDEtaMassConditionTest, accepts) { - MockJetWithLorentzVector jet0{m_tl0}; - MockJetWithLorentzVector jet1{m_tl1}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + auto jet1 = std::make_shared<MockJetWithLorentzVector>(m_tl1); - EXPECT_CALL(jet0, et()); - EXPECT_CALL(jet0, eta()); + EXPECT_CALL(*jet0, et()); + EXPECT_CALL(*jet0, eta()); - EXPECT_CALL(jet1, et()); - EXPECT_CALL(jet1, eta()); + EXPECT_CALL(*jet1, et()); + EXPECT_CALL(*jet1, eta()); - HypoJetVector jets{&jet0, &jet1}; + HypoJetVector jets{jet0, jet1}; DijetDEtaMassCondition condition({0.5-0.001, 0.5-0.001}, {0.5 + 0.001, 0.5 + 0.001}, @@ -105,16 +105,16 @@ TEST_F(DijetDEtaMassConditionTest, accepts) { TEST_F(DijetDEtaMassConditionTest, belowAbsEtaMinCut) { - MockJetWithLorentzVector jet0{m_tl0}; - MockJetWithLorentzVector jet1{m_tl1}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + auto jet1 = std::make_shared<MockJetWithLorentzVector>(m_tl1); - HypoJetVector jets{&jet0, &jet1}; + HypoJetVector jets{jet0, jet1}; - EXPECT_CALL(jet0, et()).Times(AnyNumber()); - EXPECT_CALL(jet0, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet0, et()).Times(AnyNumber()); + EXPECT_CALL(*jet0, eta()).Times(AnyNumber()); - EXPECT_CALL(jet1, et()).Times(AnyNumber()); - EXPECT_CALL(jet1, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet1, et()).Times(AnyNumber()); + EXPECT_CALL(*jet1, eta()).Times(AnyNumber()); DijetDEtaMassCondition condition({0.5+0.001, 0.5+0.001}, {0.5 + 0.002, 0.5 + 0.002}, @@ -139,17 +139,16 @@ TEST_F(DijetDEtaMassConditionTest, aboveAbsEtaMaxCut) { {104.2 -0.1}, {104.2 + 0.1}); - MockJetWithLorentzVector jet0{m_tl0}; - MockJetWithLorentzVector jet1{m_tl1}; - + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + auto jet1 = std::make_shared<MockJetWithLorentzVector>(m_tl1); - EXPECT_CALL(jet0, et()).Times(AnyNumber()); - EXPECT_CALL(jet0, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet0, et()).Times(AnyNumber()); + EXPECT_CALL(*jet0, eta()).Times(AnyNumber()); - EXPECT_CALL(jet1, et()).Times(AnyNumber()); - EXPECT_CALL(jet1, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet1, et()).Times(AnyNumber()); + EXPECT_CALL(*jet1, eta()).Times(AnyNumber()); - HypoJetVector jets{&jet0, &jet1}; + HypoJetVector jets{jet0, jet1}; EXPECT_FALSE(condition.isSatisfied(jets)); } @@ -165,17 +164,16 @@ TEST_F(DijetDEtaMassConditionTest, belowYStarCut) { {104.2 + 0.1}); - MockJetWithLorentzVector jet0{m_tl0}; - MockJetWithLorentzVector jet1{m_tl1}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + auto jet1 = std::make_shared<MockJetWithLorentzVector>(m_tl1); - - EXPECT_CALL(jet0, et()).Times(AnyNumber()); - EXPECT_CALL(jet0, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet0, et()).Times(AnyNumber()); + EXPECT_CALL(*jet0, eta()).Times(AnyNumber()); - EXPECT_CALL(jet1, et()).Times(AnyNumber()); - EXPECT_CALL(jet1, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet1, et()).Times(AnyNumber()); + EXPECT_CALL(*jet1, eta()).Times(AnyNumber()); - HypoJetVector jets{&jet0, &jet1}; + HypoJetVector jets{jet0, jet1}; EXPECT_FALSE(condition.isSatisfied(jets)); } @@ -191,16 +189,16 @@ TEST_F(DijetDEtaMassConditionTest, aboveYStarCut) { {104.2 -0.1}, {104.2 + 0.1}); - MockJetWithLorentzVector jet0{m_tl0}; - MockJetWithLorentzVector jet1{m_tl1}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + auto jet1 = std::make_shared<MockJetWithLorentzVector>(m_tl1); - EXPECT_CALL(jet0, et()).Times(AnyNumber()); - EXPECT_CALL(jet0, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet0, et()).Times(AnyNumber()); + EXPECT_CALL(*jet0, eta()).Times(AnyNumber()); - EXPECT_CALL(jet1, et()).Times(AnyNumber()); - EXPECT_CALL(jet1, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet1, et()).Times(AnyNumber()); + EXPECT_CALL(*jet1, eta()).Times(AnyNumber()); - HypoJetVector jets{&jet0, &jet1}; + HypoJetVector jets{jet0, jet1}; EXPECT_FALSE(condition.isSatisfied(jets)); } @@ -216,16 +214,16 @@ TEST_F(DijetDEtaMassConditionTest, belowMassCut) { {1.0 + 0.001}, {104.2 + 0.1}, {104.2 + 0.2}); - MockJetWithLorentzVector jet0{m_tl0}; - MockJetWithLorentzVector jet1{m_tl1}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + auto jet1 = std::make_shared<MockJetWithLorentzVector>(m_tl1); - EXPECT_CALL(jet0, et()).Times(AnyNumber()); - EXPECT_CALL(jet0, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet0, et()).Times(AnyNumber()); + EXPECT_CALL(*jet0, eta()).Times(AnyNumber()); - EXPECT_CALL(jet1, et()).Times(AnyNumber()); - EXPECT_CALL(jet1, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet1, et()).Times(AnyNumber()); + EXPECT_CALL(*jet1, eta()).Times(AnyNumber()); - HypoJetVector jets{&jet0, &jet1}; + HypoJetVector jets{jet0, jet1}; EXPECT_FALSE(condition.isSatisfied(jets)); } @@ -240,16 +238,16 @@ TEST_F(DijetDEtaMassConditionTest, aboveMassCut) { {104.2 - 0.2}, {104.2 - 0.1}); - MockJetWithLorentzVector jet0{m_tl0}; - MockJetWithLorentzVector jet1{m_tl1}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + auto jet1 = std::make_shared<MockJetWithLorentzVector>(m_tl1); - EXPECT_CALL(jet0, et()).Times(AnyNumber()); - EXPECT_CALL(jet0, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet0, et()).Times(AnyNumber()); + EXPECT_CALL(*jet0, eta()).Times(AnyNumber()); - EXPECT_CALL(jet1, et()).Times(AnyNumber()); - EXPECT_CALL(jet1, eta()).Times(AnyNumber()); + EXPECT_CALL(*jet1, et()).Times(AnyNumber()); + EXPECT_CALL(*jet1, eta()).Times(AnyNumber()); - HypoJetVector jets{&jet0, &jet1}; + HypoJetVector jets{jet0, jet1}; EXPECT_FALSE(condition.isSatisfied(jets)); } @@ -266,11 +264,11 @@ TEST_F(DijetDEtaMassConditionTest, tooManyJets) { {104.2 -0.1}, {104.2 + 0.1}); - MockJetWithLorentzVector jet0{m_tl0}; - MockJetWithLorentzVector jet1{m_tl1}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + auto jet1 = std::make_shared<MockJetWithLorentzVector>(m_tl1); - HypoJetVector jets{&jet0, &jet1}; - jets.push_back(&jet0); + HypoJetVector jets{jet0, jet1}; + jets.push_back(jet0); EXPECT_THROW(condition.isSatisfied(jets), std::runtime_error); } @@ -287,9 +285,9 @@ TEST_F(DijetDEtaMassConditionTest, tooFewJets) { {104.2 -0.1}, {104.2 + 0.1}); - MockJetWithLorentzVector jet0{m_tl0}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); - HypoJetVector jets{&jet0}; + HypoJetVector jets{jet0}; EXPECT_THROW(condition.isSatisfied(jets), std::runtime_error); diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/EtaEtConditionTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/EtaEtConditionTest.cxx index 1e61ddb66ce7f9c53696904cd19a485836619607..8c44745a155da8320e59ab3977ae1ace36b91123 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/EtaEtConditionTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/EtaEtConditionTest.cxx @@ -62,8 +62,8 @@ TEST_F(EtaEtConditionTest, artefacts){ EXPECT_NEAR(m_tl0.Eta(), m_eta0, m_eps); EXPECT_NEAR(m_tl0.Et(), m_et0, m_eps); - MockJetWithLorentzVector jet0{m_tl0}; - HypoJetVector jets{&jet0}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + HypoJetVector jets{jet0}; EXPECT_EQ(jets.size(), static_cast<unsigned int>(1)); } @@ -73,11 +73,11 @@ TEST_F(EtaEtConditionTest, accepts) { EtaEtCondition condition(-1., 1., 99.99999); - MockJetWithLorentzVector jet0{m_tl0}; - HypoJetVector jets{&jet0}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + HypoJetVector jets{jet0}; - EXPECT_CALL(jet0, et()); - EXPECT_CALL(jet0, eta()); + EXPECT_CALL(*jet0, et()); + EXPECT_CALL(*jet0, eta()); EXPECT_TRUE(condition.isSatisfied(jets)); @@ -92,11 +92,11 @@ TEST_F(EtaEtConditionTest, accepts) { TEST_F(EtaEtConditionTest, belowEtaMinCut) { EtaEtCondition condition(-0.5+0.001, 1., 100.); - MockJetWithLorentzVector jet0{m_tl0}; - HypoJetVector jets{&jet0}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + HypoJetVector jets{jet0}; - EXPECT_CALL(jet0, et()); - EXPECT_CALL(jet0, eta()); + EXPECT_CALL(*jet0, et()); + EXPECT_CALL(*jet0, eta()); EXPECT_FALSE(condition.isSatisfied(jets)); } @@ -105,11 +105,11 @@ TEST_F(EtaEtConditionTest, belowEtaMinCut) { TEST_F(EtaEtConditionTest, aboveEtaMaxCut) { EtaEtCondition condition(-1.0, 0.5-0.001, 100.); - MockJetWithLorentzVector jet0{m_tl0}; - HypoJetVector jets{&jet0}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + HypoJetVector jets{jet0}; - EXPECT_CALL(jet0, et()); - EXPECT_CALL(jet0, eta()); + EXPECT_CALL(*jet0, et()); + EXPECT_CALL(*jet0, eta()); EXPECT_FALSE(condition.isSatisfied(jets)); } @@ -118,11 +118,11 @@ TEST_F(EtaEtConditionTest, aboveEtaMaxCut) { TEST_F(EtaEtConditionTest, belowEtCut) { EtaEtCondition condition(-1.0, 1.0, 100.001); - MockJetWithLorentzVector jet0{m_tl0}; - HypoJetVector jets{&jet0}; + auto jet0 = std::make_shared<MockJetWithLorentzVector>(m_tl0); + HypoJetVector jets{jet0}; - EXPECT_CALL(jet0, et()); - EXPECT_CALL(jet0, eta()); + EXPECT_CALL(*jet0, et()); + EXPECT_CALL(*jet0, eta()); EXPECT_FALSE(condition.isSatisfied(jets)); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/LlpCleanerTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/LlpCleanerTest.cxx index ccc3d616b9b109aa9da93f17c140b6c35429036f..01b2824ea1f2242032e364010c578c2ca507fb86 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/LlpCleanerTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/LlpCleanerTest.cxx @@ -65,7 +65,7 @@ TEST(LlpCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1., 1., 1., 1., 1.}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } constexpr float eps = 0.00001; @@ -75,70 +75,70 @@ TEST(LlpCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1.-eps, 1., 1, 1., 1.}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet below fSampMaxTightThreshold, above NegativeE { std::array<float, 5> args{1., 1.-eps, 1, 1., 1.}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet above fSampMaxTightThreshold, above NegativeE { std::array<float, 5> args{1-eps, 1.-eps, 1, 1., 1.}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } // jet above HECFrac below HECQuality below AverageLArQF { std::array<float, 5> args{1., 1., 1-eps, 1., 1.}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet below HECFrac above HECQuality below AverageLArQF { std::array<float, 5> args{1., 1., 1, 1.-eps, 1.}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet below HECFrac below HECQuality above AverageLArQF { std::array<float, 5> args{1., 1., 1, 1., 1.-eps}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet above HECFrac above HECQuality below AverageLArQF { std::array<float, 5> args{1., 1., 1.-eps, 1.-eps, 1.}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet above HECFrac below HECQuality above AverageLArQF { std::array<float, 5> args{1., 1., 1.-eps, 1., 1.-eps}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet below HECFrac above HECQuality above AverageLArQF { std::array<float, 5> args{1., 1., 1., 1.-eps, 1.-eps}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet above HECFrac above HECQuality above AverageLArQF { std::array<float, 5> args{1., 1., 1.-eps, 1.-eps, 1.-eps}; auto cleaner = makeLlpCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } } @@ -153,5 +153,5 @@ TEST(LlpCleanerTest, ThrowsOnUncleanableJet) { - EXPECT_THROW(cleaner(&jet), UncleanableJet); + EXPECT_THROW(cleaner(jet), UncleanableJet); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/LooseCleanerTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/LooseCleanerTest.cxx index 01fe9f437f4ea50f4a7fb483a252e155d959d810..e10d4dc4d17824f6b0bbfc18c1709230742a152a 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/LooseCleanerTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/LooseCleanerTest.cxx @@ -55,7 +55,7 @@ TEST(LooseCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1., 1., 1., 2., 1.}; auto cleaner = makeLooseCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } constexpr float eps = 0.00001; @@ -65,21 +65,21 @@ TEST(LooseCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1.-eps, 1+ eps, 1, 2., 1.}; auto cleaner = makeLooseCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } // jet above fSampMaxTightThreshold, outside applicable eta range { std::array<float, 5> args{1.-eps, 0.5- eps, 1, 2., 1.}; auto cleaner = makeLooseCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet below _emfLowTightThreshold { std::array<float, 5> args{1., 1., 1+eps, 2., 1.}; auto cleaner = makeLooseCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } @@ -87,7 +87,7 @@ TEST(LooseCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1., 1., 0.5, 1.-eps, 1.}; auto cleaner = makeLooseCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } @@ -95,7 +95,7 @@ TEST(LooseCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1., 1., 1.0, 1.0, 1. -eps}; auto cleaner = makeLooseCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } } @@ -110,5 +110,5 @@ TEST(LooseCleanerTest, ThrowsOnUncleanableJet) { - EXPECT_THROW(cleaner(&jet), UncleanableJet); + EXPECT_THROW(cleaner(jet), UncleanableJet); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherMTTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherMTTest.cxx index 6299b3570e38384788c8b4a112db728a875a93d6..1640dbd5b0753266520e07c913c780966ed9df47 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherMTTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherMTTest.cxx @@ -88,10 +88,10 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, tooFewSelectedJets){ auto factory = TLorentzVectorFactory(); auto tl = factory.make(eta, et); - MockJetWithLorentzVector jet0(tl); - MockJetWithLorentzVector jet1{tl}; + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl); + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl); - HypoJetVector jets{&jet0, &jet1}; + HypoJetVector jets{jet0, jet1}; std::unique_ptr<IGroupsMatcherMT> matcher(nullptr); matcher.reset(new MaximumBipartiteGroupsMatcherMT(std::move(m_conditions))); @@ -125,26 +125,26 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, oneSelectedJet){ auto factory = TLorentzVectorFactory(); auto tl = factory.make(eta, et); - MockJetWithLorentzVector jet0(tl); - MockJetWithLorentzVector jet1{tl}; - MockJetWithLorentzVector jet2{tl}; + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl); + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl); + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl); eta = 0; et = 150000; auto tl0 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl0}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl0); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; - EXPECT_CALL(jet0, eta()).Times(m_nconditions); - EXPECT_CALL(jet1, eta()).Times(m_nconditions); - EXPECT_CALL(jet2, eta()).Times(m_nconditions); - EXPECT_CALL(jet3, eta()).Times(m_nconditions); + EXPECT_CALL(*jet0, eta()).Times(m_nconditions); + EXPECT_CALL(*jet1, eta()).Times(m_nconditions); + EXPECT_CALL(*jet2, eta()).Times(m_nconditions); + EXPECT_CALL(*jet3, eta()).Times(m_nconditions); - EXPECT_CALL(jet0, et()).Times(m_nconditions); - EXPECT_CALL(jet1, et()).Times(m_nconditions); - EXPECT_CALL(jet2, et()).Times(m_nconditions); - EXPECT_CALL(jet3, et()).Times(m_nconditions); + EXPECT_CALL(*jet0, et()).Times(m_nconditions); + EXPECT_CALL(*jet1, et()).Times(m_nconditions); + EXPECT_CALL(*jet2, et()).Times(m_nconditions); + EXPECT_CALL(*jet3, et()).Times(m_nconditions); std::unique_ptr<IGroupsMatcherMT> matcher(nullptr); matcher.reset(new MaximumBipartiteGroupsMatcherMT(std::move(m_conditions))); @@ -178,37 +178,37 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, twoSelectedJets){ auto factory = TLorentzVectorFactory(); auto tl0 = factory.make(eta, et); - MockJetWithLorentzVector jet0(tl0); + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl0); eta = 0.1; et = 139; auto tl1 = factory.make(eta, et); - MockJetWithLorentzVector jet1{tl1}; + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl1); eta = 5.; et = 100.; auto tl2 = factory.make(eta, et); - MockJetWithLorentzVector jet2{tl2}; + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl2); eta = 0; et = 150; auto tl3 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl3}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl3); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; - EXPECT_CALL(jet0, eta()).Times(m_nconditions); - EXPECT_CALL(jet1, eta()).Times(m_nconditions); - EXPECT_CALL(jet2, eta()).Times(m_nconditions); - EXPECT_CALL(jet3, eta()).Times(m_nconditions); + EXPECT_CALL(*jet0, eta()).Times(m_nconditions); + EXPECT_CALL(*jet1, eta()).Times(m_nconditions); + EXPECT_CALL(*jet2, eta()).Times(m_nconditions); + EXPECT_CALL(*jet3, eta()).Times(m_nconditions); - EXPECT_CALL(jet0, et()).Times(m_nconditions); - EXPECT_CALL(jet1, et()).Times(m_nconditions); - EXPECT_CALL(jet2, et()).Times(m_nconditions); - EXPECT_CALL(jet3, et()).Times(m_nconditions); + EXPECT_CALL(*jet0, et()).Times(m_nconditions); + EXPECT_CALL(*jet1, et()).Times(m_nconditions); + EXPECT_CALL(*jet2, et()).Times(m_nconditions); + EXPECT_CALL(*jet3, et()).Times(m_nconditions); std::unique_ptr<IGroupsMatcherMT> matcher(nullptr); matcher.reset(new MaximumBipartiteGroupsMatcherMT(std::move(m_conditions))); @@ -246,37 +246,37 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, threeSelectedJets){ auto factory = TLorentzVectorFactory(); auto tl0 = factory.make(eta, et); - MockJetWithLorentzVector jet0(tl0); + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl0); eta = 0.1; et = 139; auto tl1 = factory.make(eta, et); - MockJetWithLorentzVector jet1{tl1}; + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl1); eta = 0.5; et = 141.; auto tl2 = factory.make(eta, et); - MockJetWithLorentzVector jet2{tl2}; + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl2); eta = -0.2; et = 101.; auto tl3 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl3}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl3); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; - EXPECT_CALL(jet1, eta()).Times(m_nconditions); - EXPECT_CALL(jet2, eta()).Times(m_nconditions); - EXPECT_CALL(jet3, eta()).Times(m_nconditions); - EXPECT_CALL(jet0, eta()).Times(m_nconditions); + EXPECT_CALL(*jet1, eta()).Times(m_nconditions); + EXPECT_CALL(*jet2, eta()).Times(m_nconditions); + EXPECT_CALL(*jet3, eta()).Times(m_nconditions); + EXPECT_CALL(*jet0, eta()).Times(m_nconditions); - EXPECT_CALL(jet1, et()).Times(m_nconditions); - EXPECT_CALL(jet2, et()).Times(m_nconditions); - EXPECT_CALL(jet3, et()).Times(m_nconditions); - EXPECT_CALL(jet0, et()).Times(m_nconditions); + EXPECT_CALL(*jet1, et()).Times(m_nconditions); + EXPECT_CALL(*jet2, et()).Times(m_nconditions); + EXPECT_CALL(*jet3, et()).Times(m_nconditions); + EXPECT_CALL(*jet0, et()).Times(m_nconditions); std::unique_ptr<IGroupsMatcherMT> matcher(nullptr); matcher.reset(new MaximumBipartiteGroupsMatcherMT(std::move(m_conditions))); @@ -310,36 +310,36 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, fourSelectedJets){ auto factory = TLorentzVectorFactory(); auto tl0 = factory.make(eta, et); - MockJetWithLorentzVector jet0(tl0); + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl0); eta = 0.1; et = 139; auto tl1 = factory.make(eta, et); - MockJetWithLorentzVector jet1{tl1}; + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl1); eta = 0.5; et = 175.; auto tl2 = factory.make(eta, et); - MockJetWithLorentzVector jet2{tl2}; + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl2); eta = -0.2; et = 101.; auto tl3 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl3}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl3); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; - EXPECT_CALL(jet0, eta()).Times(m_nconditions); - EXPECT_CALL(jet1, eta()).Times(m_nconditions); - EXPECT_CALL(jet2, eta()).Times(m_nconditions); - EXPECT_CALL(jet3, eta()).Times(m_nconditions); + EXPECT_CALL(*jet0, eta()).Times(m_nconditions); + EXPECT_CALL(*jet1, eta()).Times(m_nconditions); + EXPECT_CALL(*jet2, eta()).Times(m_nconditions); + EXPECT_CALL(*jet3, eta()).Times(m_nconditions); - EXPECT_CALL(jet0, et()).Times(m_nconditions); - EXPECT_CALL(jet1, et()).Times(m_nconditions); - EXPECT_CALL(jet2, et()).Times(m_nconditions); - EXPECT_CALL(jet3, et()).Times(m_nconditions); + EXPECT_CALL(*jet0, et()).Times(m_nconditions); + EXPECT_CALL(*jet1, et()).Times(m_nconditions); + EXPECT_CALL(*jet2, et()).Times(m_nconditions); + EXPECT_CALL(*jet3, et()).Times(m_nconditions); std::unique_ptr<IGroupsMatcherMT> matcher(nullptr); matcher.reset(new MaximumBipartiteGroupsMatcherMT(std::move(m_conditions))); @@ -384,36 +384,36 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest, overlappingEtaRegions){ auto factory = TLorentzVectorFactory(); auto tl0 = factory.make(eta, et); - MockJetWithLorentzVector jet0(tl0); + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl0); eta = 0.1; et = 101; auto tl1 = factory.make(eta, et); - MockJetWithLorentzVector jet1{tl1}; + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl1); eta = 0.1; et = 91.; auto tl2 = factory.make(eta, et); - MockJetWithLorentzVector jet2{tl2}; + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl2); eta = 0.1; et = 81.; auto tl3 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl3}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl3); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; - EXPECT_CALL(jet0, eta()).Times(nconditions); - EXPECT_CALL(jet1, eta()).Times(nconditions); - EXPECT_CALL(jet2, eta()).Times(nconditions); - EXPECT_CALL(jet3, eta()).Times(nconditions); + EXPECT_CALL(*jet0, eta()).Times(nconditions); + EXPECT_CALL(*jet1, eta()).Times(nconditions); + EXPECT_CALL(*jet2, eta()).Times(nconditions); + EXPECT_CALL(*jet3, eta()).Times(nconditions); - EXPECT_CALL(jet0, et()).Times(nconditions); - EXPECT_CALL(jet1, et()).Times(nconditions); - EXPECT_CALL(jet2, et()).Times(nconditions); - EXPECT_CALL(jet3, et()).Times(nconditions); + EXPECT_CALL(*jet0, et()).Times(nconditions); + EXPECT_CALL(*jet1, et()).Times(nconditions); + EXPECT_CALL(*jet2, et()).Times(nconditions); + EXPECT_CALL(*jet3, et()).Times(nconditions); std::unique_ptr<IGroupsMatcherMT> matcher(nullptr); matcher.reset(new MaximumBipartiteGroupsMatcherMT(std::move(conditions))); diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherMTTest_Multijet.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherMTTest_Multijet.cxx index e3a7cbb14a0058b1d70da0f51789ca73fc20ce49..addcca6599b302836f1a68af240cdf6fa2b0dc6e 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherMTTest_Multijet.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherMTTest_Multijet.cxx @@ -131,8 +131,6 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj_flowNetworkBuilder_0){ auto G = builder->create(groups.begin(), groups.end(), collector, nodeToJet); EXPECT_FALSE(G.has_value()); - - for(auto j : jets){delete j;} } TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj_flowNetworkBuilder_1){ @@ -188,8 +186,6 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj_flowNetworkBuilder_1){ EXPECT_TRUE((*G)->V() == 14); EXPECT_TRUE(((*G)->edges()).size() == 13); - - for(auto j : jets){delete j;} } TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj_flowNetworkBuilder_2){ @@ -237,8 +233,6 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj_flowNetworkBuilder_2){ EXPECT_TRUE((*G)->V() == 14); EXPECT_TRUE(((*G)->edges()).size() == 13); - - for(auto j : jets){delete j;} } @@ -295,8 +289,6 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj0){ if (m_debug){collector->write();} - for(auto j : jets){delete j;} - EXPECT_TRUE(jetCollector.empty()); EXPECT_FALSE(*pass); } @@ -353,8 +345,6 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj0){ // // if(m_debug){collector->write();} // -// for(auto j : jets){delete j;} -// // EXPECT_TRUE(jetCollector.empty()); // EXPECT_FALSE(*pass); // } @@ -411,8 +401,6 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj0){ // // if(m_debug){collector->write();} // -// for(auto j : jets){delete j;} -// // EXPECT_TRUE(jetCollector.empty()); // not xAOD jets // // EXPECT_TRUE(*pass); @@ -468,7 +456,6 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj0){ // // if(m_debug){collector->write();} // -// for(auto j : jets){delete j;} // EXPECT_TRUE(jetCollector.empty()); //not xAOD jets // EXPECT_TRUE(*pass); // } @@ -531,8 +518,6 @@ TEST_F(MaximumBipartiteGroupsMatcherMTTest_Multijet, mj0){ // // if(m_debug){collector->write();} // -// for(auto j : jets){delete j;} -// // EXPECT_TRUE(jetCollector.empty()); // not xAOD jets // EXPECT_TRUE(*pass); // } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherTest.cxx index 23a53fe61e6ac63270fc012bc7736a959891502e..b813e7417cb0dcf8f634a1dc682519cce4b1db06 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/MaximumBipartiteGroupsMatcherTest.cxx @@ -85,10 +85,10 @@ TEST_F(MaximumBipartiteGroupsMatcherTest, tooFewSelectedJets){ auto factory = TLorentzVectorFactory(); auto tl = factory.make(eta, et); - MockJetWithLorentzVector jet0(tl); - MockJetWithLorentzVector jet1{tl}; + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl); + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl); - HypoJetVector jets{&jet0, &jet1}; + HypoJetVector jets{jet0, jet1}; auto groups = makeJetGroups(jets.begin(), jets.end()); MaximumBipartiteGroupsMatcher matcher(m_conditions); @@ -109,26 +109,26 @@ TEST_F(MaximumBipartiteGroupsMatcherTest, oneSelectedJet){ auto factory = TLorentzVectorFactory(); auto tl = factory.make(eta, et); - MockJetWithLorentzVector jet0(tl); - MockJetWithLorentzVector jet1{tl}; - MockJetWithLorentzVector jet2{tl}; + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl); + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl); + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl); eta = 0; et = 150; auto tl0 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl0}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl0); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; - EXPECT_CALL(jet0, eta()).Times(m_nconditions); - EXPECT_CALL(jet1, eta()).Times(m_nconditions); - EXPECT_CALL(jet2, eta()).Times(m_nconditions); - EXPECT_CALL(jet3, eta()).Times(m_nconditions); + EXPECT_CALL(*jet0, eta()).Times(m_nconditions); + EXPECT_CALL(*jet1, eta()).Times(m_nconditions); + EXPECT_CALL(*jet2, eta()).Times(m_nconditions); + EXPECT_CALL(*jet3, eta()).Times(m_nconditions); - EXPECT_CALL(jet0, et()).Times(m_nconditions); - EXPECT_CALL(jet1, et()).Times(m_nconditions); - EXPECT_CALL(jet2, et()).Times(m_nconditions); - EXPECT_CALL(jet3, et()).Times(m_nconditions); + EXPECT_CALL(*jet0, et()).Times(m_nconditions); + EXPECT_CALL(*jet1, et()).Times(m_nconditions); + EXPECT_CALL(*jet2, et()).Times(m_nconditions); + EXPECT_CALL(*jet3, et()).Times(m_nconditions); auto groups = makeJetGroups(jets.begin(), jets.end()); @@ -150,38 +150,35 @@ TEST_F(MaximumBipartiteGroupsMatcherTest, twoSelectedJets){ auto factory = TLorentzVectorFactory(); auto tl0 = factory.make(eta, et); - - MockJetWithLorentzVector jet0(tl0); + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl0); eta = 0.1; et = 139; auto tl1 = factory.make(eta, et); - - MockJetWithLorentzVector jet1{tl1}; - + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl1); eta = 5.; et = 100.; auto tl2 = factory.make(eta, et); - MockJetWithLorentzVector jet2{tl2}; + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl2); eta = 0; et = 150; auto tl3 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl3}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl3); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; - EXPECT_CALL(jet0, eta()).Times(m_nconditions); - EXPECT_CALL(jet1, eta()).Times(m_nconditions); - EXPECT_CALL(jet2, eta()).Times(m_nconditions); - EXPECT_CALL(jet3, eta()).Times(m_nconditions); + EXPECT_CALL(*jet0, eta()).Times(m_nconditions); + EXPECT_CALL(*jet1, eta()).Times(m_nconditions); + EXPECT_CALL(*jet2, eta()).Times(m_nconditions); + EXPECT_CALL(*jet3, eta()).Times(m_nconditions); - EXPECT_CALL(jet0, et()).Times(m_nconditions); - EXPECT_CALL(jet1, et()).Times(m_nconditions); - EXPECT_CALL(jet2, et()).Times(m_nconditions); - EXPECT_CALL(jet3, et()).Times(m_nconditions); + EXPECT_CALL(*jet0, et()).Times(m_nconditions); + EXPECT_CALL(*jet1, et()).Times(m_nconditions); + EXPECT_CALL(*jet2, et()).Times(m_nconditions); + EXPECT_CALL(*jet3, et()).Times(m_nconditions); MaximumBipartiteGroupsMatcher matcher(m_conditions); auto groups = makeJetGroups(jets.begin(), jets.end()); @@ -204,38 +201,34 @@ TEST_F(MaximumBipartiteGroupsMatcherTest, threeSelectedJets){ auto factory = TLorentzVectorFactory(); auto tl0 = factory.make(eta, et); - - MockJetWithLorentzVector jet0(tl0); + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl0); eta = 0.1; et = 139; auto tl1 = factory.make(eta, et); - - MockJetWithLorentzVector jet1{tl1}; - + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl1); eta = 0.5; et = 141.; auto tl2 = factory.make(eta, et); - MockJetWithLorentzVector jet2{tl2}; + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl2); eta = -0.2; et = 101.; auto tl3 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl3}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl3); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; + EXPECT_CALL(*jet1, eta()).Times(m_nconditions); + EXPECT_CALL(*jet2, eta()).Times(m_nconditions); + EXPECT_CALL(*jet3, eta()).Times(m_nconditions); + EXPECT_CALL(*jet0, eta()).Times(m_nconditions); - EXPECT_CALL(jet1, eta()).Times(m_nconditions); - EXPECT_CALL(jet2, eta()).Times(m_nconditions); - EXPECT_CALL(jet3, eta()).Times(m_nconditions); - EXPECT_CALL(jet0, eta()).Times(m_nconditions); - - EXPECT_CALL(jet1, et()).Times(m_nconditions); - EXPECT_CALL(jet2, et()).Times(m_nconditions); - EXPECT_CALL(jet3, et()).Times(m_nconditions); - EXPECT_CALL(jet0, et()).Times(m_nconditions); + EXPECT_CALL(*jet1, et()).Times(m_nconditions); + EXPECT_CALL(*jet2, et()).Times(m_nconditions); + EXPECT_CALL(*jet3, et()).Times(m_nconditions); + EXPECT_CALL(*jet0, et()).Times(m_nconditions); MaximumBipartiteGroupsMatcher matcher(m_conditions); auto groups = makeJetGroups(jets.begin(), jets.end()); @@ -258,37 +251,35 @@ TEST_F(MaximumBipartiteGroupsMatcherTest, fourSelectedJets){ auto factory = TLorentzVectorFactory(); auto tl0 = factory.make(eta, et); - - MockJetWithLorentzVector jet0(tl0); + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl0); eta = 0.1; et = 139; auto tl1 = factory.make(eta, et); - - MockJetWithLorentzVector jet1{tl1}; + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl1); eta = 0.5; et = 175.; auto tl2 = factory.make(eta, et); - MockJetWithLorentzVector jet2{tl2}; + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl2); eta = -0.2; et = 101.; auto tl3 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl3}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl3); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; - EXPECT_CALL(jet0, eta()).Times(m_nconditions); - EXPECT_CALL(jet1, eta()).Times(m_nconditions); - EXPECT_CALL(jet2, eta()).Times(m_nconditions); - EXPECT_CALL(jet3, eta()).Times(m_nconditions); + EXPECT_CALL(*jet0, eta()).Times(m_nconditions); + EXPECT_CALL(*jet1, eta()).Times(m_nconditions); + EXPECT_CALL(*jet2, eta()).Times(m_nconditions); + EXPECT_CALL(*jet3, eta()).Times(m_nconditions); - EXPECT_CALL(jet0, et()).Times(m_nconditions); - EXPECT_CALL(jet1, et()).Times(m_nconditions); - EXPECT_CALL(jet2, et()).Times(m_nconditions); - EXPECT_CALL(jet3, et()).Times(m_nconditions); + EXPECT_CALL(*jet0, et()).Times(m_nconditions); + EXPECT_CALL(*jet1, et()).Times(m_nconditions); + EXPECT_CALL(*jet2, et()).Times(m_nconditions); + EXPECT_CALL(*jet3, et()).Times(m_nconditions); MaximumBipartiteGroupsMatcher matcher(m_conditions); auto groups = makeJetGroups(jets.begin(), jets.end()); @@ -320,37 +311,34 @@ TEST_F(MaximumBipartiteGroupsMatcherTest, overlappingEtaRegions){ auto factory = TLorentzVectorFactory(); auto tl0 = factory.make(eta, et); - - MockJetWithLorentzVector jet0(tl0); + auto jet0 = std::make_shared<const MockJetWithLorentzVector>(tl0); eta = 0.1; et = 101; auto tl1 = factory.make(eta, et); - - MockJetWithLorentzVector jet1{tl1}; - + auto jet1 = std::make_shared<const MockJetWithLorentzVector>(tl1); eta = 0.1; et = 91.; auto tl2 = factory.make(eta, et); - MockJetWithLorentzVector jet2{tl2}; + auto jet2 = std::make_shared<const MockJetWithLorentzVector>(tl2); eta = 0.1; et = 81.; auto tl3 = factory.make(eta, et); - MockJetWithLorentzVector jet3{tl3}; + auto jet3 = std::make_shared<const MockJetWithLorentzVector>(tl3); - HypoJetVector jets{&jet0, &jet1, &jet2, &jet3}; + HypoJetVector jets{jet0, jet1, jet2, jet3}; - EXPECT_CALL(jet0, eta()).Times(nconditions); - EXPECT_CALL(jet1, eta()).Times(nconditions); - EXPECT_CALL(jet2, eta()).Times(nconditions); - EXPECT_CALL(jet3, eta()).Times(nconditions); + EXPECT_CALL(*jet0, eta()).Times(nconditions); + EXPECT_CALL(*jet1, eta()).Times(nconditions); + EXPECT_CALL(*jet2, eta()).Times(nconditions); + EXPECT_CALL(*jet3, eta()).Times(nconditions); - EXPECT_CALL(jet0, et()).Times(nconditions); - EXPECT_CALL(jet1, et()).Times(nconditions); - EXPECT_CALL(jet2, et()).Times(nconditions); - EXPECT_CALL(jet3, et()).Times(nconditions); + EXPECT_CALL(*jet0, et()).Times(nconditions); + EXPECT_CALL(*jet1, et()).Times(nconditions); + EXPECT_CALL(*jet2, et()).Times(nconditions); + EXPECT_CALL(*jet3, et()).Times(nconditions); MaximumBipartiteGroupsMatcher matcher(conditions); auto groups = makeJetGroups(jets.begin(), jets.end()); diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/PartitionsGrouperTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/PartitionsGrouperTest.cxx index 1090afa4716af1e5c3d840000ce92b510323d50e..e8143f21e18a6ab9006e819d4cace802ff61995a 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/PartitionsGrouperTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/PartitionsGrouperTest.cxx @@ -40,7 +40,7 @@ TEST(PartitionsGrouperTest, test0){ constexpr double eta{0.5}; for(int i = 1; i < 6; ++i){ auto tlv = factory.make(eta, i); - TLorentzVectorAsIJet* tl_j = new TLorentzVectorAsIJet(tlv); + auto tl_j = std::make_shared<TLorentzVectorAsIJet>(tlv); jets.push_back(tl_j); } @@ -59,10 +59,6 @@ TEST(PartitionsGrouperTest, test0){ EXPECT_TRUE(groupVector[0].size()== 2); // two jets first group EXPECT_TRUE(groupVector[1].size()== 3); // three jets second group } - - auto b = jets.begin(); - auto e = jets.end(); - for(auto iter = b; iter != e; ++iter){delete *iter;} } TEST(PartitionsGrouperTest, test1){ @@ -76,7 +72,7 @@ TEST(PartitionsGrouperTest, test1){ constexpr double eta{0.5}; for(int i = 1; i < 10; ++i){ auto tlv = factory.make(eta, i); - TLorentzVectorAsIJet* tl_j = new TLorentzVectorAsIJet(tlv); + auto tl_j = std::make_shared<TLorentzVectorAsIJet>(tlv); jets.push_back(tl_j); } @@ -96,10 +92,6 @@ TEST(PartitionsGrouperTest, test1){ EXPECT_TRUE(groupVector[1].size()== 3); // three jets second group EXPECT_TRUE(groupVector[2].size()== 1); // one jet third group } - - auto b = jets.begin(); - auto e = jets.end(); - for(auto iter = b; iter != e; ++iter){delete *iter;} } @@ -114,7 +106,7 @@ TEST(PartitionsGrouperTest, test2){ constexpr double eta{0.5}; for(int i = 1; i < 5; ++i){ auto tlv = factory.make(eta, i); - TLorentzVectorAsIJet* tl_j = new TLorentzVectorAsIJet(tlv); + auto tl_j = std::make_shared<TLorentzVectorAsIJet>(tlv); jets.push_back(tl_j); } @@ -128,10 +120,6 @@ TEST(PartitionsGrouperTest, test2){ // need to place 5 jets in 2 conditions // 5.4.3.2/(2!3!) ways to do this (j1j2 and j2j1 in c1 is counted once). EXPECT_TRUE(groupVectors.size() == 0); - - auto b = jets.begin(); - auto e = jets.end(); - for(auto iter = b; iter != e; ++iter){delete *iter;} } @@ -147,7 +135,7 @@ TEST(PartitionsGrouperTest, SingleJetGrouperBehavioiur){ constexpr double eta{0.5}; for(int i = 1; i < 7; ++i){ auto tlv = factory.make(eta, i); - TLorentzVectorAsIJet* tl_j = new TLorentzVectorAsIJet(tlv); + auto tl_j = std::make_shared<TLorentzVectorAsIJet>(tlv); jets.push_back(tl_j); } @@ -177,10 +165,6 @@ TEST(PartitionsGrouperTest, SingleJetGrouperBehavioiur){ EXPECT_TRUE(jv.size() == 1); } } - - auto b = jets.begin(); - auto e = jets.end(); - for(auto iter = b; iter != e; ++iter){delete *iter;} } @@ -198,7 +182,7 @@ TEST(PartitionsGrouperTest, CombinationsGrouperBehavioiur){ constexpr double eta{0.5}; for(int i = 1; i < 7; ++i){ auto tlv = factory.make(eta, i); - TLorentzVectorAsIJet* tl_j = new TLorentzVectorAsIJet(tlv); + auto tl_j = std::make_shared<TLorentzVectorAsIJet>(tlv); jets.push_back(tl_j); } @@ -235,10 +219,6 @@ TEST(PartitionsGrouperTest, CombinationsGrouperBehavioiur){ EXPECT_TRUE(jv.size() == 2); } } - - auto b = jets.begin(); - auto e = jets.end(); - for(auto iter = b; iter != e; ++iter){delete *iter;} } TEST(PartitionsGrouperTest, FullPartitionGrouperBehavioiur){ @@ -253,7 +233,7 @@ TEST(PartitionsGrouperTest, FullPartitionGrouperBehavioiur){ constexpr double eta{0.5}; for(int i = 1; i < 7; ++i){ auto tlv = factory.make(eta, i); - TLorentzVectorAsIJet* tl_j = new TLorentzVectorAsIJet(tlv); + auto tl_j = std::make_shared<TLorentzVectorAsIJet>(tlv); jets.push_back(tl_j); } @@ -295,9 +275,5 @@ TEST(PartitionsGrouperTest, FullPartitionGrouperBehavioiur){ EXPECT_TRUE(jv.size() == 1); } } - - auto b = jets.begin(); - auto e = jets.end(); - for(auto iter = b; iter != e; ++iter){delete *iter;} } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/PartitionsGroupsMatcherMTTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/PartitionsGroupsMatcherMTTest.cxx index 333e68a3e4ab116b630b908b6ffd53e133973f42..b6708b3f4df116de60932edf8ceba4180b9d257c 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/PartitionsGroupsMatcherMTTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/PartitionsGroupsMatcherMTTest.cxx @@ -93,7 +93,7 @@ TEST_F(PartitionsGroupsMatcherMTTest, tooFewSelectedJets){ auto factory = TLorentzVectorFactory(); auto tlv = factory.make(eta, et); - TLorentzVectorAsIJet* tl_j = new TLorentzVectorAsIJet(tlv); + auto tl_j = std::make_shared<const TLorentzVectorAsIJet>(tlv); HypoJetVector jets; jets.push_back(tl_j); @@ -137,7 +137,7 @@ TEST_F(PartitionsGroupsMatcherMTTest, PassingJets){ auto factory = TLorentzVectorFactory(); auto makeJetFromEt = [&factory, eta](double et){ - return new TLorentzVectorAsIJet(factory.make(eta, et)); + return std::make_shared<const TLorentzVectorAsIJet>(factory.make(eta, et)); }; std::transform(ets.begin(), @@ -199,7 +199,7 @@ TEST_F(PartitionsGroupsMatcherMTTest, Passing3Failing1){ auto factory = TLorentzVectorFactory(); auto makeJetFromEt = [&factory, eta](double et){ - return new TLorentzVectorAsIJet(factory.make(eta, et)); + return std::make_shared<const TLorentzVectorAsIJet>(factory.make(eta, et)); }; std::transform(ets.begin(), @@ -241,8 +241,6 @@ TEST_F(PartitionsGroupsMatcherMTTest, Passing3Failing1){ // calls: 4 jets, conditions need three: 4.3.2 = 24 // pass: ignore failing jet. 3.2.1 = 6 EXPECT_EQ(npass, 6u); - EXPECT_EQ(ncall, 24u); - - for(auto& j : jets){delete j;} + EXPECT_EQ(ncall, 24u); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/TightCleanerTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/TightCleanerTest.cxx index 7ad64fa8b1dee2f1f44c19bed8926f6e84b1d9c6..2f2b665de39928ca53cafc1877b23beaf0d3dadd 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/TightCleanerTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/TightCleanerTest.cxx @@ -58,7 +58,7 @@ TEST(TightCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1., 1., 1., 2., 1.}; auto cleaner = makeCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } constexpr float eps = 0.00001; @@ -68,21 +68,21 @@ TEST(TightCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1.-eps, 1+ eps, 1, 2., 1.}; auto cleaner = makeCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } // jet above fSampMaxTightThreshold, outside applicable eta range { std::array<float, 5> args{1.-eps, 0.5- eps, 1, 2., 1.}; auto cleaner = makeCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_TRUE(cleaner(&jet)); + EXPECT_TRUE(cleaner(jet)); } // jet below _emfLowTightThreshold { std::array<float, 5> args{1., 1., 1+eps, 2., 1.}; auto cleaner = makeCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } @@ -90,7 +90,7 @@ TEST(TightCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1., 1., 0.5, 1.-eps, 1.}; auto cleaner = makeCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } @@ -98,7 +98,7 @@ TEST(TightCleanerTest, SimpleThresholds) { { std::array<float, 5> args{1., 1., 1.0, 1.0, 1. -eps}; auto cleaner = makeCleaner(args[0], args[1], args[2], args[3], args[4]); - EXPECT_FALSE(cleaner(&jet)); + EXPECT_FALSE(cleaner(jet)); } } @@ -113,5 +113,5 @@ TEST(TightCleanerTest, ThrowsOnUncleanableJet) { - EXPECT_THROW(cleaner(&jet), UncleanableJet); + EXPECT_THROW(cleaner(jet), UncleanableJet); } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/xAODJetCollectorTest.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/xAODJetCollectorTest.cxx index 04abacad61108fe08bf1e5ec7ca1a0c074d6245d..fe3713ff9ee6ca711f6454848d161f5fa5544586 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/xAODJetCollectorTest.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypoUnitTests/tests/xAODJetCollectorTest.cxx @@ -35,13 +35,11 @@ TEST_F(xAODJetCollectorTest, multipleInputJets){ //multiple jets in. Jet collector is not empty and has the correct number. constexpr std::size_t njets{11}; - HypoJetVector jets; std::vector<xAOD::Jet> xaodjets (njets); - std::vector<HypoJet::xAODJetAsIJet> ijets; - ijets.reserve (njets); + HypoJetVector jets; + jets.reserve (njets); for(unsigned int ijet = 0; ijet < njets; ++ijet){ - ijets.emplace_back (&xaodjets[ijet], ijet); - jets.push_back(&ijets.back()); + jets.emplace_back (new HypoJet::xAODJetAsIJet(&xaodjets[ijet], ijet)); } xAODJetCollector collector; @@ -57,12 +55,10 @@ TEST_F(xAODJetCollectorTest, nonXAODJets){ unsigned int njets{11}; HypoJetVector jets; - std::vector<TLorentzVectorAsIJet> ijets; - ijets.reserve (njets); + jets.reserve (njets); for(unsigned int ijet = 0; ijet < njets; ++ijet){ TLorentzVector v; - ijets.emplace_back (v); - jets.push_back(&ijets.back()); + jets.emplace_back (new TLorentzVectorAsIJet(v)); } xAODJetCollector collector;