Skip to content

Commit 716307c

Browse files
committed
Fix in MCEventLabel::getIDOnly
1 parent 8e1a57b commit 716307c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

DataFormats/simulation/include/SimulationDataFormat/MCEventLabel.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class MCEventLabel
3434
static constexpr uint32_t MaskEvID = (0x1 << nbitsEvID) - 1;
3535
// Mask to extract MC source ID
3636
static constexpr uint32_t MaskSrcID = (0x1 << nbitsSrcID) - 1;
37+
// Mask to extract MC source and event ID only
38+
static constexpr uint32_t MaskSrcEvID = MaskSrcID | MaskEvID;
3739
// Mask to extract MC correct contribution weight
3840
static constexpr uint32_t MaskCorrW = (0x1 << nbitsCorrW) - 1;
3941
static constexpr float WeightNorm = 1. / float(MaskCorrW);
@@ -53,7 +55,7 @@ class MCEventLabel
5355
uint32_t getRawValue() const { return mLabel; }
5456

5557
// get only combined identifier, discarding weight info
56-
uint32_t getIDOnly() const { return mLabel & (0x1 << (nbitsEvID + nbitsSrcID)); }
58+
uint32_t getIDOnly() const { return mLabel & MaskSrcEvID; }
5759

5860
// compare
5961
bool compare(const MCEventLabel& other, bool strict = false) const

0 commit comments

Comments
 (0)