32 useCompression_(ps.getUntrackedParameter<
bool>(
"use_compression")),
33 compressionAlgoStr_(ps.getUntrackedParameter<
std::
string>(
"compression_algorithm")),
34 compressionLevel_(ps.getUntrackedParameter<
int>(
"compression_level")),
35 lumiSectionInterval_(ps.getUntrackedParameter<
int>(
"lumiSection_interval")),
38 hltTriggerSelections_(),
41 int minCompressionLevel = 1;
42 int maxCompressionLevel = 9;
46 struct timezone dummyTZ;
47 gettimeofday(&
now, &dummyTZ);
55 minCompressionLevel = 0;
58 maxCompressionLevel = 20;
64 throw cms::Exception(
"StreamerOutputModuleCommon",
"Compression type unknown")
74 << maxCompressionLevel << std::endl;
94 uLong crc = crc32(0
L, Z_NULL, 0);
118 unsigned int new_size = src_size + 50000;
137 l1_names.push_back(
"t1");
138 l1_names.push_back(
"t10");
139 l1_names.push_back(
"t2");
143 auto init_message = std::make_unique<InitMsgBuilder>(&sbuf.
header_buf_[0],
159 init_message->setDataLength(src_size);
165 std::vector<unsigned char>& hltbits)
const {
168 std::vector<unsigned char> vHltState;
182 if (!vHltState.empty()) {
183 unsigned int packInOneByte = 4;
184 unsigned int sizeOfPackage = 1 + ((vHltState.size() - 1) / packInOneByte);
186 hltbits.resize(sizeOfPackage);
187 std::fill(hltbits.begin(), hltbits.end(), 0);
190 unsigned int whichByte =
i / packInOneByte;
191 unsigned int indxWithinByte =
i % packInOneByte;
192 hltbits[whichByte] = hltbits[whichByte] | (vHltState[
i] << (indxWithinByte * 2));
214 std::vector<bool> l1bit = {
true,
true,
false};
217 std::vector<unsigned char> hltbits;
222 lumi =
e.luminosityBlock();
225 struct timezone dummyTZ;
226 gettimeofday(&
now, &dummyTZ);
240 auto msg = std::make_unique<EventMsgBuilder>(&sbuf.
header_buf_[0],
255 if (headerSize > reserve_size)
256 throw cms::Exception(
"StreamerOutputModuleCommon",
"Header Overflow")
257 <<
" header of size " << headerSize <<
"bytes is too big to fit into the reserved buffer space";
260 msg->setBufAddr(&sbuf.
comp_buf_[reserve_size - headerSize]);
265 msg->setEventLength(src_size);
267 msg->setOrigDataSize(
270 msg->setOrigDataSize(0);
276 desc.addUntracked<
int>(
"max_event_size", 7000000)->setComment(
"Obsolete parameter.");
277 desc.addUntracked<
bool>(
"use_compression",
true)
278 ->setComment(
"If True, compression will be used to write streamer file.");
280 ->setComment(
"Compression algorithm to use: UNCOMPRESSED, ZLIB, LZMA or ZSTD");
281 desc.addUntracked<
int>(
"compression_level", 1)->setComment(
"Compression level to use on serialized ROOT events");
282 desc.addUntracked<
int>(
"lumiSection_interval", 0)
284 "If 0, use lumi section number from event.\n" 285 "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
void setHltMask(EventForOutput const &e, Handle< TriggerResults > const &triggerResults, std::vector< unsigned char > &hltbits) const
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts
std::vector< unsigned char > comp_buf_
std::unique_ptr< SerializeDataBuffer > serializerBuffer_
StreamerOutputModuleCommon(ParameterSet const &ps, SelectedProducts const *selections, std::string const &moduleLabel)
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_
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_
static constexpr unsigned int reserve_size