155 {
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178 constexpr int otherSideIndex{1};
179 constexpr int maxEtaIndex{3};
181 int nElements = 0;
182
183
184
186 if(elements[n]) {
187 elementIndex[nElements++] =
n;
188 }
189 }
190
191 if(!nElements) return;
192
193
194 const InDetDD::SiDetectorElement* element = elements[0];
195 IdentifierHash Id =
clusters[0]->identifyHash();
196
197 std::vector<SCTinformation> sctInfos;
198 sctInfos.reserve(clusters[0]->
size());
199
200
201 for (const auto *const cluster : *clusters[0]) {
203 std::pair<Amg::Vector3D, Amg::Vector3D > ends(element->
endsOfStrip(InDetDD::SiLocalPosition(locpos.y(),locpos.x(),0.)));
204 InDet::SCTinformation sct(cluster,ends.first, ends.second, vertexVec,locpos.x());
205 sctInfos.push_back(sct);
206 }
207
209 double slimit = 0. ;
210 std::vector<Trk::SpacePoint*> tmpSpacePoints;
211 tmpSpacePoints.reserve(sctInfos.size());
212
213 if(!allClusters) {
214
215
217 for(;
n < nElements; ++
n) {
218
219 int currentIndex = elementIndex[
n];
220
221 if(currentIndex > maxEtaIndex) break;
222
223
224 const InDetDD::SiDetectorElement* currentElement = elements[currentIndex];
225 IdentifierHash currentId =
clusters[currentIndex]->identifyHash();
226
227
228 double min = overlapExtents[currentIndex*2-2];
229 double max = overlapExtents[currentIndex*2-1];
230
233 }
234
235
236
237
238
239
240
241 double lx1_offset = 0.;
246 }
247
248
249 InDet::SCTinformation sctInfo;
250 for (const auto *const cluster : *clusters[currentIndex]) {
251
252 bool processed = false;
254 double lx1 = locpos.x();
255
256
257 for(auto& sct : sctInfos) {
258
259 double diff = lx1+lx1_offset-sct.locX();
260
261
262
264
266
267 if (not processed) {
268 processed = true;
269 std::pair<Amg::Vector3D, Amg::Vector3D > ends(currentElement->
endsOfStrip(InDetDD::SiLocalPosition(locpos.y(),locpos.x(),0.)));
270 sctInfo.
set(cluster,ends.first, ends.second, vertexVec,lx1);
271 }
272
274 sct, sctInfo, Id, currentId, limit, slimit, dataItemsSCT);
276 tmpSpacePoints.push_back(
sp);
277 }
278 }
279 }
280
281
282 if( currentIndex==otherSideIndex && !tmpSpacePoints.empty() ) {
283 spacepointCollection->
reserve(tmpSpacePoints.size()+spacepointCollection->
size());
284 for (Trk::SpacePoint*
sp: tmpSpacePoints) {
286 }
287 tmpSpacePoints.clear();
288 }
289 }
290
291
292
293 for(;
n < nElements; ++
n) {
294
295 int currentIndex = elementIndex[
n];
296 const InDetDD::SiDetectorElement* currentElement = elements[currentIndex];
297
298 double min = overlapExtents[4*currentIndex-10];
299 double max = overlapExtents[4*currentIndex- 9];
300
303 }
304
305 std::vector<SCTinformation*> sctPhiInfos;
306 sctPhiInfos.reserve(sctInfos.size());
307
308 for(auto& sct : sctInfos) {
309 double lx0 = sct.locX();
310 if (
min <= lx0 && lx0 <=
max) {
311 sctPhiInfos.push_back(&sct);
312 }
313 }
314
315 if(sctPhiInfos.empty()) continue;
316
317 IdentifierHash currentId =
clusters[currentIndex]->identifyHash();
318
319 min = overlapExtents[4*currentIndex-8];
320 max = overlapExtents[4*currentIndex-7];
321
324 }
325
326 for (const auto *const cluster : *clusters[currentIndex]) {
327
329 double lx1 = locpos.x();
330 if(lx1 < min || lx1 >
max )
continue;
331
332 std::pair<Amg::Vector3D, Amg::Vector3D > ends(currentElement->
endsOfStrip(InDetDD::SiLocalPosition(locpos.y(),locpos.x(),0.)));
333 InDet::SCTinformation sctInfo(cluster,ends.first, ends.second, vertexVec,lx1);
334
335 for(auto& sct : sctPhiInfos) {
337 *sct, sctInfo, Id, currentId, limit, slimit, dataItemsSCT);
339 tmpSpacePoints.push_back(
sp);
340 }
341 }
342 }
343 }
344
345
346 if(!tmpSpacePoints.empty()) {
347 spacepointoverlapCollection->
reserve(tmpSpacePoints.size()+spacepointoverlapCollection->
size());
348 for (Trk::SpacePoint*
sp: tmpSpacePoints) {
350 }
351 }
352 return;
353 }
354
355
356
357 for(
int n=0;
n!=nElements; ++
n) {
358
359 int currentIndex = elementIndex[
n];
360 const InDetDD::SiDetectorElement* currentElement = elements[currentIndex];
361 IdentifierHash currentId =
clusters[currentIndex]->identifyHash();
362
364 offset(element, currentElement, slimit);
365 }
366
367 for (const auto *const cluster : *clusters[currentIndex]) {
368
370 std::pair<Amg::Vector3D, Amg::Vector3D > ends(currentElement->
endsOfStrip(InDetDD::SiLocalPosition(locpos.y(),locpos.x(),0.)));
371 InDet::SCTinformation sctInfo(cluster,ends.first, ends.second,vertexVec,locpos.x());
372
373 for(auto& sct : sctInfos) {
376 tmpSpacePoints.push_back(
sp);
377 }
378 }
379 }
380
381
382 if( currentIndex==otherSideIndex && !tmpSpacePoints.empty() ) {
383 spacepointCollection->
reserve(tmpSpacePoints.size()+spacepointCollection->
size());
384 for (Trk::SpacePoint*
sp: tmpSpacePoints) {
386 }
387 tmpSpacePoints.clear();
388 }
389 }
390
391 if(!tmpSpacePoints.empty()) {
392 spacepointoverlapCollection->
reserve(tmpSpacePoints.size()+spacepointoverlapCollection->
size());
393 for (Trk::SpacePoint*
sp: tmpSpacePoints) {
395 }
396 }
397 }
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
std::pair< Amg::Vector3D, Amg::Vector3D > endsOfStrip(const Amg::Vector2D &position) const
Special method for SCT to retrieve the two ends of a "strip" Returned coordinates are in global frame...
virtual Identifier identify() const override final
identifier of this detector element (inline)
Eigen::Matrix< double, 2, 1 > Vector2D