From 6b38d6364a6484c2ee4ea3b850278b59d1ed8521 Mon Sep 17 00:00:00 2001
From: Andreas Salzburger <salzburg@cern.ch>
Date: Fri, 14 Nov 2014 09:07:41 +0100
Subject: [PATCH] Tagging as TrkExRungeKuttaIntersector-00-10-00
 (TrkExRungeKuttaIntersector-00-10-00)

        * adapted to new interface
        * tag as TrkExRungeKuttaIntersector-00-10-00

2014-10-23 Peter Kluit
        * use TrackSurfaceIntersection and Intersection in the Intersector
        * tag as TrkExRungeKuttaIntersector-00-09-04
---
 .../IntersectorWrapper.h                      | 14 ++++----
 .../RungeKuttaIntersector.h                   | 28 +++++++--------
 .../cmt/requirements                          |  1 +
 .../src/IntersectorWrapper.cxx                |  6 ++--
 .../src/RungeKuttaIntersector.cxx             | 34 ++++++++++---------
 5 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/IntersectorWrapper.h b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/IntersectorWrapper.h
index 557bf75a741..6699616b027 100755
--- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/IntersectorWrapper.h
+++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/IntersectorWrapper.h
@@ -108,6 +108,7 @@ public:
 					 BoundaryCheck,
 					 const MagneticFieldProperties&,
 					 TransportJacobian*&,
+                     double&,
 					 ParticleHypothesis,
 					 bool,
 					 const TrackingVolume*) const;
@@ -173,7 +174,6 @@ public:
     
 
 private:
-    typedef	TrackSurfaceIntersection	Intersection;
     
     // private methods
     void			createParameters (const Surface&	surface,
@@ -188,12 +188,12 @@ private:
     ToolHandle<IPropagator>		m_linePropagator;
 
     // current parameter cache
-    mutable double			m_charge;
-    mutable const Intersection*      	m_intersection;
-    mutable Amg::Vector3D		m_momentum;
-    mutable const TrackParameters*	m_parameters;
-    mutable Amg::Vector3D		m_position;
-    mutable double			m_qOverP;
+    mutable double			    m_charge;
+    mutable const TrackSurfaceIntersection* m_intersection;
+    mutable Amg::Vector3D		    m_momentum;
+    mutable const TrackParameters*  	    m_parameters;
+    mutable Amg::Vector3D		    m_position;
+    mutable double			    m_qOverP;
 };
 
 } // end of namespace
diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/RungeKuttaIntersector.h b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/RungeKuttaIntersector.h
index 96ba24ae704..1d890ab43da 100755
--- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/RungeKuttaIntersector.h
+++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/TrkExRungeKuttaIntersector/RungeKuttaIntersector.h
@@ -36,33 +36,33 @@ public:
     StatusCode			finalize();
 
     /**IIntersector interface method for general Surface type */
