Skip to content

Commit f94d7fb

Browse files
authored
TOF: fix retrieval of integer output buffer CompressorTask.cxx (#6194)
To fix retrieval of integer output buffer size output buffer size will be the sum of the command-line-specified buffer size and the value automatically calculated. Unless a negative value is used as the command-line-specified buffer size, in which case a fixed buffer size is used.
1 parent 2c225ce commit f94d7fb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Detectors/TOF/compression/src/CompressorTask.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void CompressorTask<RDH, verbose>::init(InitContext& ic)
3838
auto decoderVerbose = ic.options().get<bool>("tof-compressor-decoder-verbose");
3939
auto encoderVerbose = ic.options().get<bool>("tof-compressor-encoder-verbose");
4040
auto checkerVerbose = ic.options().get<bool>("tof-compressor-checker-verbose");
41-
mOutputBufferSize = ic.options().get<bool>("tof-compressor-output-buffer-size");
41+
mOutputBufferSize = ic.options().get<int>("tof-compressor-output-buffer-size");
4242

4343
mCompressor.setDecoderCONET(decoderCONET);
4444
mCompressor.setDecoderVerbose(decoderVerbose);
@@ -102,7 +102,7 @@ void CompressorTask<RDH, verbose>::run(ProcessingContext& pc)
102102
headerOut.payloadSize = 0;
103103

104104
/** initialise output message **/
105-
auto bufferSize = mOutputBufferSize > 0 ? mOutputBufferSize : subspecBufferSize[subspec];
105+
auto bufferSize = mOutputBufferSize >= 0 ? mOutputBufferSize + subspecBufferSize[subspec] : std::abs(mOutputBufferSize);
106106
auto payloadMessage = device->NewMessage(bufferSize);
107107
auto bufferPointer = (char*)payloadMessage->GetData();
108108

0 commit comments

Comments
 (0)