Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PWGLF/DataModel/LFResonanceTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ struct PidNSigma {
{
uint8_t TPCencoded = encodeNSigma(TPCnSigma);
uint8_t TOFencoded = hasTOF ? encodeNSigma(TOFnSigma) : 0x0F; // If TOF is not available, set all 4 bits to 1
flag = (TPCencoded << 4) | TOFencoded; // Upper 4 bits = TPC, Lower 4 bits = TOF
flag = (TPCencoded << 4) | TOFencoded; // Upper 4 bits = TPC, Lower 4 bits = TOF
}

/// @brief Encode 0.2 sigma interval to 0~10 range
static uint8_t encodeNSigma(float nSigma)
{
float encoded = std::abs((nSigma - 1.5) / 0.2); // Convert to 0~10 range
float encoded = std::abs((nSigma - 1.5) / 0.2); // Convert to 0~10 range
encoded = std::min(std::max(encoded, 0.f), 10.f); // Clamp to 0~10 range
return (uint8_t)round(encoded);
}
Expand Down
Loading