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;
143 std::auto_ptr<InitMsgBuilder>
151 unsigned int new_size = src_size + 50000;
173 l1_names.push_back(
"t1");
174 l1_names.push_back(
"t10");
175 l1_names.push_back(
"t2");
181 uLong crc = crc32(0
L, Z_NULL, 0);
182 Bytef
const* buf = (Bytef
const*)(moduleLabel.data());
183 crc = crc32(crc, buf, moduleLabel.length());
186 std::auto_ptr<InitMsgBuilder> init_message(
196 std::copy(src, src + src_size, init_message->dataAddress());
197 init_message->setDataLength(src_size);
219 std::vector<unsigned char> vHltState;
223 vHltState.push_back(((prod->at(
i)).state()));
232 packIntoString(vHltState,
hltbits_);
246 struct timezone dummyTZ;
247 gettimeofday(&now, &dummyTZ);
248 double timeInSec =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0) -
timeInSecSinceUTC;
253 std::auto_ptr<EventMsgBuilder>
277 unsigned int new_size = src_size + 50000;
280 std::auto_ptr<EventMsgBuilder>
297 std::copy(src,src + src_size, msg->eventAddr());
298 msg->setEventLength(src_size);
308 ->setComment(
"Starting size in bytes of the serialized event buffer.");
310 ->setComment(
"If True, compression will be used to write streamer file.");
312 ->setComment(
"ROOT compression level to use.");
314 ->setComment(
"If 0, use lumi section number from event.\n"
315 "If not 0, the interval in seconds between fake lumi sections.");
BasicHandle getByToken_(TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
ParameterSetID const & mainParameterSetID() 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 endJob() override
Strings hltTriggerSelections_
virtual void doOutputHeader(InitMsgBuilder const &init_message)=0
EventSelector::Strings Strings
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()
ParameterSetID selectorConfig() const
std::string const & moduleLabel() const
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
unsigned char const * bufferPointer() const
virtual void doOutputEvent(EventMsgBuilder const &msg)=0
virtual void beginJob() override
int serializeRegistry(SerializeDataBuffer &data_buffer, const BranchIDLists &branchIDLists, ThinnedAssociationsHelper const &thinnedAssociationsHelper)
virtual void write(EventPrincipal const &e, ModuleCallingContext const *) override
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
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_
BranchIDLists const * branchIDLists()