30 useCompression_(ps.getUntrackedParameter<
bool>(
"use_compression")),
31 compressionAlgoStr_(ps.getUntrackedParameter<
std::
string>(
"compression_algorithm")),
32 compressionLevel_(ps.getUntrackedParameter<
int>(
"compression_level")),
33 lumiSectionInterval_(ps.getUntrackedParameter<
int>(
"lumiSection_interval")),
36 hltTriggerSelections_(),
39 int minCompressionLevel = 1;
40 int maxCompressionLevel = 9;
44 struct timezone dummyTZ;
45 gettimeofday(&
now, &dummyTZ);
53 minCompressionLevel = 0;
56 maxCompressionLevel = 20;
62 throw cms::Exception(
"StreamerOutputModuleCommon",
"Compression type unknown")
72 << maxCompressionLevel << std::endl;
107 unsigned int new_size = src_size + 50000;
128 l1_names.push_back(
"t1");
129 l1_names.push_back(
"t10");
130 l1_names.push_back(
"t2");
133 uLong crc = crc32(0
L, Z_NULL, 0);
138 auto init_message = std::make_unique<InitMsgBuilder>(&sbuf.
header_buf_[0],
154 init_message->setDataLength(src_size);
160 std::vector<unsigned char>& hltbits)
const {
163 std::vector<unsigned char> vHltState;
177 if (!vHltState.empty()) {
178 unsigned int packInOneByte = 4;
179 unsigned int sizeOfPackage = 1 + ((vHltState.size() - 1) / packInOneByte);
181 hltbits.resize(sizeOfPackage);
182 std::fill(hltbits.begin(), hltbits.end(), 0);
185 unsigned int whichByte =
i / packInOneByte;
186 unsigned int indxWithinByte =
i % packInOneByte;
187 hltbits[whichByte] = hltbits[whichByte] | (vHltState[
i] << (indxWithinByte * 2));
209 std::vector<bool> l1bit = {
true,
true,
false};
212 std::vector<unsigned char> hltbits;
217 lumi =
e.luminosityBlock();
220 struct timezone dummyTZ;
221 gettimeofday(&
now, &dummyTZ);
235 auto msg = std::make_unique<EventMsgBuilder>(&sbuf.
header_buf_[0],
250 if (headerSize > reserve_size)
251 throw cms::Exception(
"StreamerOutputModuleCommon",
"Header Overflow")
252 <<
" header of size " << headerSize <<
"bytes is too big to fit into the reserved buffer space";
255 msg->setBufAddr(&sbuf.
comp_buf_[reserve_size - headerSize]);
260 msg->setEventLength(src_size);
262 msg->setOrigDataSize(
265 msg->setOrigDataSize(0);
271 desc.
addUntracked<
int>(
"max_event_size", 7000000)->setComment(
"Obsolete parameter.");
273 ->setComment(
"If True, compression will be used to write streamer file.");
275 ->setComment(
"Compression algorithm to use: UNCOMPRESSED, ZLIB, LZMA or ZSTD");
276 desc.
addUntracked<
int>(
"compression_level", 1)->setComment(
"Compression level to use on serialized ROOT events");
279 "If 0, use lumi section number from event.\n"
280 "If not 0, the interval in seconds between fake lumi sections.");