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(
"StreamerOutputMsgBuilders",
"Compression type unknown")
84 << maxCompressionLevel << std::endl;
104 uLong crc = crc32(0
L, Z_NULL, 0);
126 unsigned int new_size = src_size + 50000;
145 l1_names.push_back(
"t1");
146 l1_names.push_back(
"t10");
147 l1_names.push_back(
"t2");
151 auto init_message = std::make_unique<InitMsgBuilder>(&sbuf.
header_buf_[0],
167 init_message->setDataLength(src_size);
173 std::vector<unsigned char>& hltbits)
const {
176 std::vector<unsigned char> vHltState;
190 if (!vHltState.empty()) {
191 unsigned int packInOneByte = 4;
192 unsigned int sizeOfPackage = 1 + ((vHltState.size() - 1) / packInOneByte);
194 hltbits.resize(sizeOfPackage);
195 std::fill(hltbits.begin(), hltbits.end(), 0);
198 unsigned int whichByte =
i / packInOneByte;
199 unsigned int indxWithinByte =
i % packInOneByte;
200 hltbits[whichByte] = hltbits[whichByte] | (vHltState[
i] << (indxWithinByte * 2));
217 uint32_t eventMetaDataChecksum)
const {
221 std::vector<unsigned char> hltbits;
227 struct timezone dummyTZ;
228 gettimeofday(&
now, &dummyTZ);
245 std::vector<unsigned char> hltbits;
255 std::vector<unsigned char> hltbits,
256 unsigned int hltsize,
265 std::vector<bool> l1bit = {
true,
true,
false};
268 auto msg = std::make_unique<EventMsgBuilder>(&sbuf.
header_buf_[0],
283 if (headerSize > reserve_size)
284 throw cms::Exception(
"StreamerOutputMsgBuilders",
"Header Overflow")
285 <<
" header of size " << headerSize <<
"bytes is too big to fit into the reserved buffer space";
288 msg->setBufAddr(&sbuf.
comp_buf_[reserve_size - headerSize]);
293 msg->setEventLength(src_size);
295 msg->setOrigDataSize(
298 msg->setOrigDataSize(0);
304 desc.addUntracked<
int>(
"max_event_size", 7000000)->setComment(
"Obsolete parameter.");
305 desc.addUntracked<
bool>(
"use_compression",
true)
306 ->setComment(
"If True, compression will be used to write streamer file.");
308 ->setComment(
"Compression algorithm to use: UNCOMPRESSED, ZLIB, LZMA or ZSTD");
309 desc.addUntracked<
int>(
"compression_level", 1)->setComment(
"Compression level to use on serialized ROOT events");
310 desc.addUntracked<
int>(
"lumiSection_interval", 0)
312 "If 0, use lumi section number from event.\n" 313 "If not 0, the interval in seconds between fake lumi sections.");
std::vector< unsigned char > comp_buf_
std::vector< BranchIDList > BranchIDLists
int serializeEvent(SerializeDataBuffer &data_buffer, EventForOutput const &event, ParameterSetID const &selectorConfig, uint32_t metaDataChecksum, StreamerCompressionAlgo compressionAlgo, int compression_level, unsigned int reserveSize) const
std::vector< std::string > const & getAllTriggerNames()
ret
prodAgent to be discontinued
int serializeEventMetaData(SerializeDataBuffer &data_buffer, const BranchIDLists &branchIDLists, ThinnedAssociationsHelper const &thinnedAssociationsHelper, StreamerCompressionAlgo compressionAlgo, int compression_level, unsigned int reserveSize) const
data_buffer.adler32_chksum_ is the meta data checksum to pass to subsequent events ...
unsigned int currentEventSize() const
std::unique_ptr< EventMsgBuilder > serializeEventCommon(uint32 run, uint32 lumi, uint64 event, std::vector< unsigned char > hltbits, unsigned int hltsize, SerializeDataBuffer &sbuf) const
static constexpr unsigned int reserve_size
void setHltMask(EventForOutput const &e, Handle< TriggerResults > const &triggerResults, std::vector< unsigned char > &hltbits) const
int serializeRegistry(SerializeDataBuffer &data_buffer) const
uint32_t adler32_chksum() const
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts
T getUntrackedParameter(std::string const &, T const &) const
static void fillDescription(ParameterSetDescription &desc)
~StreamerOutputMsgBuilders()
std::string compressionAlgoStr_
static std::vector< std::string > getEventSelectionVString(edm::ParameterSet const &pset)
Abs< T >::type abs(const T &t)
std::unique_ptr< EventMsgBuilder > serializeEvent(SerializeDataBuffer &sbuf, EventForOutput const &e, Handle< TriggerResults > const &triggerResults, ParameterSetID const &selectorCfg, uint32_t eventMetaDataChecksum) const
value_type compactForm() const
unsigned char const * bufferPointer() const
Strings hltTriggerSelections_
StreamerOutputMsgBuilders(Parameters const &p, SelectedProducts const *selections, std::string const &moduleLabel)
std::string getReleaseVersion()
static Parameters parameters(ParameterSet const &ps)
static std::string const triggerResults("TriggerResults")
unsigned long long uint64
StreamSerializer serializer_
std::vector< std::string > Strings
unsigned int currentSpaceUsed() const
StreamerCompressionAlgo compressionAlgo_
std::pair< std::unique_ptr< EventMsgBuilder >, uint32_t > serializeEventMetaData(SerializeDataBuffer &sbuf, BranchIDLists const &branchLists, ThinnedAssociationsHelper const &helper) const
std::unique_ptr< InitMsgBuilder > serializeRegistry(SerializeDataBuffer &sbuf, std::string const &processName, std::string const &moduleLabel, ParameterSetID const &toplevel, SendJobHeader::ParameterSetMap const *psetMap) const