34{
35
36 cSurfaces.emplace_back(Trk::Intersection(pos, 0., true), &tsf);
37
38
39 const auto*
tmp = tsf.associatedDetectorElement();
40 const InDetDD::SiDetectorElement* sElement =
42 ?
static_cast<const InDetDD::SiDetectorElement*
>(
tmp)
43 : nullptr;
44
45 if (sElement) {
46
47 size_t newCapacity = cSurfaces.size() + 2;
49
50
53 newCapacity += 16;
54 } else {
55 newCapacity += 6;
56 }
57 cSurfaces.reserve(newCapacity);
58
60 double surfacePhi = tsf.center().phi() +
M_PI;
61 double positionPhi =
pos.phi() +
M_PI;
62
63
65
66
67
68 const InDetDD::SiDetectorElement* nElement = nullptr;
69
70
74
77
81
85
87 unsigned int next = 1;
88 const InDetDD::SiDetectorElement* currentElement = sElement->
nextInEta();
89 while (currentElement and next<(
unsigned int)
m_etaSlices) {
91 currentElement = currentElement->
nextInEta();
92 if (currentElement) {
95 }
97 }
98
99 unsigned int prev = 1;
101 while (currentElement and prev<(
unsigned int)
m_etaSlices) {
103 currentElement = currentElement->
prevInEta();
104 if (currentElement) {
107 }
108 prev++;
109 }
110 }
111
112 } else {
113
114 if (surfacePhi < positionPhi) {
117 } else {
120 }
121
122 double positionEta =
pos.eta();
123 double surfaceEta = tsf.center().eta();
124 int side = (sElement->
isBarrel() || surfaceEta > 0.) ? 1 : -1;
125
126 if (side * surfaceEta < side * positionEta) {
127
130 } else {
131
134 }
135 }
136 }
137
138 return false;
139}
#define addOtherSide(cur, surfaces)
#define addNextInPhiOS(cur, surfaces)
#define addPrevInEtaOS(cur, surfaces)
#define addPrevInPhiOS(cur, surfaces)
#define addNextInEtaOS(cur, surfaces)
const SiDetectorElement * prevInPhi() const
const SiDetectorElement * nextInPhi() const
const SiDetectorElement * prevInEta() const
const SiDetectorElement * nextInEta() const