From fa4d9948bd8f0ddd82180c33b894f71b82537320 Mon Sep 17 00:00:00 2001 From: Sebastien Wertz Date: Wed, 30 Nov 2022 13:07:17 +0100 Subject: [PATCH] use event::get everywhere --- .../PatAlgos/plugins/PATObjectCrossLinker.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PhysicsTools/PatAlgos/plugins/PATObjectCrossLinker.cc b/PhysicsTools/PatAlgos/plugins/PATObjectCrossLinker.cc index e5a7ed44164e3..ef790ad65c14f 100644 --- a/PhysicsTools/PatAlgos/plugins/PATObjectCrossLinker.cc +++ b/PhysicsTools/PatAlgos/plugins/PATObjectCrossLinker.cc @@ -302,27 +302,27 @@ void PATObjectCrossLinker::produce(edm::Event& iEvent, const edm::EventSetup& iS auto lowPtElectrons = std::make_unique>(); if (!lowPtElectronsTag_.label().empty()) { - auto lowPtElectronsIn = iEvent.getHandle(lowPtElectrons_); - lowPtElectrons->reserve(lowPtElectronsIn->size()); - for (const auto& e : *lowPtElectronsIn) { + const auto& lowPtElectronsIn = iEvent.get(lowPtElectrons_); + lowPtElectrons->reserve(lowPtElectronsIn.size()); + for (const auto& e : lowPtElectronsIn) { lowPtElectrons->push_back(e); } } auto boostedTaus = std::make_unique>(); if (!boostedTausTag_.label().empty()) { - auto boostedTausIn = iEvent.getHandle(boostedTaus_); - boostedTaus->reserve(boostedTausIn->size()); - for (const auto& e : *boostedTausIn) { + const auto& boostedTausIn = iEvent.get(boostedTaus_); + boostedTaus->reserve(boostedTausIn.size()); + for (const auto& e : boostedTausIn) { boostedTaus->push_back(e); } } auto vertices = std::make_unique>(); if (!verticesTag_.label().empty()) { - auto verticesIn = iEvent.getHandle(vertices_); - vertices->reserve(verticesIn->size()); - for (const auto& e : *verticesIn) { + const auto& verticesIn = iEvent.get(vertices_); + vertices->reserve(verticesIn.size()); + for (const auto& e : verticesIn) { vertices->push_back(e); } }