#include <EventStreamHttpReader.h>
Public Member Functions | |
EventStreamHttpReader (edm::ParameterSet const &, edm::InputSourceDescription const &) | |
virtual | ~EventStreamHttpReader () |
Private Member Functions | |
virtual bool | checkNextEvent () |
void | initializeDQMStore () |
void | readHeader () |
Private Attributes | |
const std::string | consumerName_ |
DQMStore * | dqmStore_ |
bool | dqmStoreAvailabiltyChecked_ |
const bool | dropOldLumisectionEvents_ |
stor::EventServerProxy < stor::EventConsumerRegistrationInfo > | eventServerProxy_ |
unsigned int | lastLS_ |
unsigned int | totalDroppedEvents_ |
Input source for event consumers that will get events from the Storage Manager Event Server. This does uses a HTTP get using the CURL library. The Storage Manager Event Server responses with a binary octet-stream. The product registry is also obtained through a HTTP get.
There is currently no test of the product registry against the consumer client product registry within the code. It should already be done if this was inherenting from the standard framework input source. Currently we inherit from InputSource.
Definition at line 34 of file EventStreamHttpReader.h.
edm::EventStreamHttpReader::EventStreamHttpReader | ( | edm::ParameterSet const & | pset, |
edm::InputSourceDescription const & | desc | ||
) |
Definition at line 18 of file EventStreamHttpReader.cc.
References edm::ParameterSet::getUntrackedParameter(), and xuti::readHeader().
: StreamerInputSource(pset, desc), eventServerProxy_(pset), dqmStore_(0), dqmStoreAvailabiltyChecked_(false), dropOldLumisectionEvents_(pset.getUntrackedParameter<bool>("dropOldLumisectionEvents", false)), consumerName_(pset.getUntrackedParameter<std::string>("consumerName")), totalDroppedEvents_(0), lastLS_(0) { // Default in StreamerInputSource is 'false' bool inputFileTransitionsEachEvent = pset.getUntrackedParameter<bool>("inputFileTransitionsEachEvent", true); if(inputFileTransitionsEachEvent) { setInputFileTransitionsEachEvent(); } readHeader(); }
virtual edm::EventStreamHttpReader::~EventStreamHttpReader | ( | ) | [inline, virtual] |
Definition at line 42 of file EventStreamHttpReader.h.
{};
bool edm::EventStreamHttpReader::checkNextEvent | ( | ) | [private, virtual] |
Implements edm::RawInputSource.
Definition at line 40 of file EventStreamHttpReader.cc.
References DQMStore::bookInt(), HeaderView::code(), consumerName_, data, edm::StreamerInputSource::deserializeEvent(), Header::DONE, dqmStore_, dropOldLumisectionEvents_, EventMsgView::droppedEventsCount(), eventServerProxy_, MonitorElement::Fill(), DQMStore::get(), stor::EventServerProxy< RegInfo >::getOneEvent(), initializeDQMStore(), lastLS_, EventMsgView::lumi(), DQMStore::setCurrentFolder(), and totalDroppedEvents_.
{ initializeDQMStore(); stor::CurlInterface::Content data; unsigned int currentLS(0); unsigned int droppedEvents(0); do { eventServerProxy_.getOneEvent(data); if ( data.empty() ) return false; HeaderView hdrView(&data[0]); if (hdrView.code() == Header::DONE) { return false; } EventMsgView eventView(&data[0]); currentLS = eventView.lumi(); droppedEvents += eventView.droppedEventsCount(); } while ( dropOldLumisectionEvents_ && lastLS_ > currentLS ); lastLS_ = currentLS; if (dqmStore_) { MonitorElement* me = dqmStore_->get("SM_SMPS_Stats/droppedEventsCount_" + consumerName_ ); if (!me){ dqmStore_->setCurrentFolder("SM_SMPS_Stats"); me = dqmStore_->bookInt("droppedEventsCount_" + consumerName_ ); } totalDroppedEvents_ += droppedEvents; me->Fill(totalDroppedEvents_); } deserializeEvent(EventMsgView(&data[0])); return true; }
void edm::EventStreamHttpReader::initializeDQMStore | ( | ) | [private] |
Definition at line 96 of file EventStreamHttpReader.cc.
References dqmStore_, dqmStoreAvailabiltyChecked_, alignCSCRings::e, and cppFunctionSkipper::operator.
Referenced by checkNextEvent().
{ if ( ! dqmStoreAvailabiltyChecked_ ) { try { dqmStore_ = edm::Service<DQMStore>().operator->(); } catch (cms::Exception& e) { edm::LogInfo("EventStreamHttpReader") << "Service DQMStore not defined. Will not record the number of dropped events."; } dqmStoreAvailabiltyChecked_ = true; } }
void edm::EventStreamHttpReader::readHeader | ( | ) | [private] |
Definition at line 86 of file EventStreamHttpReader.cc.
References data, edm::StreamerInputSource::deserializeAndMergeWithRegistry(), eventServerProxy_, and stor::EventServerProxy< RegInfo >::getInitMsg().
{ stor::CurlInterface::Content data; eventServerProxy_.getInitMsg(data); InitMsgView initView(&data[0]); deserializeAndMergeWithRegistry(initView); }
const std::string edm::EventStreamHttpReader::consumerName_ [private] |
Definition at line 55 of file EventStreamHttpReader.h.
Referenced by checkNextEvent().
DQMStore* edm::EventStreamHttpReader::dqmStore_ [private] |
Definition at line 51 of file EventStreamHttpReader.h.
Referenced by checkNextEvent(), and initializeDQMStore().
bool edm::EventStreamHttpReader::dqmStoreAvailabiltyChecked_ [private] |
Definition at line 52 of file EventStreamHttpReader.h.
Referenced by initializeDQMStore().
const bool edm::EventStreamHttpReader::dropOldLumisectionEvents_ [private] |
Definition at line 54 of file EventStreamHttpReader.h.
Referenced by checkNextEvent().
stor::EventServerProxy<stor::EventConsumerRegistrationInfo> edm::EventStreamHttpReader::eventServerProxy_ [private] |
Definition at line 50 of file EventStreamHttpReader.h.
Referenced by checkNextEvent(), and readHeader().
unsigned int edm::EventStreamHttpReader::lastLS_ [private] |
Definition at line 57 of file EventStreamHttpReader.h.
Referenced by checkNextEvent().
unsigned int edm::EventStreamHttpReader::totalDroppedEvents_ [private] |
Definition at line 56 of file EventStreamHttpReader.h.
Referenced by checkNextEvent().