Skip to content

Commit ecd8e3e

Browse files
authored
Merge pull request #72 from SegmentLinking/removalOfSDL
Total removal of sdl/SDL
2 parents d7689bb + a076afb commit ecd8e3e

28 files changed

+526
-579
lines changed

RecoTracker/LST/BuildFile.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<use name="DataFormats/TrackerRecHit2D"/>
44
<use name="HeterogeneousCore/AlpakaInterface"/>
55
<use name="RecoTracker/LSTCore"/>
6-
<flags CXXFLAGS="-DLST_IS_CMSSW_PACKAGE"/>
76
<flags ALPAKA_BACKENDS="1"/>
87
<export>
98
<lib name="1"/>

RecoTracker/LSTCore/interface/Module.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace lst {
3737
const bool* isAnchor;
3838
const ModuleType* moduleType;
3939
const ModuleLayerType* moduleLayerType;
40-
const int* sdlLayers;
40+
const int* lstLayers;
4141
const unsigned int* connectedPixels;
4242

4343
static bool parseIsInverted(short subdet, short side, short module, short layer) {
@@ -108,7 +108,7 @@ namespace lst {
108108
isAnchor = alpaka::getPtrNative(buf.isAnchor_buf);
109109
moduleType = alpaka::getPtrNative(buf.moduleType_buf);
110110
moduleLayerType = alpaka::getPtrNative(buf.moduleLayerType_buf);
111-
sdlLayers = alpaka::getPtrNative(buf.sdlLayers_buf);
111+
lstLayers = alpaka::getPtrNative(buf.lstLayers_buf);
112112
connectedPixels = alpaka::getPtrNative(buf.connectedPixels_buf);
113113
}
114114
};
@@ -139,7 +139,7 @@ namespace lst {
139139
Buf<TDev, bool> isAnchor_buf;
140140
Buf<TDev, ModuleType> moduleType_buf;
141141
Buf<TDev, ModuleLayerType> moduleLayerType_buf;
142-
Buf<TDev, int> sdlLayers_buf;
142+
Buf<TDev, int> lstLayers_buf;
143143
Buf<TDev, unsigned int> connectedPixels_buf;
144144

145145
Modules data_;
@@ -169,7 +169,7 @@ namespace lst {
169169
isAnchor_buf(allocBufWrapper<bool>(dev, nMod)),
170170
moduleType_buf(allocBufWrapper<ModuleType>(dev, nMod)),
171171
moduleLayerType_buf(allocBufWrapper<ModuleLayerType>(dev, nMod)),
172-
sdlLayers_buf(allocBufWrapper<int>(dev, nMod)),
172+
lstLayers_buf(allocBufWrapper<int>(dev, nMod)),
173173
connectedPixels_buf(allocBufWrapper<unsigned int>(dev, nPixs)) {
174174
data_.setData(*this);
175175
}
@@ -209,7 +209,7 @@ namespace lst {
209209
alpaka::memcpy(queue, moduleType_buf, src.moduleType_buf);
210210
if (isFull) {
211211
alpaka::memcpy(queue, moduleLayerType_buf, src.moduleLayerType_buf);
212-
alpaka::memcpy(queue, sdlLayers_buf, src.sdlLayers_buf);
212+
alpaka::memcpy(queue, lstLayers_buf, src.lstLayers_buf);
213213
alpaka::memcpy(queue, connectedPixels_buf, src.connectedPixels_buf);
214214
}
215215
alpaka::wait(queue);

RecoTracker/LSTCore/src/ModuleMethods.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ namespace lst {
250250
auto dxdys_buf = allocBufWrapper<float>(devHost, nModules);
251251
auto drdzs_buf = allocBufWrapper<float>(devHost, nModules);
252252
auto partnerModuleIndices_buf = allocBufWrapper<uint16_t>(devHost, nModules);
253-
auto sdlLayers_buf = allocBufWrapper<int>(devHost, nModules);
253+
auto lstLayers_buf = allocBufWrapper<int>(devHost, nModules);
254254

255255
// Getting the underlying data pointers
256256
unsigned int* host_detIds = alpaka::getPtrNative(detIds_buf);
@@ -270,7 +270,7 @@ namespace lst {
270270
float* host_dxdys = alpaka::getPtrNative(dxdys_buf);
271271
float* host_drdzs = alpaka::getPtrNative(drdzs_buf);
272272
uint16_t* host_partnerModuleIndices = alpaka::getPtrNative(partnerModuleIndices_buf);
273-
int* host_sdlLayers = alpaka::getPtrNative(sdlLayers_buf);
273+
int* host_lstLayers = alpaka::getPtrNative(lstLayers_buf);
274274

275275
//reassign detIdToIndex indices here
276276
nLowerModules = (nModules - 1) / 2;
@@ -351,7 +351,7 @@ namespace lst {
351351
host_drdzs[index] = (subdet == Barrel) ? tiltedGeometry->getDrDz(detId) : 0;
352352
}
353353

354-
host_sdlLayers[index] =
354+
host_lstLayers[index] =
355355
layer + 6 * (subdet == lst::Endcap) + 5 * (subdet == lst::Endcap and host_moduleType[index] == lst::TwoS);
356356
}
357357

@@ -402,7 +402,7 @@ namespace lst {
402402
alpaka::memcpy(queue, modulesBuf->dxdys_buf, dxdys_buf);
403403
alpaka::memcpy(queue, modulesBuf->drdzs_buf, drdzs_buf);
404404
alpaka::memcpy(queue, modulesBuf->partnerModuleIndices_buf, partnerModuleIndices_buf);
405-
alpaka::memcpy(queue, modulesBuf->sdlLayers_buf, sdlLayers_buf);
405+
alpaka::memcpy(queue, modulesBuf->lstLayers_buf, lstLayers_buf);
406406
alpaka::wait(queue);
407407

408408
fillConnectedModuleArrayExplicit(modulesBuf.get(), nModules, queue, mmd, moduleConnectionMap);

RecoTracker/LSTCore/src/alpaka/Event.dev.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@ lst::TripletsBuffer<DevHost>* lst::Event<Acc3D>::getTriplets() {
16221622
alpaka::memcpy(queue, tripletsInCPU->zHi_buf, tripletsBuffers->zHi_buf, nMemHost);
16231623
alpaka::memcpy(queue, tripletsInCPU->zLoPointed_buf, tripletsBuffers->zLoPointed_buf, nMemHost);
16241624
alpaka::memcpy(queue, tripletsInCPU->zHiPointed_buf, tripletsBuffers->zHiPointed_buf, nMemHost);
1625-
alpaka::memcpy(queue, tripletsInCPU->sdlCut_buf, tripletsBuffers->sdlCut_buf, nMemHost);
1625+
alpaka::memcpy(queue, tripletsInCPU->dPhiCut_buf, tripletsBuffers->dPhiCut_buf, nMemHost);
16261626
alpaka::memcpy(queue, tripletsInCPU->betaInCut_buf, tripletsBuffers->betaInCut_buf, nMemHost);
16271627
alpaka::memcpy(queue, tripletsInCPU->rtLo_buf, tripletsBuffers->rtLo_buf, nMemHost);
16281628
alpaka::memcpy(queue, tripletsInCPU->rtHi_buf, tripletsBuffers->rtHi_buf, nMemHost);

RecoTracker/LSTCore/src/alpaka/PixelTriplet.h

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ namespace lst {
11841184
unsigned int secondMDIndex,
11851185
unsigned int thirdMDIndex,
11861186
unsigned int fourthMDIndex) {
1187-
float dPhi, betaIn, betaOut, pt_beta, zLo, zHi, zLoPointed, zHiPointed, sdlCut, betaOutCut;
1187+
float dPhi, betaIn, betaOut, pt_beta, zLo, zHi, zLoPointed, zHiPointed, dPhiCut, betaOutCut;
11881188

11891189
bool isPS_OutLo = (modulesInGPU.moduleType[outerInnerLowerModuleIndex] == lst::PS);
11901190

@@ -1249,14 +1249,14 @@ namespace lst {
12491249

12501250
float drt_InSeg = rt_InOut - rt_InLo;
12511251

1252-
const float sdlThetaMulsF2 =
1252+
const float thetaMuls2 =
12531253
(kMulsInGeV * kMulsInGeV) * (0.1f + 0.2f * (rt_OutLo - rt_InUp) / 50.f) * (r3_InUp / rt_InUp);
1254-
const float sdlMuls2 = sdlThetaMulsF2 * 9.f / (ptCut * ptCut) * 16.f;
1254+
const float muls2 = thetaMuls2 * 9.f / (ptCut * ptCut) * 16.f;
12551255

12561256
float dzErr = (drt_OutLo_InUp * drt_OutLo_InUp) * (etaErr * etaErr) * cosh2Eta;
12571257
dzErr += 0.03f * 0.03f; // Approximately account for IT module size
12581258
dzErr *= 9.f; // 3 sigma
1259-
dzErr += sdlMuls2 * (drt_OutLo_InUp * drt_OutLo_InUp) / 3.f * cosh2Eta;
1259+
dzErr += muls2 * (drt_OutLo_InUp * drt_OutLo_InUp) / 3.f * cosh2Eta;
12601260
dzErr += zGeom * zGeom;
12611261
dzErr = alpaka::math::sqrt(acc, dzErr);
12621262

@@ -1272,8 +1272,8 @@ namespace lst {
12721272
if ((z_OutLo < zLoPointed) || (z_OutLo > zHiPointed))
12731273
return false;
12741274

1275-
const float sdlPVoff = 0.1f / rt_OutLo;
1276-
sdlCut = alpha1GeV_OutLo + alpaka::math::sqrt(acc, sdlMuls2 + sdlPVoff * sdlPVoff);
1275+
const float pvOffset = 0.1f / rt_OutLo;
1276+
dPhiCut = alpha1GeV_OutLo + alpaka::math::sqrt(acc, muls2 + pvOffset * pvOffset);
12771277

12781278
//no dphipos cut
12791279
float midPointX = 0.5f * (x_InLo + x_OutLo);
@@ -1284,7 +1284,7 @@ namespace lst {
12841284

12851285
dPhi = lst::deltaPhi(acc, midPointX, midPointY, diffX, diffY);
12861286

1287-
if (alpaka::math::abs(acc, dPhi) > sdlCut)
1287+
if (alpaka::math::abs(acc, dPhi) > dPhiCut)
12881288
return false;
12891289

12901290
//lots of array accesses below this...
@@ -1380,7 +1380,7 @@ namespace lst {
13801380

13811381
float min_ptBeta_ptBetaMax = alpaka::math::min(
13821382
acc, alpaka::math::abs(acc, pt_beta), lst::kPt_betaMax); //need to confirm the range-out value of 7 GeV
1383-
const float dBetaMuls2 = sdlThetaMulsF2 * 16.f / (min_ptBeta_ptBetaMax * min_ptBeta_ptBetaMax);
1383+
const float dBetaMuls2 = thetaMuls2 * 16.f / (min_ptBeta_ptBetaMax * min_ptBeta_ptBetaMax);
13841384
const float alphaInAbsReg =
13851385
alpaka::math::max(acc,
13861386
alpaka::math::abs(acc, alpha_InLo),
@@ -1442,7 +1442,7 @@ namespace lst {
14421442
unsigned int secondMDIndex,
14431443
unsigned int thirdMDIndex,
14441444
unsigned int fourthMDIndex) {
1445-
float dPhi, betaIn, betaOut, pt_beta, rtLo, rtHi, sdlCut, betaOutCut;
1445+
float dPhi, betaIn, betaOut, pt_beta, rtLo, rtHi, dPhiCut, betaOutCut;
14461446

14471447
bool isPS_OutLo = (modulesInGPU.moduleType[outerInnerLowerModuleIndex] == lst::PS);
14481448

@@ -1484,9 +1484,8 @@ namespace lst {
14841484
float zpitch_OutLo = (isPS_OutLo ? kPixelPSZpitch : kStrip2SZpitch);
14851485
float zGeom = zpitch_InLo + zpitch_OutLo;
14861486

1487-
const float sdlSlope =
1488-
alpaka::math::asin(acc, alpaka::math::min(acc, rt_OutLo * k2Rinv1GeVf / ptCut, kSinAlphaMax));
1489-
const float dzDrtScale = alpaka::math::tan(acc, sdlSlope) / sdlSlope; //FIXME: need approximate value
1487+
const float slope = alpaka::math::asin(acc, alpaka::math::min(acc, rt_OutLo * k2Rinv1GeVf / ptCut, kSinAlphaMax));
1488+
const float dzDrtScale = alpaka::math::tan(acc, slope) / slope; //FIXME: need approximate value
14901489

14911490
const float dLum = alpaka::math::copysign(acc, kDeltaZLum, z_InUp);
14921491
bool isOutSgInnerMDPS = modulesInGPU.moduleType[outerInnerLowerModuleIndex] == lst::PS;
@@ -1511,14 +1510,14 @@ namespace lst {
15111510
const float cosh2Eta = 1.f + (pz * pz) / (ptIn * ptIn);
15121511
const float multDzDr2 = (dzOutInAbs * dzOutInAbs) * cosh2Eta / ((cosh2Eta - 1.f) * (cosh2Eta - 1.f));
15131512
const float r3_InUp = alpaka::math::sqrt(acc, z_InUp * z_InUp + rt_InUp * rt_InUp);
1514-
const float sdlThetaMulsF2 =
1513+
const float thetaMuls2 =
15151514
(kMulsInGeV * kMulsInGeV) * (0.1f + 0.2f * (rt_OutLo - rt_InUp) / 50.f) * (r3_InUp / rt_InUp);
1516-
const float sdlMuls2 = sdlThetaMulsF2 * 9.f / (ptCut * ptCut) * 16.f;
1515+
const float muls2 = thetaMuls2 * 9.f / (ptCut * ptCut) * 16.f;
15171516

15181517
float drtErr = (etaErr * etaErr) * multDzDr2;
15191518
drtErr += 0.03f * 0.03f; // Approximately account for IT module size
15201519
drtErr *= 9.f; // 3 sigma
1521-
drtErr += sdlMuls2 * multDzDr2 / 3.f * cosh2Eta;
1520+
drtErr += muls2 * multDzDr2 / 3.f * cosh2Eta;
15221521
drtErr = alpaka::math::sqrt(acc, drtErr);
15231522
const float drtDzIn = alpaka::math::abs(acc, ptIn / pz);
15241523

@@ -1537,8 +1536,8 @@ namespace lst {
15371536

15381537
const float alpha1GeV_OutLo =
15391538
alpaka::math::asin(acc, alpaka::math::min(acc, rt_OutLo * k2Rinv1GeVf / ptCut, kSinAlphaMax));
1540-
const float sdlPVoff = 0.1f / rt_OutLo;
1541-
sdlCut = alpha1GeV_OutLo + alpaka::math::sqrt(acc, sdlMuls2 + sdlPVoff * sdlPVoff);
1539+
const float pvOffset = 0.1f / rt_OutLo;
1540+
dPhiCut = alpha1GeV_OutLo + alpaka::math::sqrt(acc, muls2 + pvOffset * pvOffset);
15421541

15431542
float midPointX = 0.5f * (x_InLo + x_OutLo);
15441543
float midPointY = 0.5f * (y_InLo + y_OutLo);
@@ -1549,7 +1548,7 @@ namespace lst {
15491548
dPhi = lst::deltaPhi(acc, midPointX, midPointY, diffX, diffY);
15501549

15511550
// Cut #5: deltaPhiChange
1552-
if (alpaka::math::abs(acc, dPhi) > sdlCut)
1551+
if (alpaka::math::abs(acc, dPhi) > dPhiCut)
15531552
return false;
15541553

15551554
float alpha_InLo = __H2F(segmentsInGPU.dPhiChanges[innerSegmentIndex]);
@@ -1640,7 +1639,7 @@ namespace lst {
16401639

16411640
float min_ptBeta_ptBetaMax = alpaka::math::min(
16421641
acc, alpaka::math::abs(acc, pt_beta), lst::kPt_betaMax); //need to confirm the range-out value of 7 GeV
1643-
const float dBetaMuls2 = sdlThetaMulsF2 * 16.f / (min_ptBeta_ptBetaMax * min_ptBeta_ptBetaMax);
1642+
const float dBetaMuls2 = thetaMuls2 * 16.f / (min_ptBeta_ptBetaMax * min_ptBeta_ptBetaMax);
16441643

16451644
const float alphaInAbsReg =
16461645
alpaka::math::max(acc,

0 commit comments

Comments
 (0)