35 void packIntoString(std::vector<unsigned char>
const&
source,
36 std::vector<unsigned char>& package) {
37 if (source.empty()) {
return;}
38 unsigned int packInOneByte = 4;
39 unsigned int sizeOfPackage = 1+((source.size()-1)/packInOneByte);
41 package.resize(sizeOfPackage);
42 memset(&package[0], 0x00, sizeOfPackage);
45 unsigned int whichByte =
i/packInOneByte;
46 unsigned int indxWithinByte =
i % packInOneByte;
47 package[whichByte] = package[whichByte] | (source[
i] << (indxWithinByte*2));
60 selections_(&keptProducts()[
InEvent]),
61 maxEventSize_(ps.getUntrackedParameter<
int>(
"max_event_size")),
62 useCompression_(ps.getUntrackedParameter<
bool>(
"use_compression")),
63 compressionLevel_(ps.getUntrackedParameter<
int>(
"compression_level")),
64 lumiSectionInterval_(ps.getUntrackedParameter<
int>(
"lumiSection_interval")),
65 serializer_(selections_),
66 serializeDataBuffer_(),
74 hltTriggerSelections_(),
80 struct timezone dummyTZ;
81 gettimeofday(&now, &dummyTZ);
82 timeInSecSinceUTC =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0);
87 <<
" no compression" << std::endl;
92 <<
" using max compression level 9" << std::endl;
142 std::unique_ptr<InitMsgBuilder>
150 unsigned int new_size = src_size + 50000;
172 l1_names.push_back(
"t1");
173 l1_names.push_back(
"t10");
174 l1_names.push_back(
"t2");
180 uLong crc = crc32(0
L, Z_NULL, 0);
181 Bytef
const* buf = (Bytef
const*)(moduleLabel.data());
182 crc = crc32(crc, buf, moduleLabel.length());
185 auto init_message = std::make_unique<InitMsgBuilder>(
195 std::copy(src, src + src_size, init_message->dataAddress());
196 init_message->setDataLength(src_size);
214 std::vector<unsigned char> vHltState;
218 vHltState.push_back(((prod->at(
i)).state()));
227 packIntoString(vHltState,
hltbits_);
241 struct timezone dummyTZ;
242 gettimeofday(&now, &dummyTZ);
243 double timeInSec =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0) -
timeInSecSinceUTC;
248 std::unique_ptr<EventMsgBuilder>
272 unsigned int new_size = src_size + 50000;
275 auto msg = std::make_unique<EventMsgBuilder>(
293 msg->setEventLength(src_size);
303 ->setComment(
"Starting size in bytes of the serialized event buffer.");
305 ->setComment(
"If True, compression will be used to write streamer file.");
307 ->setComment(
"ROOT compression level to use.");
309 ->setComment(
"If 0, use lumi section number from event.\n" 310 "If not 0, the interval in seconds between fake lumi sections.");
std::unique_ptr< EventMsgBuilder > serializeEvent(EventForOutput const &e)
~StreamerOutputModuleBase() override
ParameterSetID const & mainParameterSetID() const
EventNumber_t event() const
static void fillDescription(ParameterSetDescription &desc)
EventID const & id() const
ModuleDescription const & description() const
value_type compactForm() const
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Trig getTriggerResults(EDGetTokenT< TriggerResults > const &token, EventForOutput const &e) const
Strings hltTriggerSelections_
virtual void doOutputHeader(InitMsgBuilder const &init_message)=0
EventSelector::Strings Strings
void endRun(RunForOutput const &) override
std::string const & processName() const
void write(EventForOutput const &e) override
ParameterSetID selectorConfig() const
std::string const & moduleLabel() const
unsigned int currentSpaceUsed() const
bool getByToken(EDGetToken token, TypeID const &typeID, BasicHandle &result) const
void beginRun(RunForOutput const &) override
void writeLuminosityBlock(LuminosityBlockForOutput const &) override
static void fillDescription(ParameterSetDescription &desc, std::vector< std::string > const &iDefaultOutputCommands=ProductSelectorRules::defaultSelectionStrings())
static std::vector< std::string > getEventSelectionVString(edm::ParameterSet const &pset)
unsigned char const * bufferPointer() const
virtual void doOutputEvent(EventMsgBuilder const &msg)=0
int serializeRegistry(SerializeDataBuffer &data_buffer, const BranchIDLists &branchIDLists, ThinnedAssociationsHelper const &thinnedAssociationsHelper)
SerializeDataBuffer serializeDataBuffer_
std::string getReleaseVersion()
StreamerOutputModuleBase(ParameterSet const &ps)
StreamSerializer serializer_
const ModuleDescription & moduleDescription() const
std::unique_ptr< InitMsgBuilder > serializeRegistry()
edm::EDGetTokenT< edm::TriggerResults > trToken_
void setHltMask(EventForOutput const &e)
void writeRun(RunForOutput const &) override
uint32_t adler32_chksum() const
std::string const & processName() const
int serializeEvent(EventForOutput const &event, ParameterSetID const &selectorConfig, bool use_compression, int compression_level, SerializeDataBuffer &data_buffer)
std::vector< std::string > const & getAllTriggerNames()
LuminosityBlockNumber_t luminosityBlock() const
unsigned int currentEventSize() const
static std::string const source
std::vector< bool > l1bit_
std::vector< unsigned char > hltbits_
BranchIDLists const * branchIDLists()