Skip to content

Commit dcf7c99

Browse files
committed
Avoid uninitialised values for invalid pixels
Explicitly set the row and column values for invalid pixels to -1, instead of leaving it uninitialised.
1 parent 8b318cc commit dcf7c99

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CondFormats/PPSObjects/interface/CTPPSPixelIndices.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace rpixValues {
6565
constexpr int ROCSizeInY = 52; // ROC col size in pixels
6666
// Default DET barrel size
6767
constexpr int defaultDetSizeInX = 160; // Det row size in pixels (2 ROCs)
68-
constexpr int defaultDetSizeInY = 156; // Det col size in pixels (3 ROCs)
68+
constexpr int defaultDetSizeInY = 156; // Det col size in pixels (3 ROCs)
6969

7070
// Check the limits
7171
constexpr bool CTPPS_CHECK_LIMITS = true;
@@ -168,13 +168,13 @@ class CTPPSPixelIndices {
168168
// The transformation depends on the ROC-ID
169169
if (rocId >= 0 && rocId < 3) {
170170
row = 159 - rowROC;
171-
172171
col = (rocId + 1) * rpixValues::ROCSizeInY - colROC - 1;
173172
} else if (rocId >= 3 && rocId < 6) {
174173
row = rowROC;
175-
176174
col = (5 - rocId) * rpixValues::ROCSizeInY + colROC;
177175
} else {
176+
row = -1;
177+
col = -1;
178178
edm::LogError("RPix") << "CTPPSPixelIndices: wrong ROC ID " << rocId;
179179
return -1;
180180
}
@@ -188,6 +188,7 @@ class CTPPSPixelIndices {
188188

189189
return 0;
190190
}
191+
191192
//**************************************************************************
192193
// Transform from the module indixes to the ROC indices.
193194
// col, row - indices in the Module

0 commit comments

Comments
 (0)