@@ -255,8 +255,10 @@ namespace lst {
255255 std::span<short > host_sides = modules_view.sides ();
256256 std::span<float > host_eta = modules_view.eta ();
257257 std::span<float > host_r = modules_view.r ();
258+ std::span<float > host_z = modules_view.z ();
258259 std::span<bool > host_isInverted = modules_view.isInverted ();
259260 std::span<bool > host_isLower = modules_view.isLower ();
261+ std::span<bool > host_isGloballyInner = modules_view.isGloballyInner ();
260262 std::span<bool > host_isAnchor = modules_view.isAnchor ();
261263 std::span<ModuleType> host_moduleType = modules_view.moduleType ();
262264 std::span<ModuleLayerType> host_moduleLayerType = modules_view.moduleLayerType ();
@@ -320,10 +322,12 @@ namespace lst {
320322 host_sides[index] = side;
321323 host_eta[index] = eta;
322324 host_r[index] = r;
325+ host_z[index] = m_z;
323326 host_isInverted[index] = isInverted;
324327 host_isLower[index] = isLower;
325328
326329 // assigning other variables!
330+ host_isGloballyInner[index] = false ;
327331 if (detId == 1 ) {
328332 host_moduleType[index] = PixelModule;
329333 host_moduleLayerType[index] = lst::InnerPixelLayer;
@@ -356,12 +360,22 @@ namespace lst {
356360 if (detId != 1 ) {
357361 host_partnerModuleIndices[index] =
358362 mmd.detIdToIndex [parsePartnerModuleId (detId, host_isLower[index], host_isInverted[index])];
363+ auto const partnerIdx = host_partnerModuleIndices[index];
359364 // add drdz and slope importing stuff here!
360365 if (host_drdzs[index] == 0 ) {
361- host_drdzs[index] = host_drdzs[host_partnerModuleIndices[index] ];
366+ host_drdzs[index] = host_drdzs[partnerIdx ];
362367 }
363368 if (host_dxdys[index] == 0 ) {
364- host_dxdys[index] = host_dxdys[host_partnerModuleIndices[index]];
369+ host_dxdys[index] = host_dxdys[partnerIdx];
370+ }
371+ if (host_isLower[index]) {
372+ if (host_subdets[index] == Barrel) {
373+ // 3D r should be reliable to order all modules
374+ host_isGloballyInner[index] = host_r[index] < host_r[partnerIdx];
375+ } else {
376+ host_isGloballyInner[index] = std::abs (host_z[index]) < std::abs (host_z[partnerIdx]);
377+ }
378+ host_isGloballyInner[partnerIdx] = !host_isGloballyInner[index];
365379 }
366380 }
367381 }
0 commit comments