42 useCompression_(
p.useCompression),
43 compressionAlgoStr_(
p.compressionAlgoStr),
45 lumiSectionInterval_(
p.lumiSectionInterval),
48 hltTriggerSelections_(),
51 int minCompressionLevel = 1;
52 int maxCompressionLevel = 9;
56 struct timezone dummyTZ;
57 gettimeofday(&
now, &dummyTZ);
65 minCompressionLevel = 0;
68 maxCompressionLevel = 20;
74 throw cms::Exception(
"StreamerOutputModuleCommon",
"Compression type unknown")
84 << maxCompressionLevel << std::endl;
104 uLong crc = crc32(0
L, Z_NULL, 0);
128 unsigned int new_size = src_size + 50000;
147 l1_names.push_back(
"t1");
148 l1_names.push_back(
"t10");
149 l1_names.push_back(
"t2");
153 auto init_message = std::make_unique<InitMsgBuilder>(&sbuf.
header_buf_[0],
169 init_message->setDataLength(src_size);
175 std::vector<unsigned char>& hltbits)
const {
178 std::vector<unsigned char> vHltState;
192 if (!vHltState.empty()) {
193 unsigned int packInOneByte = 4;
194 unsigned int sizeOfPackage = 1 + ((vHltState.size() - 1) / packInOneByte);
196 hltbits.resize(sizeOfPackage);
197 std::fill(hltbits.begin(), hltbits.end(), 0);
200 unsigned int whichByte =
i / packInOneByte;
201 unsigned int indxWithinByte =
i % packInOneByte;
202 hltbits[whichByte] = hltbits[whichByte] | (vHltState[
i] << (indxWithinByte * 2));
224 std::vector<bool> l1bit = {
true,
true,
false};
227 std::vector<unsigned char> hltbits;
232 lumi =
e.luminosityBlock();
235 struct timezone dummyTZ;
236 gettimeofday(&
now, &dummyTZ);
250 auto msg = std::make_unique<EventMsgBuilder>(&sbuf.
header_buf_[0],
265 if (headerSize > reserve_size)
266 throw cms::Exception(
"StreamerOutputModuleCommon",
"Header Overflow")
267 <<
" header of size " << headerSize <<
"bytes is too big to fit into the reserved buffer space";
270 msg->setBufAddr(&sbuf.
comp_buf_[reserve_size - headerSize]);
275 msg->setEventLength(src_size);
277 msg->setOrigDataSize(
280 msg->setOrigDataSize(0);
286 desc.addUntracked<
int>(
"max_event_size", 7000000)->setComment(
"Obsolete parameter.");
287 desc.addUntracked<
bool>(
"use_compression",
true)
288 ->setComment(
"If True, compression will be used to write streamer file.");
290 ->setComment(
"Compression algorithm to use: UNCOMPRESSED, ZLIB, LZMA or ZSTD");
291 desc.addUntracked<
int>(
"compression_level", 1)->setComment(
"Compression level to use on serialized ROOT events");
292 desc.addUntracked<
int>(
"lumiSection_interval", 0)
294 "If 0, use lumi section number from event.\n" 295 "If not 0, the interval in seconds between fake lumi sections.");
std::unique_ptr< EventMsgBuilder > serializeEvent(SerializeDataBuffer &sbuf, EventForOutput const &e, Handle< TriggerResults > const &triggerResults, ParameterSetID const &selectorCfg)
std::vector< BranchIDList > BranchIDLists
unsigned int currentEventSize() const
Strings hltTriggerSelections_
std::vector< std::string > const & getAllTriggerNames()
EventSelector::Strings Strings
ret
prodAgent to be discontinued
void setHltMask(EventForOutput const &e, Handle< TriggerResults > const &triggerResults, std::vector< unsigned char > &hltbits) const
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts
T getUntrackedParameter(std::string const &, T const &) const
std::vector< unsigned char > comp_buf_
std::unique_ptr< SerializeDataBuffer > serializerBuffer_
int serializeEvent(SerializeDataBuffer &data_buffer, EventForOutput const &event, ParameterSetID const &selectorConfig, StreamerCompressionAlgo compressionAlgo, int compression_level, unsigned int reserveSize) const
static void fillDescription(ParameterSetDescription &desc)
static std::vector< std::string > getEventSelectionVString(edm::ParameterSet const &pset)
int serializeRegistry(SerializeDataBuffer &data_buffer, const BranchIDLists &branchIDLists, ThinnedAssociationsHelper const &thinnedAssociationsHelper)
unsigned char const * bufferPointer() const
value_type compactForm() const
std::string compressionAlgoStr_
static Parameters parameters(ParameterSet const &ps)
unsigned int currentSpaceUsed() const
uint32_t adler32_chksum() const
std::string getReleaseVersion()
std::unique_ptr< InitMsgBuilder > serializeRegistry(SerializeDataBuffer &sbuf, BranchIDLists const &branchLists, ThinnedAssociationsHelper const &helper, std::string const &processName, std::string const &moduleLabel, ParameterSetID const &toplevel, SendJobHeader::ParameterSetMap const *psetMap)
static std::string const triggerResults("TriggerResults")
StreamSerializer serializer_
~StreamerOutputModuleCommon()
SerializeDataBuffer * getSerializerBuffer()
StreamerCompressionAlgo compressionAlgo_
StreamerOutputModuleCommon(Parameters const &p, SelectedProducts const *selections, std::string const &moduleLabel)
static constexpr unsigned int reserve_size