From 7f58e94cb6f272e03e18e3cce220e724d9e004ee Mon Sep 17 00:00:00 2001
From: Christos Anastopoulos <christos.anastopoulos@cern.ch>
Date: Mon, 6 Feb 2023 20:33:07 +0100
Subject: [PATCH] Step propagator . Just use value rather than new/delete

Step propagator . Just use value rather than new/delete
---
 .../TrkExSTEP_Propagator/src/STEP_Propagator.cxx       | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx
index 10a81f4bc637..03acd2453d62 100755
--- a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx
+++ b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx
@@ -1883,15 +1883,15 @@ propagateRungeKuttaImpl(Cache& cache,
         const Amg::Vector3D& origin = trackIntersection->position();
         const Amg::Vector3D& direction = trackIntersection->direction();
 
-        PerigeeSurface* perigeeSurface = new PerigeeSurface(origin);
+        auto perigeeSurface = PerigeeSurface(origin);
         auto trackParameters =
-          perigeeSurface->createUniqueTrackParameters(0., 0., direction.phi(), direction.theta(), qOverP, std::nullopt);
+            Trk::Perigee(0., 0., direction.phi(), direction.theta(), qOverP,
+                         perigeeSurface, std::nullopt);
 
         const Trk::IntersectionSolution* solution =
-          qOverP == 0 ? intersect(ctx, *trackParameters, surface, Trk::MagneticFieldProperties(Trk::NoField), particle)
-                      : intersect(ctx, *trackParameters, surface, mft, particle, nullptr);
+          qOverP == 0 ? intersect(ctx, trackParameters, surface, Trk::MagneticFieldProperties(Trk::NoField), particle)
+                      : intersect(ctx, trackParameters, surface, mft, particle, nullptr);
 
-        delete perigeeSurface;
         if (!solution)
           return nullptr;
 
-- 
GitLab