Skip to content

Commit f8a184f

Browse files
committed
Use bitset<32> in GlobalTrackID to avoid schema evolution issues with future changes.
1 parent 41e26c9 commit f8a184f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

  • DataFormats
    • Detectors/Common/include/DetectorsCommonDataFormats
    • Reconstruction/include/ReconstructionDataFormats

DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/DetID.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class DetID
8787

8888
static constexpr int nDetectors = Last + 1; ///< number of defined detectors
8989
typedef o2::gpu::gpustd::bitset<32> mask_t;
90+
static_assert(nDetectors <= 32, "bitset<32> insufficient");
9091

9192
#ifndef GPUCA_GPUCODE_DEVICE
9293
static constexpr std::string_view NONE{"none"}; ///< keywork for no-detector

DataFormats/Reconstruction/include/ReconstructionDataFormats/GlobalTrackID.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class GlobalTrackID : public AbstractRef<25, 5, 2>
6464
};
6565

6666
using AbstractRef<25, 5, 2>::AbstractRef;
67-
typedef o2::gpu::gpustd::bitset<NSources> mask_t;
67+
static_assert(NSources <= 32, "bitset<32> insufficient");
68+
typedef o2::gpu::gpustd::bitset<32> mask_t;
6869

6970
#ifndef GPUCA_GPUCODE
7071
static constexpr std::string_view NONE{"none"}; ///< keywork for no sources

0 commit comments

Comments
 (0)