-    const Intersection*		intersectSurface(const Surface&		surface,
-						 const Intersection*	trackIntersection,
+    const TrackSurfaceIntersection*		intersectSurface(const Surface&		surface,
+						 const TrackSurfaceIntersection*	trackIntersection,
 						 const double      	qOverP);
 	                                     
     /**IIntersector interface method for specific Surface type : PerigeeSurface */
-    const Intersection*		approachPerigeeSurface(const PerigeeSurface&	surface,
-						       const Intersection*	trackIntersection,
+    const TrackSurfaceIntersection*		approachPerigeeSurface(const PerigeeSurface&	surface,
+						       const TrackSurfaceIntersection*	trackIntersection,
 						       const double      	qOverP);
 	
     /**IIntersector interface method for specific Surface type : StraightLineSurface */
-    const Intersection*		approachStraightLineSurface(const StraightLineSurface& surface,
-							    const Intersection*	trackIntersection,
+    const TrackSurfaceIntersection*		approachStraightLineSurface(const StraightLineSurface& surface,
+							    const TrackSurfaceIntersection*	trackIntersection,
 							    const double      	qOverP);
               
     /**IIntersector interface method for specific Surface type : CylinderSurface */
-    const Intersection*		intersectCylinderSurface (const CylinderSurface& surface,
-							  const Intersection*	trackIntersection,
+    const TrackSurfaceIntersection*		intersectCylinderSurface (const CylinderSurface& surface,
+							  const TrackSurfaceIntersection*	trackIntersection,
 							  const double      	qOverP);
 
     /**IIntersector interface method for specific Surface type : DiscSurface */
-    const Intersection*		intersectDiscSurface (const DiscSurface&	surface,
-						      const Intersection*	trackIntersection,
+    const TrackSurfaceIntersection*		intersectDiscSurface (const DiscSurface&	surface,
+						      const TrackSurfaceIntersection*	trackIntersection,
 						      const double      	qOverP);
 
     /**IIntersector interface method for specific Surface type : PlaneSurface */
-    const Intersection*		intersectPlaneSurface(const PlaneSurface&	surface,
-						      const Intersection*	trackIntersection,
+    const TrackSurfaceIntersection*		intersectPlaneSurface(const PlaneSurface&	surface,
+						      const TrackSurfaceIntersection*	trackIntersection,
 						      const double      	qOverP);
  
     /**IIntersector interface method for validity check over a particular extrapolation range */
@@ -84,7 +84,7 @@ private:
 					 const Amg::Vector3D&	planeNormal);
     Amg::Vector3D	field (const Amg::Vector3D& point) const;
     bool		notTrapped (void);
-    void		setCache (const Intersection*	trackIntersection,
+    void		setCache (const TrackSurfaceIntersection*	trackIntersection,
 				  const double		qOverP);
     void		shortStep (void);
     void		step (void);
@@ -221,7 +221,7 @@ RungeKuttaIntersector::field (const Amg::Vector3D& position) const
 }
     
 inline void
-RungeKuttaIntersector::setCache (const Intersection*	trackIntersection,
+RungeKuttaIntersector::setCache (const TrackSurfaceIntersection*	trackIntersection,
 				 const double		qOverP)
 {
     if (trackIntersection->serialNumber() == m_intersectionNumber
diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/cmt/requirements b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/cmt/requirements
index 5c046137f5d..51e382695e7 100755
--- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/cmt/requirements
+++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/cmt/requirements
@@ -6,6 +6,7 @@ private
 use TrkGeometry			TrkGeometry-*			Tracking/TrkDetDescr
 use TrkParameters		TrkParameters-*			Tracking/TrkEvent
 use TrkSurfaces			TrkSurfaces-*			Tracking/TrkDetDescr
+use TrkDetDescrUtils            TrkDetDescrUtils-*              Tracking/TrkDetDescr
 
 public
 use AtlasPolicy			AtlasPolicy-*
diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/IntersectorWrapper.cxx b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/IntersectorWrapper.cxx
index 85a90f95cdb..3afd8035b36 100755
--- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/IntersectorWrapper.cxx
+++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/IntersectorWrapper.cxx
@@ -110,6 +110,7 @@ IntersectorWrapper::propagate (const TrackParameters&		parameters,
 			       BoundaryCheck			boundsCheck,
 			       const MagneticFieldProperties&	/*magProperties*/,
 			       TransportJacobian*&		/*transportJac*/,
+                   double&,
 			       ParticleHypothesis		/*particle*/,
 			       bool				curvilinear,
 			       const TrackingVolume*) const
@@ -216,11 +217,11 @@ IntersectorWrapper::findIntersection (const TrackParameters&	parameters,
 	m_position	=  parameters.position();
 	m_position	=  Amg::Vector3D(parameters.position());
 	m_qOverP	=  1./m_momentum.mag();
-	m_intersection	=  new Intersection(m_position,m_momentum*m_qOverP,0.);
+	m_intersection	=  new TrackSurfaceIntersection(m_position,m_momentum*m_qOverP,0.);
 	m_qOverP	*= m_charge;
     }
 
-    const Intersection* oldIntersection = m_intersection;
+    const TrackSurfaceIntersection* oldIntersection = m_intersection;
     m_intersection = m_intersector->intersectSurface(surface,
 						     oldIntersection,
 						     m_qOverP);
@@ -263,3 +264,4 @@ IntersectorWrapper::findIntersection (const TrackParameters&	parameters,
 }
 
 } // end of namespace
+
diff --git a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/RungeKuttaIntersector.cxx b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/RungeKuttaIntersector.cxx
index ba6095d0d96..38476f56020 100755
--- a/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/RungeKuttaIntersector.cxx
+++ b/Tracking/TrkExtrapolation/TrkExRungeKuttaIntersector/src/RungeKuttaIntersector.cxx
@@ -18,6 +18,8 @@
 #include "TrkSurfaces/PlaneSurface.h"
 #include "TrkSurfaces/StraightLineSurface.h"
 #include "TrkSurfaces/Surface.h"
+#include "TrkDetDescrUtils/Intersection.h"
+
 
 namespace Trk
 {
@@ -149,7 +151,7 @@ RungeKuttaIntersector::finalize()
 /**IIntersector interface method for general Surface type */
 const Trk::TrackSurfaceIntersection*
 RungeKuttaIntersector::intersectSurface(const Surface&		surface,
-					const Intersection*	trackIntersection,
+					const TrackSurfaceIntersection*	trackIntersection,
 					const double      	qOverP)
 {
     // trap low momentum
@@ -181,7 +183,7 @@ RungeKuttaIntersector::intersectSurface(const Surface&		surface,
 /**IIntersector interface method for specific Surface type : PerigeeSurface */
 const Trk::TrackSurfaceIntersection*
 RungeKuttaIntersector::approachPerigeeSurface(const PerigeeSurface&	surface,
-					      const Intersection*	trackIntersection,
+					      const TrackSurfaceIntersection*	trackIntersection,
 					      const double      	qOverP)
 {
     // set member data
@@ -210,9 +212,9 @@ RungeKuttaIntersector::approachPerigeeSurface(const PerigeeSurface&	surface,
     if (m_distance > m_shortStepMin) shortStep();
 
     // ensure intersection is valid (ie. on surface)
-    SurfaceIntersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
+    Intersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
     if (! SLIntersect.valid)		return 0;
-    const Intersection* intersection	= new Intersection(SLIntersect.intersection,
+    const TrackSurfaceIntersection* intersection	= new TrackSurfaceIntersection(SLIntersect.position,
 							   m_direction,
 							   m_pathLength);
     m_intersectionNumber		= intersection->serialNumber();
@@ -222,7 +224,7 @@ RungeKuttaIntersector::approachPerigeeSurface(const PerigeeSurface&	surface,
 /**IIntersector interface method for specific Surface type : StraightLineSurface */
 const Trk::TrackSurfaceIntersection*
 RungeKuttaIntersector::approachStraightLineSurface(const StraightLineSurface&	surface,
-						   const Intersection*		trackIntersection,
+						   const TrackSurfaceIntersection*		trackIntersection,
 						   const double      		qOverP)
 {
     // set member data
@@ -251,9 +253,9 @@ RungeKuttaIntersector::approachStraightLineSurface(const StraightLineSurface&	su
     if (m_distance > m_shortStepMin) shortStep();
     
     // ensure intersection is valid (ie. on surface)
-    SurfaceIntersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
+    Intersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
     if (! SLIntersect.valid)		return 0;
-    const Intersection* intersection	= new Intersection(SLIntersect.intersection,
+    const TrackSurfaceIntersection* intersection	= new TrackSurfaceIntersection(SLIntersect.position,
 							   m_direction,
 							   m_pathLength);
     m_intersectionNumber		= intersection->serialNumber();
@@ -263,7 +265,7 @@ RungeKuttaIntersector::approachStraightLineSurface(const StraightLineSurface&	su
 /**IIntersector interface method for specific Surface type : CylinderSurface */
 const Trk::TrackSurfaceIntersection*
 RungeKuttaIntersector::intersectCylinderSurface (const CylinderSurface&	surface,
-						 const Intersection*	trackIntersection,
+						 const TrackSurfaceIntersection*	trackIntersection,
 						 const double      	qOverP)
 {
     // set member data
@@ -310,9 +312,9 @@ RungeKuttaIntersector::intersectCylinderSurface (const CylinderSurface&	surface,
     if (m_distance > m_shortStepMin) shortStep();
     
     // ensure intersection is valid (ie. on surface)
-    SurfaceIntersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
+    Intersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
     if (! SLIntersect.valid)		return 0;
-    const Intersection* intersection	= new Intersection(SLIntersect.intersection,
+    const TrackSurfaceIntersection* intersection	= new TrackSurfaceIntersection(SLIntersect.position,
 							   m_direction,
 							   m_pathLength);
     m_intersectionNumber		= intersection->serialNumber();
@@ -322,7 +324,7 @@ RungeKuttaIntersector::intersectCylinderSurface (const CylinderSurface&	surface,
 /**IIntersector interface method for specific Surface type : DiscSurface */
 const Trk::TrackSurfaceIntersection*
 RungeKuttaIntersector::intersectDiscSurface (const DiscSurface&		surface,
-					     const Intersection*	trackIntersection,
+					     const TrackSurfaceIntersection*	trackIntersection,
 					     const double      		qOverP)
 {
     setCache(trackIntersection, qOverP);
@@ -349,9 +351,9 @@ RungeKuttaIntersector::intersectDiscSurface (const DiscSurface&		surface,
     if (std::abs(m_stepLength) > m_shortStepMin) shortStep();
         
     // ensure intersection is valid (ie. on surface)
-    SurfaceIntersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
+    Intersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
     if (! SLIntersect.valid)		return 0;
-    const Intersection* intersection	= new Intersection(SLIntersect.intersection,
+    const TrackSurfaceIntersection* intersection	= new TrackSurfaceIntersection(SLIntersect.position,
 							   m_direction,
 							   m_pathLength);
     m_intersectionNumber		= intersection->serialNumber();
@@ -361,7 +363,7 @@ RungeKuttaIntersector::intersectDiscSurface (const DiscSurface&		surface,
 /**IIntersector interface method for specific Surface type : PlaneSurface */
 const Trk::TrackSurfaceIntersection*
 RungeKuttaIntersector::intersectPlaneSurface(const PlaneSurface&	surface,
-					     const Intersection*	trackIntersection,
+					     const TrackSurfaceIntersection*	trackIntersection,
 					     const double      		qOverP)
 {
     // set member data
@@ -389,9 +391,9 @@ RungeKuttaIntersector::intersectPlaneSurface(const PlaneSurface&	surface,
     if (m_distance > m_shortStepMin) shortStep();
     
     // ensure intersection is valid (ie. on surface)
-    SurfaceIntersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
+    Intersection SLIntersect	= surface.straightLineIntersection(m_position, m_direction, false, false);
     if (! SLIntersect.valid)		return 0;
-    const Intersection* intersection	= new Intersection(SLIntersect.intersection,
+    const TrackSurfaceIntersection* intersection	= new TrackSurfaceIntersection(SLIntersect.position,
 							   m_direction,
 							   m_pathLength);
     m_intersectionNumber		= intersection->serialNumber();
-- 
GitLab