Skip to content

Commit e0ed8c9

Browse files
authored
Merge 92d07e4 into sapling-pr-archive-ktf
2 parents 38d2374 + 92d07e4 commit e0ed8c9

57 files changed

Lines changed: 1115 additions & 347 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/code-transformations.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.

Common/ML/src/OrtInterface.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ void OrtModel::initEnvironment()
140140

141141
void OrtModel::initSessionFromBuffer(const char* buffer, size_t bufferSize)
142142
{
143+
if (mAllocateDeviceMemory) {
144+
memoryOnDevice(mDeviceId);
145+
}
143146
mPImplOrt->sessionOptions.AddConfigEntry("session.load_model_format", "ONNX");
144147
mPImplOrt->sessionOptions.AddConfigEntry("session.use_ort_model_bytes_directly", "1");
145148

DataFormats/Calibration/include/DataFormatsCalibration/MeanVertexObject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class MeanVertexObject : public VertexBase
110110

111111
void setMeanXYVertexAtZ(VertexBase& v, float z) const
112112
{
113+
v = *this;
113114
v.setX(getXAtZ(z));
114115
v.setY(getYAtZ(z));
115116
v.setZ(z);

DataFormats/Detectors/TPC/include/DataFormatsTPC/ClusterNative.h

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,21 @@ struct ClusterNative {
7373
uint8_t sigmaTimePacked; //< Sigma of the time in packed format
7474
uint8_t sigmaPadPacked; //< Sigma of the pad in packed format
7575
uint16_t qMax; //< QMax of the cluster
76-
uint16_t qTot; //< Total charge of the cluster
76+
uint16_t qTotPacked; //< Total charge of the cluster
7777

7878
GPUd() static uint16_t packPad(float pad) { return (uint16_t)(pad * scalePadPacked + 0.5); }
7979
GPUd() static uint32_t packTime(float time) { return (uint32_t)(time * scaleTimePacked + 0.5); }
8080
GPUd() static float unpackPad(uint16_t pad) { return float(pad) * (1.f / scalePadPacked); }
8181
GPUd() static float unpackTime(uint32_t time) { return float(time) * (1.f / scaleTimePacked); }
8282

8383
GPUdDefault() ClusterNative() = default;
84-
GPUd() ClusterNative(uint32_t time, uint8_t flags, uint16_t pad, uint8_t sigmaTime, uint8_t sigmaPad, uint16_t qmax, uint16_t qtot) : padPacked(pad), sigmaTimePacked(sigmaTime), sigmaPadPacked(sigmaPad), qMax(qmax), qTot(qtot)
84+
GPUd() ClusterNative(uint32_t time, uint8_t flags, uint16_t pad, uint8_t sigmaTime, uint8_t sigmaPad, uint16_t qmax, uint16_t qtotPacked) : padPacked(pad), sigmaTimePacked(sigmaTime), sigmaPadPacked(sigmaPad), qMax(qmax), qTotPacked(qtotPacked)
8585
{
8686
setTimePackedFlags(time, flags);
8787
}
8888

8989
GPUd() uint16_t getQmax() const { return qMax; }
90-
GPUd() uint16_t getQtot() const
91-
{
92-
if (isSaturated()) [[unlikely]] {
93-
auto sQtot = getSaturatedQtot();
94-
return sQtot < USHRT_MAX ? sQtot : USHRT_MAX;
95-
}
96-
return qTot;
97-
}
90+
GPUd() uint32_t getQtot() const { return isSaturated() ? getSaturatedQtot() : (uint32_t)qTotPacked; }
9891
GPUd() uint8_t getFlags() const { return timeFlagsPacked >> 24; }
9992
GPUd() uint32_t getTimePacked() const { return timeFlagsPacked & 0xFFFFFF; }
10093
GPUd() void setTimePackedFlags(uint32_t timePacked, uint8_t flags)
@@ -155,19 +148,19 @@ struct ClusterNative {
155148
sigmaPadPacked = tmp;
156149
}
157150

158-
GPUd() bool isSaturated() const { return qTot > maxRegularQtot; }
151+
GPUd() bool isSaturated() const { return qTotPacked > maxRegularQtot; }
159152

160153
GPUd() void setSaturatedQtot(uint32_t qtot)
161154
{
162-
this->qTot = USHRT_MAX;
155+
this->qTotPacked = USHRT_MAX;
163156
if (qtot < maxSaturatedQtot) {
164-
this->qTot = ((qtot + scaleSaturatedQtot / 2) / scaleSaturatedQtot) + maxRegularQtot;
157+
this->qTotPacked = ((qtot + scaleSaturatedQtot / 2) / scaleSaturatedQtot) + maxRegularQtot;
165158
}
166159
}
167160

168161
GPUd() uint32_t getSaturatedQtot() const
169162
{
170-
return uint32_t(qTot - maxRegularQtot) * scaleSaturatedQtot;
163+
return uint32_t(qTotPacked - maxRegularQtot) * scaleSaturatedQtot;
171164
}
172165

173166
GPUd() void setSaturatedTailLength(uint32_t tail)
@@ -192,8 +185,8 @@ struct ClusterNative {
192185
return (this->sigmaPadPacked < rhs.sigmaPadPacked);
193186
} else if (this->qMax != rhs.qMax) {
194187
return (this->qMax < rhs.qMax);
195-
} else if (this->qTot != rhs.qTot) {
196-
return (this->qTot < rhs.qTot);
188+
} else if (this->qTotPacked != rhs.qTotPacked) {
189+
return (this->getQtot() < rhs.getQtot());
197190
} else {
198191
return (this->getFlags() < rhs.getFlags());
199192
}
@@ -206,7 +199,7 @@ struct ClusterNative {
206199
this->sigmaTimePacked == rhs.sigmaTimePacked &&
207200
this->sigmaPadPacked == rhs.sigmaPadPacked &&
208201
this->qMax == rhs.qMax &&
209-
this->qTot == rhs.qTot &&
202+
this->qTotPacked == rhs.qTotPacked &&
210203
this->getFlags() == rhs.getFlags();
211204
}
212205

DataFormats/Detectors/TPC/include/DataFormatsTPC/ClusterNativeHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class ClusterNativeHelper
312312
sigmaTime = rhs.getSigmaTime();
313313
sigmaPad = rhs.getSigmaPad();
314314
qMax = rhs.qMax;
315-
qTot = rhs.qTot;
315+
qTot = rhs.qTotPacked;
316316
flags = rhs.getFlags();
317317
return *this;
318318
}

Detectors/Align/src/AlignableDetectorTPC.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,18 @@ int AlignableDetectorTPC::processPoints(GIndex gid, int npntCut, bool inv)
166166
// mController->getTPCCorrMaps()->Transform(sector, row, cl->getPad(), cl->getTime(), x, y, z, tOffset);
167167
currentRow = row;
168168
currentSector = sector;
169-
charge = cl->qTot;
169+
charge = cl->getQtot();
170170
clusterState = nextState;
171171
combRow = row;
172172
LOGP(debug, "starting a supercluster at row {} of sector {} -> {},{},{}", currentRow, currentSector, x, y, z);
173173
} else {
174174
// float xx, yy, zz;
175175
// mController->getTPCCorrMaps()->Transform(sector, row, cl->getPad(), cl->getTime(), xx, yy, zz, tOffset);
176-
x += xTmp * cl->qTot;
177-
y += yTmp * cl->qTot;
178-
z += zTmp * cl->qTot;
179-
combRow += row * cl->qTot;
180-
charge += cl->qTot;
176+
x += xTmp * cl->getQtot();
177+
y += yTmp * cl->getQtot();
178+
z += zTmp * cl->getQtot();
179+
combRow += row * cl->getQtot();
180+
charge += cl->getQtot();
181181
clusterState |= nextState;
182182
npntCut--;
183183
LOGP(debug, "merging cluster #{} at row {} to a supercluster starting at row {} ", clusters + 1, row, currentRow);

Detectors/ITSMFT/common/reconstruction/src/Clusterer.cxx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,13 +389,12 @@ void Clusterer::ClustererThread::updateChip(const ChipPixelData* curChipData, ui
389389
}
390390
} else {
391391
// row above should be always checked
392-
int nnb = 0, lowestIndex = curr[row - 1], lowestNb = 0, *nbrCol[4], nbrRow[4];
392+
int nnb = 0, lowestIndex = curr[row - 1], *nbrCol[4], nbrRow[4];
393393
if (lowestIndex >= 0) {
394394
nbrCol[nnb] = curr;
395395
nbrRow[nnb++] = row - 1;
396396
} else {
397397
lowestIndex = 0x7ffff;
398-
lowestNb = -1;
399398
}
400399
#ifdef _ALLOW_DIAGONAL_ALPIDE_CLUSTERS_
401400
for (int i : {-1, 0, 1}) {
@@ -405,7 +404,6 @@ void Clusterer::ClustererThread::updateChip(const ChipPixelData* curChipData, ui
405404
nbrRow[nnb] = row + i;
406405
if (v < lowestIndex) {
407406
lowestIndex = v;
408-
lowestNb = nnb;
409407
}
410408
nnb++;
411409
}
@@ -415,8 +413,7 @@ void Clusterer::ClustererThread::updateChip(const ChipPixelData* curChipData, ui
415413
nbrCol[nnb] = prev;
416414
nbrRow[nnb] = row;
417415
if (prev[row] < lowestIndex) {
418-
lowestIndex = v;
419-
lowestNb = nnb;
416+
lowestIndex = prev[row];
420417
}
421418
nnb++;
422419
}

Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ void TrackInterpolation::interpolateTrack(int iSeed)
520520
mCache[row].clY = clTPCYZ[0];
521521
mCache[row].clZ = clTPCYZ[1];
522522
mCache[row].clAngle = o2::math_utils::sector2Angle(sector);
523-
mCacheDEDX[row].first = clTPC.getQtot();
523+
mCacheDEDX[row].first = std::min<uint16_t>(clTPC.getQtot(), UINT16_MAX);
524524
mCacheDEDX[row].second = clTPC.getQmax();
525525
int imb = int(clTPC.getTime() * mNTPCOccBinLengthInv);
526526
if (imb < mTPCParam->occupancyMapSize) {

Detectors/TPC/calibration/include/TPCCalibration/TrackDump.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ class TrackDump
4444
float gx{};
4545
float gy{};
4646
uint16_t qMax; //< QMax of the cluster
47-
uint16_t qTot; //< Total charge of the cluster
47+
uint32_t qTot; //< Total charge of the cluster
4848
uint8_t sector = 0;
4949
uint8_t padrow = 0;
5050

51-
ClassDefNV(ClusterGlobal, 1);
51+
ClassDefNV(ClusterGlobal, 2);
5252
};
5353

5454
struct ClusterNativeAdd : public ClusterNative {

Detectors/TPC/calibration/src/CalculatedEdx.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void CalculatedEdx::calculatedEdx(o2::tpc::TrackTPC& track, dEdxInfo& output, fl
245245
}
246246

247247
// get charge values
248-
float chargeTot = cl.qTot;
248+
float chargeTot = cl.getQtot();
249249
float chargeMax = cl.qMax;
250250

251251
// get threshold

0 commit comments

Comments
 (0)