36 void packIntoString(std::vector<unsigned char>
const&
source,
37 std::vector<unsigned char>& package) {
38 if (source.size() < 1) {
return;}
39 unsigned int packInOneByte = 4;
40 unsigned int sizeOfPackage = 1+((source.size()-1)/packInOneByte);
42 package.resize(sizeOfPackage);
43 memset(&package[0], 0x00, sizeOfPackage);
46 unsigned int whichByte =
i/packInOneByte;
47 unsigned int indxWithinByte =
i % packInOneByte;
48 package[whichByte] = package[whichByte] | (source[
i] << (indxWithinByte*2));
60 one::
OutputModule<one::WatchRuns, one::WatchLuminosityBlocks>(ps),
61 selections_(&keptProducts()[
InEvent]),
62 maxEventSize_(ps.getUntrackedParameter<int>(
"max_event_size")),
63 useCompression_(ps.getUntrackedParameter<bool>(
"use_compression")),
64 compressionLevel_(ps.getUntrackedParameter<int>(
"compression_level")),
65 lumiSectionInterval_(ps.getUntrackedParameter<int>(
"lumiSection_interval")),
66 serializer_(selections_),
67 serializeDataBuffer_(),
75 hltTriggerSelections_(),
81 struct timezone dummyTZ;
82 gettimeofday(&now, &dummyTZ);
83 timeInSecSinceUTC =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0);
88 <<
" no compression" << std::endl;
93 <<
" using max compression level 9" << std::endl;
141 std::auto_ptr<InitMsgBuilder>
149 unsigned int new_size = src_size + 50000;
171 l1_names.push_back(
"t1");
172 l1_names.push_back(
"t10");
173 l1_names.push_back(
"t2");
179 uLong crc = crc32(0
L, Z_NULL, 0);
180 Bytef
const* buf = (Bytef
const*)(moduleLabel.data());
181 crc = crc32(crc, buf, moduleLabel.length());
184 std::auto_ptr<InitMsgBuilder> init_message(
194 std::copy(src, src + src_size, init_message->dataAddress());
195 init_message->setDataLength(src_size);
217 std::vector<unsigned char> vHltState;
221 vHltState.push_back(((prod->at(
i)).state()));
230 packIntoString(vHltState,
hltbits_);
244 struct timezone dummyTZ;
245 gettimeofday(&now, &dummyTZ);
246 double timeInSec =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0) -
timeInSecSinceUTC;
251 std::auto_ptr<EventMsgBuilder>
275 unsigned int new_size = src_size + 50000;
278 std::auto_ptr<EventMsgBuilder>
295 std::copy(src,src + src_size, msg->eventAddr());
296 msg->setEventLength(src_size);
306 ->setComment(
"Starting size in bytes of the serialized event buffer.");
308 ->setComment(
"If True, compression will be used to write streamer file.");
310 ->setComment(
"ROOT compression level to use.");
312 ->setComment(
"If 0, use lumi section number from event.\n"
313 "If not 0, the interval in seconds between fake lumi sections.");
BranchIDLists const * branchIDLists() const
ParameterSetID getProcessParameterSetID()
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
EventNumber_t event() const
void setConsumer(EDConsumerBase const *iConsumer)
Trig getTriggerResults(EDGetTokenT< TriggerResults > const &token, EventPrincipal const &ep, ModuleCallingContext const *) const
static void fillDescription(ParameterSetDescription &desc)
ModuleDescription const & description() const
value_type compactForm() const
ThinnedAssociationsHelper const * thinnedAssociationsHelper() 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
ParameterSetID selectorConfig() const
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()
void convert_handle(BasicHandle &&bh, Handle< T > &result)
StreamerOutputModuleBase(ParameterSet const &ps)
StreamSerializer serializer_
const ModuleDescription & moduleDescription() const
unsigned char * bufferPointer() const
edm::EDGetTokenT< edm::TriggerResults > trToken_
static void fillDescription(ParameterSetDescription &desc)
uint32_t adler32_chksum() const
std::string const & processName() 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()
virtual void endRun(RunPrincipal const &, ModuleCallingContext const *) override
unsigned int currentEventSize() const
static std::string const source
std::vector< bool > l1bit_
std::vector< unsigned char > hltbits_