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()); }