23 std::unique_ptr<ApproachDescriptor> ades,
LayerType laytyp)
25 m_surfaceArray(surfaceArray.release()),
26 m_layerThickness(thickness),
27 m_approachDescriptor(nullptr),
28 m_representingVolume(nullptr),
30 m_ssRepresentingSurface(1) {
32 ades->registerLayer(*
this);
43 return m_approachDescriptor.get();
55 assignGeometryId(layerID);
57 Surface* rSurface =
const_cast<Surface*
>(&surfaceRepresentation());
58 if (materialDecorator !=
nullptr) {
59 materialDecorator->
decorate(*rSurface);
66 if (surfaceRepresentation().surfaceMaterial() !=
nullptr) {
67 m_ssRepresentingSurface = 2;
70 if (m_approachDescriptor) {
72 m_ssApproachSurfaces = 1;
75 for (
auto& aSurface : m_approachDescriptor->containedSurfaces()) {
77 auto mutableASurface =
const_cast<Surface*
>(aSurface);
79 if (materialDecorator !=
nullptr) {
80 materialDecorator->
decorate(*mutableASurface);
83 if (aSurface->surfaceMaterial() !=
nullptr) {
84 m_ssApproachSurfaces = 2;
91 m_ssSensitiveSurfaces = 1;
94 for (
auto& sSurface : m_surfaceArray->surfaces()) {
97 auto mutableSSurface =
const_cast<Surface*
>(sSurface);
99 if (materialDecorator !=
nullptr) {
100 materialDecorator->
decorate(*mutableSSurface);
103 if (sSurface->surfaceMaterial() !=
nullptr) {
104 m_ssSensitiveSurfaces = 2;
110 boost::container::small_vector<Acts::SurfaceIntersection, 10>
115 boost::container::small_vector<SurfaceIntersection, 10> sIntersections;
118 if (!m_surfaceArray || !m_approachDescriptor) {
119 return sIntersections;
141 return sIntersections;
149 surfaceRepresentation().pathCorrection(gctx, position, direction);
150 pathLimit = 1.5 *
thickness() * pCorrection;
155 bool sensitive =
false) ->
bool {
170 auto processSurface = [&](
const Surface& sf,
bool sensitive =
false) {
176 if (!acceptSurface(sf, sensitive)) {
183 boundaryCheck =
false;
187 sf.
intersect(gctx, position, direction, boundaryCheck);
188 for (
const auto& sfi : sfmi.
split()) {
193 sIntersections.push_back(sfi);
203 if (m_approachDescriptor &&
206 const std::vector<const Surface*>& approachSurfaces =
207 m_approachDescriptor->containedSurfaces();
211 for (
auto& aSurface : approachSurfaces) {
212 processSurface(*aSurface);
222 const std::vector<const Surface*>& sensitiveSurfaces =
223 m_surfaceArray->neighbors(position);
227 for (
auto& sSurface : sensitiveSurfaces) {
228 processSurface(*sSurface,
true);
235 const Surface* layerSurface = &surfaceRepresentation();
236 processSurface(*layerSurface);
240 sIntersections.begin(), sIntersections.end(),
241 [](
const auto&
a,
const auto&
b) {
return a.object() <
b.object(); });
244 auto it = std::unique(
245 sIntersections.begin(), sIntersections.end(),
247 return a.
object() ==
b.object();
255 std::sort(sIntersections.begin(), sIntersections.end(),
258 return sIntersections;
271 (m_ssSensitiveSurfaces > 1 || m_ssApproachSurfaces > 1 ||
272 (surfaceRepresentation().surfaceMaterial() !=
nullptr));
281 auto findValidIntersection =
283 for (
const auto& sfi : sfmi.split()) {
295 if (m_approachDescriptor && (resolvePS || resolveMS)) {
297 gctx, position, direction, options.
boundaryCheck, pLimit, oLimit,
303 const Surface& rSurface = surfaceRepresentation();
306 return findValidIntersection(sIntersection);