The comparison function defining in what case a PRD is 'smaller' than a second one.
59 {
60
61
62
63 double path1 = 0;
64 const Trk::Surface& sf1 =
one->detectorElement()->surface(
one->identify());
66 switch (surfType1) {
68 const Trk::PlaneSurface& opsf =
69 static_cast<const Trk::PlaneSurface&>(sf1);
71 } break;
73 const Trk::StraightLineSurface& ossf =
74 static_cast<const Trk::StraightLineSurface&>(sf1);
76 } break;
78 const Trk::DiscSurface& odsf =
79 static_cast<const Trk::DiscSurface&>(sf1);
81 } break;
82 default: {
83 throw std::runtime_error(
84 "PrepRawDataComparisonFunction: surface type error!");
85 }
86 }
87
88
89
90 double path2 = 0;
91 const Trk::Surface& sf2 =
two->detectorElement()->surface(
two->identify());
93 switch (surfType2) {
95 const Trk::PlaneSurface& opsf =
96 static_cast<const Trk::PlaneSurface&>(sf2);
98 } break;
100 const Trk::StraightLineSurface& ossf =
101 static_cast<const Trk::StraightLineSurface&>(sf2);
103 } break;
105 const Trk::DiscSurface& odsf =
106 static_cast<const Trk::DiscSurface&>(sf2);
108 } break;
109 default: {
110 throw std::runtime_error(
111 "PrepRawDataComparisonFunction: surface type error!");
112 }
113 }
114
115 return path1 < path2;
116 }
double pathIntersectWithPlane(const Trk::PlaneSurface &psf) const
double pathIntersectWithLine(const Trk::StraightLineSurface &lsf) const
double pathIntersectWithDisc(const Trk::DiscSurface &dsf) const
virtual constexpr SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
SurfaceType
This enumerator simplifies the persistency & calculations,.