From 6d0e7a18412037164b9f4e9a813cca03a6c34478 Mon Sep 17 00:00:00 2001 From: Nick Manganelli Date: Thu, 7 Mar 2024 07:22:33 +0100 Subject: [PATCH] Fix TkJetWord.h and VertexWord.h ptBits() and z0Bits() implementations, avoid truncating float bits from ap_(u)fixed --- DataFormats/L1Trigger/interface/TkJetWord.h | 4 ++-- DataFormats/L1Trigger/interface/VertexWord.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DataFormats/L1Trigger/interface/TkJetWord.h b/DataFormats/L1Trigger/interface/TkJetWord.h index 8f45482c4e355..25a6f87528071 100644 --- a/DataFormats/L1Trigger/interface/TkJetWord.h +++ b/DataFormats/L1Trigger/interface/TkJetWord.h @@ -134,10 +134,10 @@ namespace l1t { // These functions return the packed bits in integer format for each quantity // Signed quantities have the sign enconded in the left-most bit. - unsigned int ptBits() const { return ptWord().to_uint(); } + unsigned int ptBits() const { return ptWord().range().to_uint(); } unsigned int glbEtaBits() const { return glbEtaWord().to_uint(); } unsigned int glbPhiBits() const { return glbPhiWord().to_uint(); } - unsigned int z0Bits() const { return z0Word().to_uint(); } + unsigned int z0Bits() const { return z0Word().range().to_uint(); } unsigned int ntBits() const { return ntWord().to_uint(); } unsigned int xtBits() const { return xtWord().to_uint(); } unsigned int dispFlagBits() const { return dispFlagWord().to_uint(); } diff --git a/DataFormats/L1Trigger/interface/VertexWord.h b/DataFormats/L1Trigger/interface/VertexWord.h index 040a21b3e5718..21ed4091824d3 100644 --- a/DataFormats/L1Trigger/interface/VertexWord.h +++ b/DataFormats/L1Trigger/interface/VertexWord.h @@ -145,9 +145,9 @@ namespace l1t { // These functions return the packed bits in integer format for each quantity // Signed quantities have the sign enconded in the left-most bit. unsigned int validBits() const { return validWord().to_uint(); } - unsigned int z0Bits() const { return z0Word().to_uint(); } + unsigned int z0Bits() const { return z0Word().range().to_uint(); } unsigned int multiplicityBits() const { return multiplicityWord().to_uint(); } - unsigned int ptBits() const { return ptWord().to_uint(); } + unsigned int ptBits() const { return ptWord().range().to_uint(); } unsigned int qualityBits() const { return qualityWord().to_uint(); } unsigned int inverseMultiplicityBits() const { return inverseMultiplicityWord().to_uint(); } unsigned int unassignedBits() const { return unassignedWord().to_uint(); }