28 for (
int i = 7;
i >= 0; --
i) {
29 int bit = ((c >>
i) & 1);
34 void packIntoString(std::vector<unsigned char>
const&
source,
35 std::vector<unsigned char>& package) {
36 if (source.size() < 1) {
return;}
37 unsigned int packInOneByte = 4;
38 unsigned int sizeOfPackage = 1+((source.size()-1)/packInOneByte);
40 package.resize(sizeOfPackage);
41 memset(&package[0], 0x00, sizeOfPackage);
44 unsigned int whichByte =
i/packInOneByte;
45 unsigned int indxWithinByte =
i % packInOneByte;
46 package[whichByte] = package[whichByte] | (source[
i] << (indxWithinByte*2));
58 selections_(&keptProducts()[
InEvent]),
59 maxEventSize_(ps.getUntrackedParameter<int>(
"max_event_size")),
60 useCompression_(ps.getUntrackedParameter<bool>(
"use_compression")),
61 compressionLevel_(ps.getUntrackedParameter<int>(
"compression_level")),
62 lumiSectionInterval_(ps.getUntrackedParameter<int>(
"lumiSection_interval")),
63 serializer_(selections_),
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;
169 l1_names.push_back(
"t1");
170 l1_names.push_back(
"t10");
171 l1_names.push_back(
"t2");
177 uLong crc = crc32(0
L, Z_NULL, 0);
178 Bytef* buf = (Bytef*) moduleLabel.data();
179 crc = crc32(crc, buf, moduleLabel.length());
182 std::auto_ptr<InitMsgBuilder> init_message(
192 std::copy(src, src + src_size, init_message->dataAddress());
193 init_message->setDataLength(src_size);
204 std::vector<unsigned char> vHltState;
208 vHltState.push_back(((prod->at(
i)).
state()));
217 packIntoString(vHltState,
hltbits_);
231 struct timezone dummyTZ;
232 gettimeofday(&now, &dummyTZ);
233 double timeInSec =
static_cast<double>(now.tv_sec) + (static_cast<double>(now.tv_usec)/1000000.0) -
timeInSecSinceUTC;
238 std::auto_ptr<EventMsgBuilder>
262 unsigned int new_size = src_size + 50000;
263 if(serialize_databuffer.
bufs_.size() < new_size) serialize_databuffer.
bufs_.resize(new_size);
265 std::auto_ptr<EventMsgBuilder>
282 std::copy(src,src + src_size, msg->eventAddr());
283 msg->setEventLength(src_size);
293 ->setComment(
"Starting size in bytes of the serialized event buffer.");
295 ->setComment(
"If True, compression will be used to write streamer file.");
297 ->setComment(
"ROOT compression level to use.");
299 ->setComment(
"If 0, use lumi section number from event.\n"
300 "If not 0, the interval in seconds between fake lumi sections.");
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
Strings hltTriggerSelections_
void setHltMask(EventPrincipal const &e)
static ThreadSafeRegistry * instance()
std::auto_ptr< EventMsgBuilder > serializeEvent(EventPrincipal const &e)
EventID const & id() const
std::string const & processName() const
static SerializeDataBuffer serialize_databuffer
std::auto_ptr< InitMsgBuilder > serializeRegistry()
LuminosityBlockNumber_t luminosityBlock() const
virtual ~StreamerOutputModuleBase()
virtual void doOutputEvent(EventMsgBuilder const &msg) const =0
std::string const & moduleLabel() const
virtual void stop() const =0
virtual void endRun(RunPrincipal const &)
virtual void beginRun(RunPrincipal const &)
unsigned int currentSpaceUsed() const
static std::vector< std::string > getEventSelectionVString(edm::ParameterSet const &pset)
virtual void writeRun(RunPrincipal const &)
virtual void start() const =0
int serializeEvent(EventPrincipal const &eventPrincipal, ParameterSetID const &selectorConfig, bool use_compression, int compression_level, SerializeDataBuffer &data_buffer)
std::string getReleaseVersion()
StreamerOutputModuleBase(ParameterSet const &ps)
StreamSerializer serializer_
unsigned char * bufferPointer() const
static void fillDescription(ParameterSetDescription &desc)
uint32_t adler32_chksum() const
std::vector< std::string > const & getAllTriggerNames()
Trig getTriggerResults(Event const &ep) const
int serializeRegistry(SerializeDataBuffer &data_buffer)
ParameterSetID getProcessParameterSetID(Registry const *reg)
Associated free functions.
unsigned int currentEventSize() const
virtual void write(EventPrincipal const &e)
static void enable()
interface for TClass generators
ModuleDescription const & description() const
std::vector< bool > l1bit_
std::vector< unsigned char > hltbits_
ParameterSetID selectorConfig() const
virtual void writeLuminosityBlock(LuminosityBlockPrincipal const &)