35 void packIntoString(std::vector<unsigned char>
const&
source,
36 std::vector<unsigned char>& package) {
37 if (source.size() < 1) {
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));
59 selections_(&keptProducts()[
InEvent]),
60 maxEventSize_(ps.getUntrackedParameter<int>(
"max_event_size")),
61 useCompression_(ps.getUntrackedParameter<bool>(
"use_compression")),
62 compressionLevel_(ps.getUntrackedParameter<int>(
"compression_level")),
63 lumiSectionInterval_(ps.getUntrackedParameter<int>(
"lumiSection_interval")),
64 serializer_(selections_),
65 serializeDataBuffer_(),
72 hltTriggerSelections_(),
78 struct timezone dummyTZ;
79 gettimeofday(&now, &dummyTZ);
80 timeInSecSinceUTC =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0);
85 <<
" no compression" << std::endl;
90 <<
" using max compression level 9" << std::endl;
138 std::auto_ptr<InitMsgBuilder>
146 unsigned int new_size = src_size + 50000;
168 l1_names.push_back(
"t1");
169 l1_names.push_back(
"t10");
170 l1_names.push_back(
"t2");
176 uLong crc = crc32(0
L, Z_NULL, 0);
177 Bytef
const* buf = (Bytef
const*)(moduleLabel.data());
178 crc = crc32(crc, buf, moduleLabel.length());
181 std::auto_ptr<InitMsgBuilder> init_message(
191 std::copy(src, src + src_size, init_message->dataAddress());
192 init_message->setDataLength(src_size);
203 std::vector<unsigned char> vHltState;
207 vHltState.push_back(((prod->at(
i)).state()));
216 packIntoString(vHltState,
hltbits_);
230 struct timezone dummyTZ;
231 gettimeofday(&now, &dummyTZ);
232 double timeInSec =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0) -
timeInSecSinceUTC;
237 std::auto_ptr<EventMsgBuilder>
261 unsigned int new_size = src_size + 50000;
264 std::auto_ptr<EventMsgBuilder>
281 std::copy(src,src + src_size, msg->eventAddr());
282 msg->setEventLength(src_size);
292 ->setComment(
"Starting size in bytes of the serialized event buffer.");
294 ->setComment(
"If True, compression will be used to write streamer file.");
296 ->setComment(
"ROOT compression level to use.");
298 ->setComment(
"If 0, use lumi section number from event.\n"
299 "If not 0, the interval in seconds between fake lumi sections.");
ParameterSetID getProcessParameterSetID()
EventNumber_t event() const
static void fillDescription(ParameterSetDescription &desc)
value_type compactForm() const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
virtual void doOutputHeader(InitMsgBuilder const &init_message) const =0
virtual void endJob() override
Strings hltTriggerSelections_
EventID const & id() const
std::string const & processName() const
std::auto_ptr< InitMsgBuilder > serializeRegistry()
LuminosityBlockNumber_t luminosityBlock() const
int serializeEvent(EventPrincipal const &eventPrincipal, ParameterSetID const &selectorConfig, bool use_compression, int compression_level, SerializeDataBuffer &data_buffer, ModuleCallingContext const *mcc)
virtual ~StreamerOutputModuleBase()
virtual void doOutputEvent(EventMsgBuilder const &msg) const =0
std::string const & moduleLabel() const
virtual void stop() const =0
unsigned int currentSpaceUsed() const
virtual void writeRun(RunPrincipal const &, ModuleCallingContext const *) override
static std::vector< std::string > getEventSelectionVString(edm::ParameterSet const &pset)
virtual void writeLuminosityBlock(LuminosityBlockPrincipal const &, ModuleCallingContext const *) override
virtual void beginJob() override
int serializeRegistry(SerializeDataBuffer &data_buffer, const BranchIDLists &branchIDLists, ThinnedAssociationsHelper const &thinnedAssociationsHelper)
virtual void write(EventPrincipal const &e, ModuleCallingContext const *) override
virtual void start() const =0
void setHltMask(EventPrincipal const &e, ModuleCallingContext const *)
SerializeDataBuffer serializeDataBuffer_
std::string getReleaseVersion()
StreamerOutputModuleBase(ParameterSet const &ps)
StreamSerializer serializer_
unsigned char * bufferPointer() const
ThinnedAssociationsHelper const * thinnedAssociationsHelper() const
static void fillDescription(ParameterSetDescription &desc)
uint32_t adler32_chksum() const
std::auto_ptr< EventMsgBuilder > serializeEvent(EventPrincipal const &e, ModuleCallingContext const *mcc)
virtual void beginRun(RunPrincipal const &, ModuleCallingContext const *) override
std::vector< std::string > const & getAllTriggerNames()
BranchIDLists const * branchIDLists() const
virtual void endRun(RunPrincipal const &, ModuleCallingContext const *) override
unsigned int currentEventSize() const
static std::string const source
Trig getTriggerResults(EventPrincipal const &ep, ModuleCallingContext const *) const
ModuleDescription const & description() const
std::vector< bool > l1bit_
std::vector< unsigned char > hltbits_
ParameterSetID selectorConfig() const