diff --git a/algo/detectors/bmon/UnpackBmon.cxx b/algo/detectors/bmon/UnpackBmon.cxx index 475a3093e0fefdbd43a0e834ea44deedaf6937b0..8719d9593ca50d2f4ae684f3ad0c794fdd8430e2 100644 --- a/algo/detectors/bmon/UnpackBmon.cxx +++ b/algo/detectors/bmon/UnpackBmon.cxx @@ -44,6 +44,9 @@ namespace cbm::algo // --- Interpret MS content as sequence of SMX messages auto message = reinterpret_cast<const critof001::Message*>(msContent); + const uint32_t maxDigis = numMessages - 2; // -2 for the TS_MSB and EPOCH messages + result.first.reserve(maxDigis); + // --- The first message in the MS is expected to be of type EPOCH. if (message[0].getMessageType() != critof001::MSG_EPOCH) { result.second.fNumErrInvalidFirstMessage++; diff --git a/algo/detectors/much/UnpackMuch.cxx b/algo/detectors/much/UnpackMuch.cxx index 850f5ef1f5d01ce95684900dce0b7a1a90caafe1..4ebd73300ddeb0ff70341c468586f5e4ec9dca38 100644 --- a/algo/detectors/much/UnpackMuch.cxx +++ b/algo/detectors/much/UnpackMuch.cxx @@ -49,6 +49,9 @@ namespace cbm::algo return result; } + const uint32_t maxDigis = numMessages - 2; // -2 for the TS_MSB and EPOCH messages + result.first.reserve(maxDigis); + // --- Interpret MS content as sequence of SMX messages auto message = reinterpret_cast<const stsxyter::Message*>(msContent); diff --git a/algo/detectors/tof/UnpackTof.cxx b/algo/detectors/tof/UnpackTof.cxx index 5ce7650562f7097473d75a4df2262b8ddfa7f57d..7bd71d827e0d120655db0250f52e27a68beb421e 100644 --- a/algo/detectors/tof/UnpackTof.cxx +++ b/algo/detectors/tof/UnpackTof.cxx @@ -44,6 +44,9 @@ namespace cbm::algo // --- Interpret MS content as sequence of Critof messages auto message = reinterpret_cast<const critof001::Message*>(msContent); + const uint32_t maxDigis = numMessages - 2; // -2 for the TS_MSB and EPOCH messages + result.first.reserve(maxDigis); + // --- The first message in the MS is expected to be of type EPOCH. if (message[0].getMessageType() != critof001::MSG_EPOCH) { result.second.fNumErrInvalidFirstMessage++;