33 void packIntoString(std::vector<unsigned char>
const&
source,
34 std::vector<unsigned char>& package) {
35 if (source.size() < 1) {
return;}
36 unsigned int packInOneByte = 4;
37 unsigned int sizeOfPackage = 1+((source.size()-1)/packInOneByte);
39 package.resize(sizeOfPackage);
40 memset(&package[0], 0x00, sizeOfPackage);
43 unsigned int whichByte =
i/packInOneByte;
44 unsigned int indxWithinByte =
i % packInOneByte;
45 package[whichByte] = package[whichByte] | (source[
i] << (indxWithinByte*2));
57 selections_(&keptProducts()[
InEvent]),
58 maxEventSize_(ps.getUntrackedParameter<int>(
"max_event_size")),
59 useCompression_(ps.getUntrackedParameter<bool>(
"use_compression")),
60 compressionLevel_(ps.getUntrackedParameter<int>(
"compression_level")),
61 lumiSectionInterval_(ps.getUntrackedParameter<int>(
"lumiSection_interval")),
62 serializer_(selections_),
63 serializeDataBuffer_(),
70 hltTriggerSelections_(),
76 struct timezone dummyTZ;
77 gettimeofday(&now, &dummyTZ);
78 timeInSecSinceUTC =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0);
83 <<
" no compression" << std::endl;
88 <<
" 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 void enable()
interface for TClass generators
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