Skip to content

Commit 5008160

Browse files
committed
define Module isGloballyInner flag and use it to define the reference shift in the minidoublets
1 parent dd7156a commit 5008160

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

RecoTracker/LSTCore/interface/ModulesSoA.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ namespace lst {
3333
SOA_COLUMN(short, sides),
3434
SOA_COLUMN(float, eta),
3535
SOA_COLUMN(float, r),
36+
SOA_COLUMN(float, z),
3637
SOA_COLUMN(bool, isInverted),
3738
SOA_COLUMN(bool, isLower),
39+
SOA_COLUMN(bool, isGloballyInner),
3840
SOA_COLUMN(bool, isAnchor),
3941
SOA_COLUMN(ModuleType, moduleType),
4042
SOA_COLUMN(ModuleLayerType, moduleLayerType),

RecoTracker/LSTCore/src/ModuleMethods.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

RecoTracker/LSTCore/src/alpaka/MiniDoublet.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
5151
}
5252

5353
mds.dphichanges()[idx] = dPhiChange;
54-
5554
mds.dphis()[idx] = dPhi;
5655
mds.dzs()[idx] = dz;
5756
mds.shiftedXs()[idx] = shiftedX;
@@ -250,10 +249,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
250249
float absdzprime; // The distance between the two points after shifting
251250
const float& drdz_ = modules.drdzs()[lowerModuleIndex];
252251
// Assign hit pointers based on their hit type
252+
bool pHitInverted = false;
253253
if (modules.moduleType()[lowerModuleIndex] == PS) {
254254
// TODO: This is somewhat of an mystery.... somewhat confused why this is the case
255-
if (modules.subdets()[lowerModuleIndex] == Barrel ? modules.moduleLayerType()[lowerModuleIndex] != Pixel
256-
: modules.moduleLayerType()[lowerModuleIndex] == Pixel) {
255+
if (modules.moduleLayerType()[lowerModuleIndex] == Pixel) {
257256
xo = xUpper;
258257
yo = yUpper;
259258
xp = xLower;
@@ -267,6 +266,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
267266
yp = yUpper;
268267
zp = zUpper;
269268
rtp = rtUpper;
269+
pHitInverted = true;
270270
}
271271
} else {
272272
xo = xUpper;
@@ -293,7 +293,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
293293
moduleSeparation = moduleGapSize(modules, lowerModuleIndex);
294294

295295
// Sign flips if the pixel is later layer
296-
if (modules.moduleType()[lowerModuleIndex] == PS and modules.moduleLayerType()[lowerModuleIndex] != Pixel) {
296+
if (modules.isGloballyInner()[lowerModuleIndex] == pHitInverted) {
297297
moduleSeparation *= -1;
298298
}
299299

@@ -456,7 +456,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
456456
// Ref to original code: https://github.com/slava77/cms-tkph2-ntuple/blob/184d2325147e6930030d3d1f780136bc2dd29ce6/doubletAnalysis.C#L3076
457457
if (modules.sides()[lowerModuleIndex] != Center) {
458458
// When it is tilted, use the new shifted positions
459-
if (modules.moduleLayerType()[lowerModuleIndex] != Pixel) {
459+
if (modules.moduleLayerType()[lowerModuleIndex] == Pixel) {
460460
// dPhi Change should be calculated so that the upper hit has higher rt.
461461
// In principle, this kind of check rt_lower < rt_upper should not be necessary because the hit shifting should have taken care of this.
462462
// (i.e. the strip hit is shifted to be aligned in the line of sight from interaction point to pixel hit of PS module guaranteeing rt ordering)

0 commit comments

Comments
 (0)