CMS 3D CMS Logo

Triplet.h
Go to the documentation of this file.
1 #ifndef RecoTracker_LSTCore_src_alpaka_Triplet_h
2 #define RecoTracker_LSTCore_src_alpaka_Triplet_h
3 
5 
10 
11 #include "Segment.h"
12 #include "MiniDoublet.h"
13 #include "Hit.h"
14 
16 
17  ALPAKA_FN_ACC ALPAKA_FN_INLINE void addTripletToMemory(ModulesConst modules,
19  SegmentsConst segments,
20  Triplets& triplets,
21  unsigned int innerSegmentIndex,
22  unsigned int outerSegmentIndex,
23  uint16_t innerInnerLowerModuleIndex,
24  uint16_t middleLowerModuleIndex,
25  uint16_t outerOuterLowerModuleIndex,
26 #ifdef CUT_VALUE_DEBUG
27  float zOut,
28  float rtOut,
29 #endif
30  float betaIn,
31  float betaInCut,
32  float circleRadius,
33  float circleCenterX,
34  float circleCenterY,
35  unsigned int tripletIndex) {
36  triplets.segmentIndices()[tripletIndex][0] = innerSegmentIndex;
37  triplets.segmentIndices()[tripletIndex][1] = outerSegmentIndex;
38  triplets.lowerModuleIndices()[tripletIndex][0] = innerInnerLowerModuleIndex;
39  triplets.lowerModuleIndices()[tripletIndex][1] = middleLowerModuleIndex;
40  triplets.lowerModuleIndices()[tripletIndex][2] = outerOuterLowerModuleIndex;
41 
42  triplets.betaIn()[tripletIndex] = __F2H(betaIn);
43  triplets.radius()[tripletIndex] = circleRadius;
44  triplets.centerX()[tripletIndex] = circleCenterX;
45  triplets.centerY()[tripletIndex] = circleCenterY;
46  triplets.logicalLayers()[tripletIndex][0] =
47  modules.layers()[innerInnerLowerModuleIndex] + (modules.subdets()[innerInnerLowerModuleIndex] == 4) * 6;
48  triplets.logicalLayers()[tripletIndex][1] =
49  modules.layers()[middleLowerModuleIndex] + (modules.subdets()[middleLowerModuleIndex] == 4) * 6;
50  triplets.logicalLayers()[tripletIndex][2] =
51  modules.layers()[outerOuterLowerModuleIndex] + (modules.subdets()[outerOuterLowerModuleIndex] == 4) * 6;
52  //get the hits
53  unsigned int firstMDIndex = segments.mdIndices()[innerSegmentIndex][0];
54  unsigned int secondMDIndex = segments.mdIndices()[innerSegmentIndex][1];
55  unsigned int thirdMDIndex = segments.mdIndices()[outerSegmentIndex][1];
56 
57  triplets.hitIndices()[tripletIndex][0] = mds.anchorHitIndices()[firstMDIndex];
58  triplets.hitIndices()[tripletIndex][1] = mds.outerHitIndices()[firstMDIndex];
59  triplets.hitIndices()[tripletIndex][2] = mds.anchorHitIndices()[secondMDIndex];
60  triplets.hitIndices()[tripletIndex][3] = mds.outerHitIndices()[secondMDIndex];
61  triplets.hitIndices()[tripletIndex][4] = mds.anchorHitIndices()[thirdMDIndex];
62  triplets.hitIndices()[tripletIndex][5] = mds.outerHitIndices()[thirdMDIndex];
63 #ifdef CUT_VALUE_DEBUG
64  triplets.zOut()[tripletIndex] = zOut;
65  triplets.rtOut()[tripletIndex] = rtOut;
66  triplets.betaInCut()[tripletIndex] = betaInCut;
67 #endif
68  }
69 
70  template <typename TAcc>
71  ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passRZConstraint(TAcc const& acc,
74  uint16_t innerInnerLowerModuleIndex,
75  uint16_t middleLowerModuleIndex,
76  uint16_t outerOuterLowerModuleIndex,
77  unsigned int firstMDIndex,
78  unsigned int secondMDIndex,
79  unsigned int thirdMDIndex) {
80  //get the rt and z
81  const float& r1 = mds.anchorRt()[firstMDIndex];
82  const float& r2 = mds.anchorRt()[secondMDIndex];
83  const float& r3 = mds.anchorRt()[thirdMDIndex];
84 
85  const float& z1 = mds.anchorZ()[firstMDIndex];
86  const float& z2 = mds.anchorZ()[secondMDIndex];
87  const float& z3 = mds.anchorZ()[thirdMDIndex];
88 
89  // Using lst_layer numbering convention defined in ModuleMethods.h
90  const int layer1 = modules.lstLayers()[innerInnerLowerModuleIndex];
91  const int layer2 = modules.lstLayers()[middleLowerModuleIndex];
92  const int layer3 = modules.lstLayers()[outerOuterLowerModuleIndex];
93 
94  const float residual = z2 - ((z3 - z1) / (r3 - r1) * (r2 - r1) + z1);
95 
96  if (layer1 == 12 and layer2 == 13 and layer3 == 14) {
97  return false;
98  } else if (layer1 == 1 and layer2 == 2 and layer3 == 3) {
99  return alpaka::math::abs(acc, residual) < 0.53f;
100  } else if (layer1 == 1 and layer2 == 2 and layer3 == 7) {
101  return alpaka::math::abs(acc, residual) < 1;
102  } else if (layer1 == 13 and layer2 == 14 and layer3 == 15) {
103  return false;
104  } else if (layer1 == 14 and layer2 == 15 and layer3 == 16) {
105  return false;
106  } else if (layer1 == 1 and layer2 == 7 and layer3 == 8) {
107  return alpaka::math::abs(acc, residual) < 1;
108  } else if (layer1 == 2 and layer2 == 3 and layer3 == 4) {
109  return alpaka::math::abs(acc, residual) < 1.21f;
110  } else if (layer1 == 2 and layer2 == 3 and layer3 == 7) {
111  return alpaka::math::abs(acc, residual) < 1.f;
112  } else if (layer1 == 2 and layer2 == 7 and layer3 == 8) {
113  return alpaka::math::abs(acc, residual) < 1.f;
114  } else if (layer1 == 3 and layer2 == 4 and layer3 == 5) {
115  return alpaka::math::abs(acc, residual) < 2.7f;
116  } else if (layer1 == 4 and layer2 == 5 and layer3 == 6) {
117  return alpaka::math::abs(acc, residual) < 3.06f;
118  } else if (layer1 == 7 and layer2 == 8 and layer3 == 9) {
119  return alpaka::math::abs(acc, residual) < 1;
120  } else if (layer1 == 8 and layer2 == 9 and layer3 == 10) {
121  return alpaka::math::abs(acc, residual) < 1;
122  } else if (layer1 == 9 and layer2 == 10 and layer3 == 11) {
123  return alpaka::math::abs(acc, residual) < 1;
124  } else {
125  return alpaka::math::abs(acc, residual) < 5;
126  }
127  }
128 
129  template <typename TAcc>
130  ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPointingConstraintBBB(TAcc const& acc,
132  MiniDoubletsConst mds,
133  SegmentsConst segments,
134  uint16_t innerInnerLowerModuleIndex,
135  uint16_t middleLowerModuleIndex,
136  uint16_t outerOuterLowerModuleIndex,
137  unsigned int firstMDIndex,
138  unsigned int secondMDIndex,
139  unsigned int thirdMDIndex,
140  float& zOut,
141  float& rtOut,
142  unsigned int innerSegmentIndex,
143  float& betaIn,
144  float& betaInCut) {
145  bool isPSIn = (modules.moduleType()[innerInnerLowerModuleIndex] == PS);
146  bool isPSOut = (modules.moduleType()[outerOuterLowerModuleIndex] == PS);
147 
148  float rtIn = mds.anchorRt()[firstMDIndex];
149  float rtMid = mds.anchorRt()[secondMDIndex];
150  rtOut = mds.anchorRt()[thirdMDIndex];
151 
152  float zIn = mds.anchorZ()[firstMDIndex];
153  float zMid = mds.anchorZ()[secondMDIndex];
154  zOut = mds.anchorZ()[thirdMDIndex];
155 
156  float alpha1GeVOut = alpaka::math::asin(acc, alpaka::math::min(acc, rtOut * k2Rinv1GeVf / ptCut, kSinAlphaMax));
157 
158  float rtRatio_OutIn = rtOut / rtIn; // Outer segment beginning rt divided by inner segment beginning rt;
159  float dzDrtScale = alpaka::math::tan(acc, alpha1GeVOut) / alpha1GeVOut; // The track can bend in r-z plane slightly
160  float zpitchIn = (isPSIn ? kPixelPSZpitch : kStrip2SZpitch);
161  float zpitchOut = (isPSOut ? kPixelPSZpitch : kStrip2SZpitch);
162 
163  const float zHi =
164  zIn + (zIn + kDeltaZLum) * (rtRatio_OutIn - 1.f) * (zIn < 0.f ? 1.f : dzDrtScale) + (zpitchIn + zpitchOut);
165  const float zLo = zIn + (zIn - kDeltaZLum) * (rtRatio_OutIn - 1.f) * (zIn > 0.f ? 1.f : dzDrtScale) -
166  (zpitchIn + zpitchOut); //slope-correction only on outer end
167 
168  //Cut 1 - z compatibility
169  if ((zOut < zLo) || (zOut > zHi))
170  return false;
171 
172  float drt_OutIn = (rtOut - rtIn);
173 
174  float r3In = alpaka::math::sqrt(acc, zIn * zIn + rtIn * rtIn);
175  float drt_InSeg = rtMid - rtIn;
176  float dz_InSeg = zMid - zIn;
177  float dr3_InSeg =
178  alpaka::math::sqrt(acc, rtMid * rtMid + zMid * zMid) - alpaka::math::sqrt(acc, rtIn * rtIn + zIn * zIn);
179 
180  float coshEta = dr3_InSeg / drt_InSeg;
181  float dzErr = (zpitchIn + zpitchOut) * (zpitchIn + zpitchOut) * 2.f;
182 
183  float thetaMuls2 = (kMulsInGeV * kMulsInGeV) * (0.1f + 0.2f * (rtOut - rtIn) / 50.f) * (r3In / rtIn);
184  float muls2 = thetaMuls2 * 9.f / (ptCut * ptCut) * 16.f;
185  dzErr += muls2 * drt_OutIn * drt_OutIn / 3.f * coshEta * coshEta;
187 
188  // Constructing upper and lower bound
189  const float dzMean = dz_InSeg / drt_InSeg * drt_OutIn;
190  const float zWindow = dzErr / drt_InSeg * drt_OutIn +
191  (zpitchIn + zpitchOut); //FIXME for ptCut lower than ~0.8 need to add curv path correction
192  const float zLoPointed = zIn + dzMean * (zIn > 0.f ? 1.f : dzDrtScale) - zWindow;
193  const float zHiPointed = zIn + dzMean * (zIn < 0.f ? 1.f : dzDrtScale) + zWindow;
194 
195  // Constructing upper and lower bound
196 
197  // Cut #2: Pointed Z (Inner segment two MD points to outer segment inner MD)
198  if ((zOut < zLoPointed) || (zOut > zHiPointed))
199  return false;
200 
201  // raw betaIn value without any correction, based on the mini-doublet hit positions
202  float alpha_InLo = __H2F(segments.dPhiChanges()[innerSegmentIndex]);
203  float tl_axis_x = mds.anchorX()[thirdMDIndex] - mds.anchorX()[firstMDIndex];
204  float tl_axis_y = mds.anchorY()[thirdMDIndex] - mds.anchorY()[firstMDIndex];
205  betaIn = alpha_InLo - phi_mpi_pi(acc, phi(acc, tl_axis_x, tl_axis_y) - mds.anchorPhi()[firstMDIndex]);
206 
207  //beta computation
208  float drt_tl_axis = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y);
209 
210  //innerOuterAnchor - innerInnerAnchor
211  const float rt_InSeg = alpaka::math::sqrt(acc,
212  (mds.anchorX()[secondMDIndex] - mds.anchorX()[firstMDIndex]) *
213  (mds.anchorX()[secondMDIndex] - mds.anchorX()[firstMDIndex]) +
214  (mds.anchorY()[secondMDIndex] - mds.anchorY()[firstMDIndex]) *
215  (mds.anchorY()[secondMDIndex] - mds.anchorY()[firstMDIndex]));
216  betaInCut =
217  alpaka::math::asin(acc, alpaka::math::min(acc, (-rt_InSeg + drt_tl_axis) * k2Rinv1GeVf / ptCut, kSinAlphaMax)) +
218  (0.02f / drt_InSeg);
219 
220  //Cut #3: first beta cut
221  return alpaka::math::abs(acc, betaIn) < betaInCut;
222  }
223 
224  template <typename TAcc>
225  ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPointingConstraintBBE(TAcc const& acc,
227  MiniDoubletsConst mds,
228  SegmentsConst segments,
229  uint16_t innerInnerLowerModuleIndex,
230  uint16_t middleLowerModuleIndex,
231  uint16_t outerOuterLowerModuleIndex,
232  unsigned int firstMDIndex,
233  unsigned int secondMDIndex,
234  unsigned int thirdMDIndex,
235  float& zOut,
236  float& rtOut,
237  uint16_t innerOuterLowerModuleIndex,
238  unsigned int innerSegmentIndex,
239  unsigned int outerSegmentIndex,
240  float& betaIn,
241  float& betaInCut) {
242  bool isPSIn = (modules.moduleType()[innerInnerLowerModuleIndex] == PS);
243  bool isPSOut = (modules.moduleType()[outerOuterLowerModuleIndex] == PS);
244 
245  float rtIn = mds.anchorRt()[firstMDIndex];
246  float rtMid = mds.anchorRt()[secondMDIndex];
247  rtOut = mds.anchorRt()[thirdMDIndex];
248 
249  float zIn = mds.anchorZ()[firstMDIndex];
250  float zMid = mds.anchorZ()[secondMDIndex];
251  zOut = mds.anchorZ()[thirdMDIndex];
252 
253  float alpha1GeV_OutLo = alpaka::math::asin(acc, alpaka::math::min(acc, rtOut * k2Rinv1GeVf / ptCut, kSinAlphaMax));
254 
255  float dzDrtScale =
256  alpaka::math::tan(acc, alpha1GeV_OutLo) / alpha1GeV_OutLo; // The track can bend in r-z plane slightly
257  float zpitchIn = (isPSIn ? kPixelPSZpitch : kStrip2SZpitch);
258  float zpitchOut = (isPSOut ? kPixelPSZpitch : kStrip2SZpitch);
259  float zGeom = zpitchIn + zpitchOut;
260 
261  // Cut #0: Preliminary (Only here in endcap case)
262  if (zIn * zOut <= 0)
263  return false;
264 
265  float dLum = alpaka::math::copysign(acc, kDeltaZLum, zIn);
266  bool isOutSgInnerMDPS = modules.moduleType()[outerOuterLowerModuleIndex] == PS;
267  float rtGeom1 = isOutSgInnerMDPS ? kPixelPSZpitch : kStrip2SZpitch;
268  float zGeom1 = alpaka::math::copysign(acc, zGeom, zIn);
269  float rtLo = rtIn * (1.f + (zOut - zIn - zGeom1) / (zIn + zGeom1 + dLum) / dzDrtScale) -
270  rtGeom1; //slope correction only on the lower end
271 
272  //Cut #1: rt condition
273  float zInForHi = zIn - zGeom1 - dLum;
274  if (zInForHi * zIn < 0) {
275  zInForHi = alpaka::math::copysign(acc, 0.1f, zIn);
276  }
277  float rtHi = rtIn * (1.f + (zOut - zIn + zGeom1) / zInForHi) + rtGeom1;
278 
279  //Cut #2: rt condition
280  if ((rtOut < rtLo) || (rtOut > rtHi))
281  return false;
282 
283  float rIn = alpaka::math::sqrt(acc, zIn * zIn + rtIn * rtIn);
284 
285  const float drtSDIn = rtMid - rtIn;
286  const float dzSDIn = zMid - zIn;
287  const float dr3SDIn =
288  alpaka::math::sqrt(acc, rtMid * rtMid + zMid * zMid) - alpaka::math::sqrt(acc, rtIn * rtIn + zIn * zIn);
289 
290  const float coshEta = dr3SDIn / drtSDIn; //direction estimate
291  const float dzOutInAbs = alpaka::math::abs(acc, zOut - zIn);
292  const float multDzDr = dzOutInAbs * coshEta / (coshEta * coshEta - 1.f);
293  const float zGeom1_another = kPixelPSZpitch;
294  const float kZ = (zOut - zIn) / dzSDIn;
295  float drtErr =
296  zGeom1_another * zGeom1_another * drtSDIn * drtSDIn / dzSDIn / dzSDIn * (1.f - 2.f * kZ + 2.f * kZ * kZ);
297  const float thetaMuls2 = (kMulsInGeV * kMulsInGeV) * (0.1f + 0.2 * (rtOut - rtIn) / 50.f) * (rIn / rtIn);
298  const float muls2 = thetaMuls2 * 9.f / (ptCut * ptCut) * 16.f;
299  drtErr += muls2 * multDzDr * multDzDr / 3.f * coshEta * coshEta;
300  drtErr = alpaka::math::sqrt(acc, drtErr);
301 
302  //Cut #3: rt-z pointed
303 
304  if ((kZ < 0) || (rtOut < rtLo) || (rtOut > rtHi))
305  return false;
306 
307  float rt_InLo = mds.anchorRt()[firstMDIndex];
308  float rt_InOut = mds.anchorRt()[secondMDIndex];
309 
310  float sdIn_alpha = __H2F(segments.dPhiChanges()[innerSegmentIndex]);
311 
312  float tl_axis_x = mds.anchorX()[thirdMDIndex] - mds.anchorX()[firstMDIndex];
313  float tl_axis_y = mds.anchorY()[thirdMDIndex] - mds.anchorY()[firstMDIndex];
314 
315  betaIn = sdIn_alpha - phi_mpi_pi(acc, phi(acc, tl_axis_x, tl_axis_y) - mds.anchorPhi()[firstMDIndex]);
316 
317  float betaInRHmin = betaIn;
318  float betaInRHmax = betaIn;
319 
320  float swapTemp;
321 
322  if (alpaka::math::abs(acc, betaInRHmin) > alpaka::math::abs(acc, betaInRHmax)) {
323  swapTemp = betaInRHmin;
324  betaInRHmin = betaInRHmax;
325  betaInRHmax = swapTemp;
326  }
327 
328  float sdIn_dr = alpaka::math::sqrt(acc,
329  (mds.anchorX()[secondMDIndex] - mds.anchorX()[firstMDIndex]) *
330  (mds.anchorX()[secondMDIndex] - mds.anchorX()[firstMDIndex]) +
331  (mds.anchorY()[secondMDIndex] - mds.anchorY()[firstMDIndex]) *
332  (mds.anchorY()[secondMDIndex] - mds.anchorY()[firstMDIndex]));
333  float sdIn_d = rt_InOut - rt_InLo;
334 
335  float dr = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y);
336  betaInCut = alpaka::math::asin(acc, alpaka::math::min(acc, (-sdIn_dr + dr) * k2Rinv1GeVf / ptCut, kSinAlphaMax)) +
337  (0.02f / sdIn_d);
338 
339  //Cut #4: first beta cut
340  return alpaka::math::abs(acc, betaInRHmin) < betaInCut;
341  }
342 
343  template <typename TAcc>
344  ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPointingConstraintEEE(TAcc const& acc,
346  MiniDoubletsConst mds,
347  SegmentsConst segments,
348  uint16_t innerInnerLowerModuleIndex,
349  uint16_t middleLowerModuleIndex,
350  uint16_t outerOuterLowerModuleIndex,
351  unsigned int firstMDIndex,
352  unsigned int secondMDIndex,
353  unsigned int thirdMDIndex,
354  float& zOut,
355  float& rtOut,
356  unsigned int innerSegmentIndex,
357  unsigned int outerSegmentIndex,
358  float& betaIn,
359  float& betaInCut) {
360  float rtIn = mds.anchorRt()[firstMDIndex];
361  float rtMid = mds.anchorRt()[secondMDIndex];
362  rtOut = mds.anchorRt()[thirdMDIndex];
363 
364  float zIn = mds.anchorZ()[firstMDIndex];
365  float zMid = mds.anchorZ()[secondMDIndex];
366  zOut = mds.anchorZ()[thirdMDIndex];
367 
368  float alpha1GeV_Out = alpaka::math::asin(acc, alpaka::math::min(acc, rtOut * k2Rinv1GeVf / ptCut, kSinAlphaMax));
369 
370  float dzDrtScale =
371  alpaka::math::tan(acc, alpha1GeV_Out) / alpha1GeV_Out; // The track can bend in r-z plane slightly
372 
373  // Cut #0: Preliminary (Only here in endcap case)
374  if (zIn * zOut <= 0)
375  return false;
376 
377  float dLum = alpaka::math::copysign(acc, kDeltaZLum, zIn);
378  bool isOutSgOuterMDPS = modules.moduleType()[outerOuterLowerModuleIndex] == PS;
379  bool isInSgInnerMDPS = modules.moduleType()[innerInnerLowerModuleIndex] == PS;
380 
381  float rtGeom = (isInSgInnerMDPS and isOutSgOuterMDPS) ? 2.f * kPixelPSZpitch
382  : (isInSgInnerMDPS or isOutSgOuterMDPS) ? kPixelPSZpitch + kStrip2SZpitch
383  : 2.f * kStrip2SZpitch;
384 
385  float dz = zOut - zIn;
386  const float rtLo = rtIn * (1.f + dz / (zIn + dLum) / dzDrtScale) - rtGeom; //slope correction only on the lower end
387  const float rtHi = rtIn * (1.f + dz / (zIn - dLum)) + rtGeom;
388 
389  //Cut #1: rt condition
390  if ((rtOut < rtLo) || (rtOut > rtHi))
391  return false;
392 
393  bool isInSgOuterMDPS = modules.moduleType()[outerOuterLowerModuleIndex] == PS;
394 
395  float drtSDIn = rtMid - rtIn;
396  float dzSDIn = zMid - zIn;
397  float dr3SDIn =
398  alpaka::math::sqrt(acc, rtMid * rtMid + zMid * zMid) - alpaka::math::sqrt(acc, rtIn * rtIn + zIn * zIn);
399 
400  float coshEta = dr3SDIn / drtSDIn; //direction estimate
401  float dzOutInAbs = alpaka::math::abs(acc, zOut - zIn);
402  float multDzDr = dzOutInAbs * coshEta / (coshEta * coshEta - 1.f);
403 
404  float kZ = (zOut - zIn) / dzSDIn;
405  float thetaMuls2 = (kMulsInGeV * kMulsInGeV) * (0.1f + 0.2f * (rtOut - rtIn) / 50.f);
406 
407  float muls2 = thetaMuls2 * 9.f / (ptCut * ptCut) * 16.f;
408 
409  float drtErr =
410  alpaka::math::sqrt(acc,
411  kPixelPSZpitch * kPixelPSZpitch * 2.f / (dzSDIn * dzSDIn) * (dzOutInAbs * dzOutInAbs) +
412  muls2 * multDzDr * multDzDr / 3.f * coshEta * coshEta);
413 
414  float drtMean = drtSDIn * dzOutInAbs / alpaka::math::abs(acc, dzSDIn);
415  float rtWindow = drtErr + rtGeom;
416  float rtLo_point = rtIn + drtMean / dzDrtScale - rtWindow;
417  float rtHi_point = rtIn + drtMean + rtWindow;
418 
419  // Cut #3: rt-z pointed
420  // https://github.com/slava77/cms-tkph2-ntuple/blob/superDoubletLinked-91X-noMock/doubletAnalysis.C#L3765
421 
422  if (isInSgInnerMDPS and isInSgOuterMDPS) // If both PS then we can point
423  {
424  if ((kZ < 0) || (rtOut < rtLo_point) || (rtOut > rtHi_point))
425  return false;
426  }
427 
428  float rt_InLo = mds.anchorRt()[firstMDIndex];
429  float rt_InOut = mds.anchorRt()[secondMDIndex];
430  float sdIn_alpha = __H2F(segments.dPhiChanges()[innerSegmentIndex]);
431 
432  float tl_axis_x = mds.anchorX()[thirdMDIndex] - mds.anchorX()[firstMDIndex];
433  float tl_axis_y = mds.anchorY()[thirdMDIndex] - mds.anchorY()[firstMDIndex];
434 
435  betaIn = sdIn_alpha - phi_mpi_pi(acc, phi(acc, tl_axis_x, tl_axis_y) - mds.anchorPhi()[firstMDIndex]);
436 
437  float sdIn_alphaRHmin = __H2F(segments.dPhiChangeMins()[innerSegmentIndex]);
438  float sdIn_alphaRHmax = __H2F(segments.dPhiChangeMaxs()[innerSegmentIndex]);
439  float betaInRHmin = betaIn + sdIn_alphaRHmin - sdIn_alpha;
440  float betaInRHmax = betaIn + sdIn_alphaRHmax - sdIn_alpha;
441 
442  float swapTemp;
443 
444  if (alpaka::math::abs(acc, betaInRHmin) > alpaka::math::abs(acc, betaInRHmax)) {
445  swapTemp = betaInRHmin;
446  betaInRHmin = betaInRHmax;
447  betaInRHmax = swapTemp;
448  }
449  float sdIn_dr = alpaka::math::sqrt(acc,
450  (mds.anchorX()[secondMDIndex] - mds.anchorX()[firstMDIndex]) *
451  (mds.anchorX()[secondMDIndex] - mds.anchorX()[firstMDIndex]) +
452  (mds.anchorY()[secondMDIndex] - mds.anchorY()[firstMDIndex]) *
453  (mds.anchorY()[secondMDIndex] - mds.anchorY()[firstMDIndex]));
454  float sdIn_d = rt_InOut - rt_InLo;
455 
456  float dr = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y);
457  betaInCut = alpaka::math::asin(acc, alpaka::math::min(acc, (-sdIn_dr + dr) * k2Rinv1GeVf / ptCut, kSinAlphaMax)) +
458  (0.02f / sdIn_d);
459 
460  //Cut #4: first beta cut
461  return alpaka::math::abs(acc, betaInRHmin) < betaInCut;
462  }
463 
464  template <typename TAcc>
465  ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPointingConstraint(TAcc const& acc,
467  MiniDoubletsConst mds,
468  SegmentsConst segments,
469  uint16_t innerInnerLowerModuleIndex,
470  uint16_t middleLowerModuleIndex,
471  uint16_t outerOuterLowerModuleIndex,
472  unsigned int firstMDIndex,
473  unsigned int secondMDIndex,
474  unsigned int thirdMDIndex,
475  float& zOut,
476  float& rtOut,
477  uint16_t innerOuterLowerModuleIndex,
478  unsigned int innerSegmentIndex,
479  unsigned int outerSegmentIndex,
480  float& betaIn,
481  float& betaInCut) {
482  short innerInnerLowerModuleSubdet = modules.subdets()[innerInnerLowerModuleIndex];
483  short middleLowerModuleSubdet = modules.subdets()[middleLowerModuleIndex];
484  short outerOuterLowerModuleSubdet = modules.subdets()[outerOuterLowerModuleIndex];
485 
486  if (innerInnerLowerModuleSubdet == Barrel and middleLowerModuleSubdet == Barrel and
487  outerOuterLowerModuleSubdet == Barrel) {
488  return passPointingConstraintBBB(acc,
489  modules,
490  mds,
491  segments,
492  innerInnerLowerModuleIndex,
493  middleLowerModuleIndex,
494  outerOuterLowerModuleIndex,
495  firstMDIndex,
496  secondMDIndex,
497  thirdMDIndex,
498  zOut,
499  rtOut,
500  innerSegmentIndex,
501  betaIn,
502  betaInCut);
503  } else if (innerInnerLowerModuleSubdet == Barrel and middleLowerModuleSubdet == Barrel and
504  outerOuterLowerModuleSubdet == Endcap) {
505  return passPointingConstraintBBE(acc,
506  modules,
507  mds,
508  segments,
509  innerInnerLowerModuleIndex,
510  middleLowerModuleIndex,
511  outerOuterLowerModuleIndex,
512  firstMDIndex,
513  secondMDIndex,
514  thirdMDIndex,
515  zOut,
516  rtOut,
517  innerOuterLowerModuleIndex,
518  innerSegmentIndex,
519  outerSegmentIndex,
520  betaIn,
521  betaInCut);
522  } else if (innerInnerLowerModuleSubdet == Barrel and middleLowerModuleSubdet == Endcap and
523  outerOuterLowerModuleSubdet == Endcap) {
524  return passPointingConstraintBBE(acc,
525  modules,
526  mds,
527  segments,
528  innerInnerLowerModuleIndex,
529  middleLowerModuleIndex,
530  outerOuterLowerModuleIndex,
531  firstMDIndex,
532  secondMDIndex,
533  thirdMDIndex,
534  zOut,
535  rtOut,
536  innerOuterLowerModuleIndex,
537  innerSegmentIndex,
538  outerSegmentIndex,
539  betaIn,
540  betaInCut);
541 
542  }
543 
544  else if (innerInnerLowerModuleSubdet == Endcap and middleLowerModuleSubdet == Endcap and
545  outerOuterLowerModuleSubdet == Endcap) {
546  return passPointingConstraintEEE(acc,
547  modules,
548  mds,
549  segments,
550  innerInnerLowerModuleIndex,
551  middleLowerModuleIndex,
552  outerOuterLowerModuleIndex,
553  firstMDIndex,
554  secondMDIndex,
555  thirdMDIndex,
556  zOut,
557  rtOut,
558  innerSegmentIndex,
559  outerSegmentIndex,
560  betaIn,
561  betaInCut);
562  }
563  return false; // failsafe
564  }
565 
566  template <typename TAcc>
567  ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeRadiusFromThreeAnchorHits(
568  TAcc const& acc, float x1, float y1, float x2, float y2, float x3, float y3, float& g, float& f) {
569  float radius = 0.f;
570 
571  //(g,f) -> center
572  //first anchor hit - (x1,y1), second anchor hit - (x2,y2), third anchor hit - (x3, y3)
573 
574  float denomInv = 1.0f / ((y1 - y3) * (x2 - x3) - (x1 - x3) * (y2 - y3));
575 
576  float xy1sqr = x1 * x1 + y1 * y1;
577 
578  float xy2sqr = x2 * x2 + y2 * y2;
579 
580  float xy3sqr = x3 * x3 + y3 * y3;
581 
582  g = 0.5f * ((y3 - y2) * xy1sqr + (y1 - y3) * xy2sqr + (y2 - y1) * xy3sqr) * denomInv;
583 
584  f = 0.5f * ((x2 - x3) * xy1sqr + (x3 - x1) * xy2sqr + (x1 - x2) * xy3sqr) * denomInv;
585 
586  float c = ((x2 * y3 - x3 * y2) * xy1sqr + (x3 * y1 - x1 * y3) * xy2sqr + (x1 * y2 - x2 * y1) * xy3sqr) * denomInv;
587 
588  if (((y1 - y3) * (x2 - x3) - (x1 - x3) * (y2 - y3) == 0) || (g * g + f * f - c < 0)) {
589 #ifdef WARNINGS
590  printf("three collinear points or FATAL! r^2 < 0!\n");
591 #endif
592  radius = -1.f;
593  } else
594  radius = alpaka::math::sqrt(acc, g * g + f * f - c);
595 
596  return radius;
597  }
598 
599  template <typename TAcc>
600  ALPAKA_FN_ACC ALPAKA_FN_INLINE bool runTripletConstraintsAndAlgo(TAcc const& acc,
602  MiniDoubletsConst mds,
603  SegmentsConst segments,
604  uint16_t innerInnerLowerModuleIndex,
605  uint16_t middleLowerModuleIndex,
606  uint16_t outerOuterLowerModuleIndex,
607  unsigned int innerSegmentIndex,
608  unsigned int outerSegmentIndex,
609  float& zOut,
610  float& rtOut,
611  float& betaIn,
612  float& betaInCut,
613  float& circleRadius,
614  float& circleCenterX,
615  float& circleCenterY) {
616  //this cut reduces the number of candidates by a factor of 4, i.e., 3 out of 4 warps can end right here!
617  if (segments.mdIndices()[innerSegmentIndex][1] != segments.mdIndices()[outerSegmentIndex][0])
618  return false;
619 
620  unsigned int firstMDIndex = segments.mdIndices()[innerSegmentIndex][0];
621  unsigned int secondMDIndex = segments.mdIndices()[outerSegmentIndex][0];
622  unsigned int thirdMDIndex = segments.mdIndices()[outerSegmentIndex][1];
623 
624  if (not passRZConstraint(acc,
625  modules,
626  mds,
627  innerInnerLowerModuleIndex,
628  middleLowerModuleIndex,
629  outerOuterLowerModuleIndex,
630  firstMDIndex,
631  secondMDIndex,
632  thirdMDIndex))
633  return false;
634  if (not passPointingConstraint(acc,
635  modules,
636  mds,
637  segments,
638  innerInnerLowerModuleIndex,
639  middleLowerModuleIndex,
640  outerOuterLowerModuleIndex,
641  firstMDIndex,
642  secondMDIndex,
643  thirdMDIndex,
644  zOut,
645  rtOut,
646  middleLowerModuleIndex,
647  innerSegmentIndex,
648  outerSegmentIndex,
649  betaIn,
650  betaInCut))
651  return false;
652 
653  float x1 = mds.anchorX()[firstMDIndex];
654  float x2 = mds.anchorX()[secondMDIndex];
655  float x3 = mds.anchorX()[thirdMDIndex];
656  float y1 = mds.anchorY()[firstMDIndex];
657  float y2 = mds.anchorY()[secondMDIndex];
658  float y3 = mds.anchorY()[thirdMDIndex];
659 
660  circleRadius = computeRadiusFromThreeAnchorHits(acc, x1, y1, x2, y2, x3, y3, circleCenterX, circleCenterY);
661  return true;
662  }
663 
664  struct CreateTriplets {
665  template <typename TAcc>
666  ALPAKA_FN_ACC void operator()(TAcc const& acc,
668  MiniDoubletsConst mds,
669  SegmentsConst segments,
670  SegmentsOccupancyConst segmentsOccupancy,
671  Triplets triplets,
672  TripletsOccupancy tripletsOccupancy,
674  uint16_t* index_gpu,
675  uint16_t nonZeroModules) const {
676  auto const globalThreadIdx = alpaka::getIdx<alpaka::Grid, alpaka::Threads>(acc);
677  auto const gridThreadExtent = alpaka::getWorkDiv<alpaka::Grid, alpaka::Threads>(acc);
678 
679  for (uint16_t innerLowerModuleArrayIdx = globalThreadIdx[0]; innerLowerModuleArrayIdx < nonZeroModules;
680  innerLowerModuleArrayIdx += gridThreadExtent[0]) {
681  uint16_t innerInnerLowerModuleIndex = index_gpu[innerLowerModuleArrayIdx];
682  if (innerInnerLowerModuleIndex >= modules.nLowerModules())
683  continue;
684 
685  uint16_t nConnectedModules = modules.nConnectedModules()[innerInnerLowerModuleIndex];
686  if (nConnectedModules == 0)
687  continue;
688 
689  unsigned int nInnerSegments = segmentsOccupancy.nSegments()[innerInnerLowerModuleIndex];
690  for (unsigned int innerSegmentArrayIndex = globalThreadIdx[1]; innerSegmentArrayIndex < nInnerSegments;
691  innerSegmentArrayIndex += gridThreadExtent[1]) {
692  unsigned int innerSegmentIndex =
693  ranges.segmentRanges()[innerInnerLowerModuleIndex][0] + innerSegmentArrayIndex;
694 
695  // middle lower module - outer lower module of inner segment
696  uint16_t middleLowerModuleIndex = segments.outerLowerModuleIndices()[innerSegmentIndex];
697 
698  unsigned int nOuterSegments = segmentsOccupancy.nSegments()[middleLowerModuleIndex];
699  for (unsigned int outerSegmentArrayIndex = globalThreadIdx[2]; outerSegmentArrayIndex < nOuterSegments;
700  outerSegmentArrayIndex += gridThreadExtent[2]) {
701  unsigned int outerSegmentIndex = ranges.segmentRanges()[middleLowerModuleIndex][0] + outerSegmentArrayIndex;
702 
703  uint16_t outerOuterLowerModuleIndex = segments.outerLowerModuleIndices()[outerSegmentIndex];
704 
705  float zOut, rtOut, betaIn, betaInCut, circleRadius, circleCenterX, circleCenterY;
706 
708  modules,
709  mds,
710  segments,
711  innerInnerLowerModuleIndex,
712  middleLowerModuleIndex,
713  outerOuterLowerModuleIndex,
714  innerSegmentIndex,
715  outerSegmentIndex,
716  zOut,
717  rtOut,
718  betaIn,
719  betaInCut,
720  circleRadius,
721  circleCenterX,
722  circleCenterY);
723 
724  if (success) {
725  unsigned int totOccupancyTriplets =
726  alpaka::atomicAdd(acc,
727  &tripletsOccupancy.totOccupancyTriplets()[innerInnerLowerModuleIndex],
728  1u,
729  alpaka::hierarchy::Threads{});
730  if (static_cast<int>(totOccupancyTriplets) >=
731  ranges.tripletModuleOccupancy()[innerInnerLowerModuleIndex]) {
732 #ifdef WARNINGS
733  printf("Triplet excess alert! Module index = %d\n", innerInnerLowerModuleIndex);
734 #endif
735  } else {
736  unsigned int tripletModuleIndex = alpaka::atomicAdd(
737  acc, &tripletsOccupancy.nTriplets()[innerInnerLowerModuleIndex], 1u, alpaka::hierarchy::Threads{});
738  unsigned int tripletIndex =
739  ranges.tripletModuleIndices()[innerInnerLowerModuleIndex] + tripletModuleIndex;
741  mds,
742  segments,
743  triplets,
744  innerSegmentIndex,
745  outerSegmentIndex,
746  innerInnerLowerModuleIndex,
747  middleLowerModuleIndex,
748  outerOuterLowerModuleIndex,
749 #ifdef CUT_VALUE_DEBUG
750  zOut,
751  rtOut,
752 #endif
753  betaIn,
754  betaInCut,
755  circleRadius,
756  circleCenterX,
757  circleCenterY,
758  tripletIndex);
759  }
760  }
761  }
762  }
763  }
764  }
765  };
766 
768  template <typename TAcc>
769  ALPAKA_FN_ACC void operator()(TAcc const& acc,
772  SegmentsOccupancyConst segmentsOccupancy) const {
773  // implementation is 1D with a single block
774  static_assert(std::is_same_v<TAcc, ALPAKA_ACCELERATOR_NAMESPACE::Acc1D>, "Should be Acc1D");
775  ALPAKA_ASSERT_ACC((alpaka::getWorkDiv<alpaka::Grid, alpaka::Blocks>(acc)[0] == 1));
776 
777  auto const globalThreadIdx = alpaka::getIdx<alpaka::Grid, alpaka::Threads>(acc);
778  auto const gridThreadExtent = alpaka::getWorkDiv<alpaka::Grid, alpaka::Threads>(acc);
779 
780  // Initialize variables in shared memory and set to 0
781  int& nTotalTriplets = alpaka::declareSharedVar<int, __COUNTER__>(acc);
783  nTotalTriplets = 0;
784  }
785  alpaka::syncBlockThreads(acc);
786 
787  for (uint16_t i = globalThreadIdx[0]; i < modules.nLowerModules(); i += gridThreadExtent[0]) {
788  if (segmentsOccupancy.nSegments()[i] == 0) {
789  ranges.tripletModuleIndices()[i] = nTotalTriplets;
790  ranges.tripletModuleOccupancy()[i] = 0;
791  continue;
792  }
793 
794  short module_rings = modules.rings()[i];
795  short module_layers = modules.layers()[i];
796  short module_subdets = modules.subdets()[i];
797  float module_eta = alpaka::math::abs(acc, modules.eta()[i]);
798 
799  int category_number;
800  if (module_layers <= 3 && module_subdets == 5)
801  category_number = 0;
802  else if (module_layers >= 4 && module_subdets == 5)
803  category_number = 1;
804  else if (module_layers <= 2 && module_subdets == 4 && module_rings >= 11)
805  category_number = 2;
806  else if (module_layers >= 3 && module_subdets == 4 && module_rings >= 8)
807  category_number = 2;
808  else if (module_layers <= 2 && module_subdets == 4 && module_rings <= 10)
809  category_number = 3;
810  else if (module_layers >= 3 && module_subdets == 4 && module_rings <= 7)
811  category_number = 3;
812  else
813  category_number = -1;
814 
815  int eta_number;
816  if (module_eta < 0.75f)
817  eta_number = 0;
818  else if (module_eta < 1.5f)
819  eta_number = 1;
820  else if (module_eta < 2.25f)
821  eta_number = 2;
822  else if (module_eta < 3.0f)
823  eta_number = 3;
824  else
825  eta_number = -1;
826 
827  int occupancy;
828  if (category_number == 0 && eta_number == 0)
829  occupancy = 543;
830  else if (category_number == 0 && eta_number == 1)
831  occupancy = 235;
832  else if (category_number == 0 && eta_number == 2)
833  occupancy = 88;
834  else if (category_number == 0 && eta_number == 3)
835  occupancy = 46;
836  else if (category_number == 1 && eta_number == 0)
837  occupancy = 755;
838  else if (category_number == 1 && eta_number == 1)
839  occupancy = 347;
840  else if (category_number == 2 && eta_number == 1)
841  occupancy = 0;
842  else if (category_number == 2 && eta_number == 2)
843  occupancy = 0;
844  else if (category_number == 3 && eta_number == 1)
845  occupancy = 38;
846  else if (category_number == 3 && eta_number == 2)
847  occupancy = 46;
848  else if (category_number == 3 && eta_number == 3)
849  occupancy = 39;
850  else {
851  occupancy = 0;
852 #ifdef WARNINGS
853  printf("Unhandled case in createTripletArrayRanges! Module index = %i\n", i);
854 #endif
855  }
856 
857  ranges.tripletModuleOccupancy()[i] = occupancy;
858  unsigned int nTotT = alpaka::atomicAdd(acc, &nTotalTriplets, occupancy, alpaka::hierarchy::Threads{});
859  ranges.tripletModuleIndices()[i] = nTotT;
860  }
861 
862  // Wait for all threads to finish before reporting final values
863  alpaka::syncBlockThreads(acc);
865  ranges.nTotalTrips() = nTotalTriplets;
866  }
867  }
868  };
869 
871  template <typename TAcc>
872  ALPAKA_FN_ACC void operator()(TAcc const& acc,
874  TripletsOccupancyConst tripletsOccupancy,
875  ObjectRanges ranges) const {
876  // implementation is 1D with a single block
877  static_assert(std::is_same_v<TAcc, ALPAKA_ACCELERATOR_NAMESPACE::Acc1D>, "Should be Acc1D");
878  ALPAKA_ASSERT_ACC((alpaka::getWorkDiv<alpaka::Grid, alpaka::Blocks>(acc)[0] == 1));
879 
880  auto const globalThreadIdx = alpaka::getIdx<alpaka::Grid, alpaka::Threads>(acc);
881  auto const gridThreadExtent = alpaka::getWorkDiv<alpaka::Grid, alpaka::Threads>(acc);
882 
883  for (uint16_t i = globalThreadIdx[0]; i < modules.nLowerModules(); i += gridThreadExtent[0]) {
884  if (tripletsOccupancy.nTriplets()[i] == 0) {
885  ranges.tripletRanges()[i][0] = -1;
886  ranges.tripletRanges()[i][1] = -1;
887  } else {
888  ranges.tripletRanges()[i][0] = ranges.tripletModuleIndices()[i];
889  ranges.tripletRanges()[i][1] = ranges.tripletModuleIndices()[i] + tripletsOccupancy.nTriplets()[i] - 1;
890  }
891  }
892  }
893  };
894 } // namespace ALPAKA_ACCELERATOR_NAMESPACE::lst
895 #endif
ALPAKA_FN_ACC constexpr bool once_per_block(TAcc const &acc)
ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPointingConstraintEEE(TAcc const &acc, ModulesConst modules, MiniDoubletsConst mds, SegmentsConst segments, uint16_t innerInnerLowerModuleIndex, uint16_t middleLowerModuleIndex, uint16_t outerOuterLowerModuleIndex, unsigned int firstMDIndex, unsigned int secondMDIndex, unsigned int thirdMDIndex, float &zOut, float &rtOut, unsigned int innerSegmentIndex, unsigned int outerSegmentIndex, float &betaIn, float &betaInCut)
Definition: Triplet.h:344
ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float k2Rinv1GeVf
Definition: Common.h:49
ObjectRangesSoA::View ObjectRanges
const std::vector< int > & module_rings()
Definition: LSTEff.cc:3384
ALPAKA_FN_ACC void operator()(TAcc const &acc, ModulesConst modules, TripletsOccupancyConst tripletsOccupancy, ObjectRanges ranges) const
Definition: Triplet.h:872
ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPointingConstraint(TAcc const &acc, ModulesConst modules, MiniDoubletsConst mds, SegmentsConst segments, uint16_t innerInnerLowerModuleIndex, uint16_t middleLowerModuleIndex, uint16_t outerOuterLowerModuleIndex, unsigned int firstMDIndex, unsigned int secondMDIndex, unsigned int thirdMDIndex, float &zOut, float &rtOut, uint16_t innerOuterLowerModuleIndex, unsigned int innerSegmentIndex, unsigned int outerSegmentIndex, float &betaIn, float &betaInCut)
Definition: Triplet.h:465
ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeRadiusFromThreeAnchorHits(TAcc const &acc, float x1, float y1, float x2, float y2, float x3, float y3, float &g, float &f)
Definition: Triplet.h:567
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
#define __H2F
Definition: Common.h:50
#define __F2H
Definition: Common.h:49
ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float ptCut
Definition: Common.h:52
ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPointingConstraintBBB(TAcc const &acc, ModulesConst modules, MiniDoubletsConst mds, SegmentsConst segments, uint16_t innerInnerLowerModuleIndex, uint16_t middleLowerModuleIndex, uint16_t outerOuterLowerModuleIndex, unsigned int firstMDIndex, unsigned int secondMDIndex, unsigned int thirdMDIndex, float &zOut, float &rtOut, unsigned int innerSegmentIndex, float &betaIn, float &betaInCut)
Definition: Triplet.h:130
ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passRZConstraint(TAcc const &acc, ModulesConst modules, MiniDoubletsConst mds, uint16_t innerInnerLowerModuleIndex, uint16_t middleLowerModuleIndex, uint16_t outerOuterLowerModuleIndex, unsigned int firstMDIndex, unsigned int secondMDIndex, unsigned int thirdMDIndex)
Definition: Triplet.h:71
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE float phi_mpi_pi(TAcc const &acc, float x)
Definition: Hit.h:19
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE float phi(TAcc const &acc, float x, float y)
Definition: Hit.h:29
T sqrt(T t)
Definition: SSEVec.h:23
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
MiniDoubletsSoA::ConstView MiniDoubletsConst
ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPointingConstraintBBE(TAcc const &acc, ModulesConst modules, MiniDoubletsConst mds, SegmentsConst segments, uint16_t innerInnerLowerModuleIndex, uint16_t middleLowerModuleIndex, uint16_t outerOuterLowerModuleIndex, unsigned int firstMDIndex, unsigned int secondMDIndex, unsigned int thirdMDIndex, float &zOut, float &rtOut, uint16_t innerOuterLowerModuleIndex, unsigned int innerSegmentIndex, unsigned int outerSegmentIndex, float &betaIn, float &betaInCut)
Definition: Triplet.h:225
ALPAKA_FN_ACC ALPAKA_FN_INLINE void addTripletToMemory(ModulesConst modules, MiniDoubletsConst mds, SegmentsConst segments, Triplets &triplets, unsigned int innerSegmentIndex, unsigned int outerSegmentIndex, uint16_t innerInnerLowerModuleIndex, uint16_t middleLowerModuleIndex, uint16_t outerOuterLowerModuleIndex, float betaIn, float betaInCut, float circleRadius, float circleCenterX, float circleCenterY, unsigned int tripletIndex)
Definition: Triplet.h:17
ModulesSoA::ConstView ModulesConst
Definition: ModulesSoA.h:47
const std::vector< int > & module_layers()
Definition: LSTEff.cc:3388
string ranges
Definition: diffTwoXMLs.py:79
TripletsOccupancySoA::View TripletsOccupancy
Definition: TripletsSoA.h:38
ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kMulsInGeV
Definition: Common.h:41
ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kPixelPSZpitch
Definition: Common.h:54
const std::vector< int > & module_subdets()
Definition: LSTEff.cc:3288
ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kStrip2SZpitch
Definition: Common.h:56
TripletsSoA::View Triplets
Definition: TripletsSoA.h:30
SegmentsOccupancySoA::ConstView SegmentsOccupancyConst
Definition: SegmentsSoA.h:51
TripletsOccupancySoA::ConstView TripletsOccupancyConst
Definition: TripletsSoA.h:39
ObjectRangesSoA::ConstView ObjectRangesConst
ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kSinAlphaMax
Definition: Common.h:51
SegmentsSoA::ConstView SegmentsConst
Definition: SegmentsSoA.h:49
ALPAKA_FN_ACC void operator()(TAcc const &acc, ModulesConst modules, ObjectRanges ranges, SegmentsOccupancyConst segmentsOccupancy) const
Definition: Triplet.h:769
ALPAKA_FN_ACC ALPAKA_FN_INLINE bool runTripletConstraintsAndAlgo(TAcc const &acc, ModulesConst modules, MiniDoubletsConst mds, SegmentsConst segments, uint16_t innerInnerLowerModuleIndex, uint16_t middleLowerModuleIndex, uint16_t outerOuterLowerModuleIndex, unsigned int innerSegmentIndex, unsigned int outerSegmentIndex, float &zOut, float &rtOut, float &betaIn, float &betaInCut, float &circleRadius, float &circleCenterX, float &circleCenterY)
Definition: Triplet.h:600
ALPAKA_STATIC_ACC_MEM_GLOBAL constexpr float kDeltaZLum
Definition: Common.h:53
T1 atomicAdd(T1 *a, T2 b)
Definition: cudaCompat.h:61
ALPAKA_FN_ACC void operator()(TAcc const &acc, ModulesConst modules, MiniDoubletsConst mds, SegmentsConst segments, SegmentsOccupancyConst segmentsOccupancy, Triplets triplets, TripletsOccupancy tripletsOccupancy, ObjectRangesConst ranges, uint16_t *index_gpu, uint16_t nonZeroModules) const
Definition: Triplet.h:666