75{
76
78 static const PixelID* const pixIdHelper = getPixelID(detStore);
79 static const SCT_ID* const sctIdHelper = getSCT_ID(detStore);
80
81
82 const InDetDD::SiDetectorElement* pElement = dynamic_cast<const InDetDD::SiDetectorElement*>(tsf.associatedDetectorElement());
83
84
85 surfaces.emplace_back(Trk::Intersection(pos, 0., true),&tsf);
86 int etaModule =
88 ? pixIdHelper->
eta_module(tsf.associatedDetectorElementIdentifier())
89 : sctIdHelper->
eta_module(tsf.associatedDetectorElementIdentifier());
90
91
92 if (pElement) {
93 size_t newCapacity = surfaces.size() + 19;
94 if (pElement->
otherSide()) newCapacity += 19;
95 surfaces.reserve(newCapacity);
96
98
101
104
105
106
107
108
109
110
111
112
114
115 const Trk::Surface* samePhi_PrevEta = nullptr;
116 const Trk::Surface* samePhi_NextEta = nullptr;
117
118 const Trk::Surface* previousPhi_PrevEta = nullptr;
119 const Trk::Surface* nextPhi_PrevEta = nullptr;
120
121 const Trk::Surface* previousPhi_NextEta = nullptr;
122 const Trk::Surface* nextPhi_NextEta = nullptr;
123
124 std::span<Trk::Surface const * const> surf =
m_bin_array->arrayObjects();
130 (*(surf[offset])).associatedDetectorElementIdentifier())
132 (*(surf[offset])).associatedDetectorElementIdentifier());
133
134 if (etamod == etaModule || etamod < (etaModule - 1) ||
135 etamod > (etaModule + 1)) {
137 continue;
138 }
139
140 double PrevDeltaPhi = 9999.;
141 double NextDeltaPhi = -9999.;
143 if (etamod == (etaModule-1) ) {
144 if( tsf.center().phi() == (*(surf[
ss])).center().phi() )
145 samePhi_PrevEta = surf[
ss];
146 double DeltaPhi = tsf.center().phi() - (*(surf[
ss])).center().phi();
147 if( DeltaPhi < PrevDeltaPhi && DeltaPhi > 0) {
148 previousPhi_PrevEta = surf[
ss];
149 PrevDeltaPhi = DeltaPhi;
150 }
151 if( DeltaPhi > NextDeltaPhi && DeltaPhi < 0) {
152 nextPhi_PrevEta = surf[
ss];
153 NextDeltaPhi = DeltaPhi;
154 }
155 } else if (etamod == (etaModule+1) ) {
156 if( tsf.center().phi() == (*(surf[
ss])).center().phi() )
157 samePhi_NextEta = surf[
ss];
158 double DeltaPhi = tsf.center().phi() - (*(surf[
ss])).center().phi();
159 if( DeltaPhi < PrevDeltaPhi && DeltaPhi > 0) {
160 previousPhi_NextEta = surf[
ss];
161 PrevDeltaPhi = DeltaPhi;
162 }
163
164 if( DeltaPhi > NextDeltaPhi && DeltaPhi < 0) {
165 nextPhi_NextEta = surf[
ss];
166 NextDeltaPhi = DeltaPhi;
167 }
168 }
169 }
171 }
172
173 if (samePhi_PrevEta) {
174 const InDetDD::SiDetectorElement* PhiEta_Element =
dynamic_cast<const InDetDD::SiDetectorElement*
>(samePhi_PrevEta->
associatedDetectorElement());
175 if (PhiEta_Element) {
178 }
179 }
180
181 if (previousPhi_PrevEta) {
182 const InDetDD::SiDetectorElement* PhiEta_Element =
dynamic_cast<const InDetDD::SiDetectorElement*
>(previousPhi_PrevEta->
associatedDetectorElement());
183 if (PhiEta_Element) {
186
189 }
190 }
191
192 if (nextPhi_PrevEta) {
193 const InDetDD::SiDetectorElement* PhiEta_Element =
dynamic_cast<const InDetDD::SiDetectorElement*
>(nextPhi_PrevEta->
associatedDetectorElement());
194 if (PhiEta_Element) {
197
200 }
201 }
202
203 if (samePhi_NextEta) {
204 const InDetDD::SiDetectorElement* PhiEta_Element =
dynamic_cast<const InDetDD::SiDetectorElement*
>(samePhi_NextEta->
associatedDetectorElement());
205 if (PhiEta_Element) {
208 }
209 }
210
211 if (previousPhi_NextEta) {
212 const InDetDD::SiDetectorElement* PhiEta_Element =
dynamic_cast<const InDetDD::SiDetectorElement*
>(previousPhi_NextEta->
associatedDetectorElement());
213 if (PhiEta_Element) {
216
219 }
220 }
221
222 if (nextPhi_NextEta) {
223 const InDetDD::SiDetectorElement* PhiEta_Element =
dynamic_cast<const InDetDD::SiDetectorElement*
>(nextPhi_NextEta->
associatedDetectorElement());
224 if (PhiEta_Element) {
227
230 }
231 }
232 }
233 }
234
235 return false;
236
237}
#define addNextInPhiDO(cur, surfaces)
#define addPrevInPhiDO(cur, surfaces)
#define addSurfaceDO(cur, surfaces)
#define addOtherSideDO(cur, surfaces)
static const std::vector< std::string > bins
const SiDetectorElement * prevInPhi() const
const SiDetectorElement * nextInPhi() const
const SiDetectorElement * otherSide() const
Useful for SCT only.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
etamod(flags, cells_name, *args, **kw)