Skip to content

Commit 44e3950

Browse files
committed
Remove ApplyCarryOverToLastPage in EMC mc->raw, use const TrailerSize
1 parent 480cccb commit 44e3950

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

Detectors/EMCAL/simulation/src/RawWriter.cxx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ void RawWriter::init()
2424
{
2525
mRawWriter = std::make_unique<o2::raw::RawFileWriter>(o2::header::gDataOriginEMC, false);
2626
mRawWriter->setCarryOverCallBack(this);
27-
mRawWriter->setApplyCarryOverToLastPage(true);
2827
for (auto iddl = 0; iddl < 40; iddl++) {
2928
// For EMCAL set
3029
// - FEE ID = DDL ID
@@ -301,20 +300,12 @@ int RawWriter::carryOverMethod(const header::RDHAny* rdh, const gsl::span<char>
301300
const char* ptr, int maxSize, int splitID,
302301
std::vector<char>& trailer, std::vector<char>& header) const
303302
{
304-
303+
constexpr int TrailerSize = 9 * sizeof(uint32_t);
305304
int bytesLeft = data.data() + data.size() - ptr;
306305
int leftAfterSplit = bytesLeft - maxSize;
307306

308-
gsl::span<const uint32_t> payloadwords(reinterpret_cast<const uint32_t*>(data.data()), data.size() / sizeof(uint32_t));
309-
auto rcutrailer = RCUTrailer::constructFromPayloadWords(payloadwords);
310-
int trailerSize = rcutrailer.getTrailerSize() * sizeof(uint32_t);
311-
312-
int Margin = 0;
313-
314-
if (leftAfterSplit < trailerSize + Margin) {
315-
316-
// 0 will force closing current page and carrying the rest on new one
317-
return std::max(0, bytesLeft - (trailerSize + Margin));
307+
if (leftAfterSplit < TrailerSize) {
308+
return std::max(0, bytesLeft - TrailerSize);
318309
}
319310

320311
return maxSize;

0 commit comments

Comments
 (0)