Skip to content

Commit 720ee3d

Browse files
authored
[PWGLF] Fix converter
Fixes a bug in which a bad dummy value of findable TPC clusters was used. If coupled with the limited range of `uint8_t` and `int8_t`, this could result in some over/underflow issues.
1 parent 0b862ed commit 720ee3d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

PWGLF/TableProducer/Strangeness/Converters/stradautracksextraconverter2.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ struct stradautracksextraconverter2 {
2424
void process(aod::DauTrackExtras_001 const& dauTrackExtras_001)
2525
{
2626
for (auto& values : dauTrackExtras_001) {
27+
const int valueFindable = 130; // maximize dynamic range of stored value
28+
int findableMinusFound = valueFindable-values.tpcClusters();
29+
int findableMinusCrossedRows = valueFindable-values.tpcCrossedRows();
2730
dauTrackExtras_002(values.itsChi2PerNcl(),
2831
values.detectorMap(),
2932
values.itsClusterSizes(),
30-
static_cast<uint8_t>(0), // findable (unknown in old format)
31-
-values.tpcClusters(), // findable minus found: we know found
32-
-values.tpcCrossedRows()); // findable minus crossed rows: we know crossed rows
33+
static_cast<uint8_t>(valueFindable), // dummy findable
34+
static_cast<int8_t>(findableMinusFound), // calculated based on max
35+
static_cast<int8_t>(findableMinusCrossedRows)); // calculated based on max
3336
}
3437
}
3538
};

0 commit comments

Comments
 (0)