From 9f51413875012c200d51d4ed26bd4ec8374217d1 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Thu, 27 Sep 2018 11:09:03 -0700 Subject: [PATCH] PhotonIDValueMapProducer use auto const ref to avoid unnecessary object copies --- .../PhotonIdentification/plugins/PhotonIDValueMapProducer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RecoEgamma/PhotonIdentification/plugins/PhotonIDValueMapProducer.cc b/RecoEgamma/PhotonIdentification/plugins/PhotonIDValueMapProducer.cc index a8731af079deb..4885725d0d0bd 100644 --- a/RecoEgamma/PhotonIdentification/plugins/PhotonIDValueMapProducer.cc +++ b/RecoEgamma/PhotonIdentification/plugins/PhotonIDValueMapProducer.cc @@ -416,11 +416,11 @@ void PhotonIDValueMapProducer::getImpactParameters( const edm::Ptr& candidate, const reco::Vertex& pv, float& dxy, float& dz) { if (isAOD_) { - auto theTrack = *static_cast>(candidate)->trackRef(); + auto const& theTrack = *static_cast>(candidate)->trackRef(); dxy = theTrack.dxy(pv.position()); dz = theTrack.dz(pv.position()); } else { - auto aCand = *static_cast>(candidate); + auto const& aCand = *static_cast>(candidate); dxy = aCand.dxy(pv.position()); dz = aCand.dz(pv.position()); }