From 097bd8e36b116e873959acd5647feb12c4c7a66e Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Sat, 27 Jan 2018 00:08:01 +0100 Subject: [PATCH 1/2] RecoTracker/TransientTrackingRecHit: change return type of ESProducers. Remove shared_ptr class member not needed. --- .../plugins/TkTransientTrackingRecHitBuilderESProducer.cc | 7 +++---- .../plugins/TkTransientTrackingRecHitBuilderESProducer.h | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc index a6011b43da5ff..bf82cab7aafab 100644 --- a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc +++ b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc @@ -26,7 +26,7 @@ TkTransientTrackingRecHitBuilderESProducer::TkTransientTrackingRecHitBuilderESPr TkTransientTrackingRecHitBuilderESProducer::~TkTransientTrackingRecHitBuilderESProducer() {} -std::shared_ptr +std::unique_ptr TkTransientTrackingRecHitBuilderESProducer::produce(const TransientRecHitRecord & iRecord){ // if (_propagator){ // delete _propagator; @@ -89,12 +89,11 @@ TkTransientTrackingRecHitBuilderESProducer::produce(const TransientRecHitRecord if (p2OTname != "") { iRecord.getRecord().get( p2OTname, p2OTe ); p2OTp = p2OTe.product(); - _builder = std::make_shared(pDD.product(), pp, p2OTp); + return std::make_unique(pDD.product(), pp, p2OTp); } else { - _builder = std::make_shared(pDD.product(), pp, sp, mp, computeCoarseLocalPositionFromDisk); + return std::make_unique(pDD.product(), pp, sp, mp, computeCoarseLocalPositionFromDisk); } - return _builder; } diff --git a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.h b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.h index 273c5d2de6dc4..9678a103eb648 100644 --- a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.h +++ b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.h @@ -15,9 +15,8 @@ class TkTransientTrackingRecHitBuilderESProducer: public edm::ESProducer{ public: TkTransientTrackingRecHitBuilderESProducer(const edm::ParameterSet & p); ~TkTransientTrackingRecHitBuilderESProducer() override; - std::shared_ptr produce(const TransientRecHitRecord &); + std::unique_ptr produce(const TransientRecHitRecord &); private: - std::shared_ptr _builder; edm::ParameterSet pset_; }; From 2601b27d471b881287d6fd9743b64c2c4c9d6fb3 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Sun, 28 Jan 2018 00:19:00 +0100 Subject: [PATCH 2/2] remove else clause --- .../plugins/TkTransientTrackingRecHitBuilderESProducer.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc index bf82cab7aafab..a1f579bcac302 100644 --- a/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc +++ b/RecoTracker/TransientTrackingRecHit/plugins/TkTransientTrackingRecHitBuilderESProducer.cc @@ -90,9 +90,8 @@ TkTransientTrackingRecHitBuilderESProducer::produce(const TransientRecHitRecord iRecord.getRecord().get( p2OTname, p2OTe ); p2OTp = p2OTe.product(); return std::make_unique(pDD.product(), pp, p2OTp); - } else { - return std::make_unique(pDD.product(), pp, sp, mp, computeCoarseLocalPositionFromDisk); - } + } + return std::make_unique(pDD.product(), pp, sp, mp, computeCoarseLocalPositionFromDisk); }