CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

edm::DQMHttpSource Class Reference

#include <DQMHttpSource.h>

Inheritance diagram for edm::DQMHttpSource:
edm::RawInputSource edm::InputSource edm::ProductRegistryHelper

List of all members.

Public Member Functions

 DQMHttpSource (const edm::ParameterSet &, const edm::InputSourceDescription &)
virtual ~DQMHttpSource ()

Static Public Member Functions

static void addEventToDQMBackend (DQMStore *, const DQMEventMsgView &, const bool overwrite)

Private Member Functions

virtual bool checkNextEvent ()
EventAuxiliary const & eventAuxiliary () const
void initializeDQMStore ()
virtual EventPrincipalread (EventPrincipal &eventPrincipal)
void setEventAuxiliary (std::unique_ptr< EventAuxiliary > aux)

Private Attributes

stor::EventServerProxy
< stor::DQMEventConsumerRegistrationInfo
dqmEventServerProxy_
DQMStoredqmStore_
std::unique_ptr< EventAuxiliaryeventAuxiliary_

Static Private Attributes

static boost::mutex mutex_

Detailed Description

An input source for DQM consumers using cmsRun that connect to the StorageManager or SMProxyServer to get DQM (histogram) data.

Author:
wmtan
Revision:
1.15
Date:
2012/10/31 17:09:27

Definition at line 32 of file DQMHttpSource.h.


Constructor & Destructor Documentation

edm::DQMHttpSource::DQMHttpSource ( const edm::ParameterSet pset,
const edm::InputSourceDescription desc 
)

Definition at line 26 of file DQMHttpSource.cc.

virtual edm::DQMHttpSource::~DQMHttpSource ( ) [inline, virtual]

Definition at line 40 of file DQMHttpSource.h.

{};

Member Function Documentation

void edm::DQMHttpSource::addEventToDQMBackend ( DQMStore dqmStore,
const DQMEventMsgView dqmEventMsgView,
const bool  overwrite 
) [static]

Definition at line 78 of file DQMHttpSource.cc.

References DQMStore::bookInt(), edm::StreamDQMDeserializer::deserializeDQMEvent(), DQMStore::extract(), MonitorElement::Fill(), DQMStore::get(), DQMEventMsgView::mergeCount(), DQMStore::pwd(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by checkNextEvent(), and smproxy::DQMArchiver::writeDQMEventToFile().

  {
    boost::mutex::scoped_lock sl(mutex_);
    
    MonitorElement* me = dqmStore->get("SM_SMPS_Stats/mergeCount");
    if (!me){
      dqmStore->setCurrentFolder("SM_SMPS_Stats");
      me = dqmStore->bookInt("mergeCount");
    }
    me->Fill(dqmEventMsgView.mergeCount());

    edm::StreamDQMDeserializer deserializeWorker;
    std::auto_ptr<DQMEvent::TObjectTable> toTablePtr =
      deserializeWorker.deserializeDQMEvent(dqmEventMsgView);
    
    for (DQMEvent::TObjectTable::const_iterator tableIter = toTablePtr->begin(),
           tableIterEnd = toTablePtr->end(); tableIter != tableIterEnd; ++tableIter)
    {
      const std::string subFolderName = tableIter->first;
      std::vector<TObject*> toList = tableIter->second;
      dqmStore->setCurrentFolder(subFolderName); // creates dir if needed

      for (std::vector<TObject*>::const_iterator objectIter = toList.begin(),
             objectIterEnd = toList.end(); objectIter != objectIterEnd; ++objectIter)
      {
        dqmStore->extract(*objectIter, dqmStore->pwd(), overwrite);
        // TObject cloned into DQMStore. Thus, delete it here.
        delete *objectIter;
      }
    }
  }
bool edm::DQMHttpSource::checkNextEvent ( ) [private, virtual]

Implements edm::RawInputSource.

Definition at line 37 of file DQMHttpSource.cc.

References addEventToDQMBackend(), HeaderView::code(), data, Header::DONE, dqmEventServerProxy_, dqmStore_, eventAuxiliary(), DQMEventMsgView::eventNumberAtUpdate(), stor::EventServerProxy< RegInfo >::getOneEvent(), initializeDQMStore(), edm::Timestamp::invalidTimestamp(), edm::InputSource::luminosityBlock(), edm::InputSource::luminosityBlockAuxiliary(), DQMEventMsgView::lumiSection(), edm::EventAuxiliary::PhysicsTrigger, edm::InputSource::run(), edm::EventAuxiliary::run(), edm::InputSource::runAuxiliary(), DQMEventMsgView::runNumber(), setEventAuxiliary(), edm::InputSource::setEventCached(), edm::InputSource::setLuminosityBlockAuxiliary(), edm::InputSource::setRunAuxiliary(), AlCaHLTBitMon_QueryRunRegistry::string, cond::rpcobgas::time, and DQMEventMsgView::timeStamp().

                                     {
    initializeDQMStore();
    stor::CurlInterface::Content data;

    dqmEventServerProxy_.getOneEvent(data);
    if ( data.empty() ) return false;

    HeaderView hdrView(&data[0]);
    if (hdrView.code() == Header::DONE) return false;

    const DQMEventMsgView dqmEventMsgView(&data[0]);
    addEventToDQMBackend(dqmStore_, dqmEventMsgView, true);

    EventID id(dqmEventMsgView.runNumber(), dqmEventMsgView.lumiSection(), dqmEventMsgView.eventNumberAtUpdate());
  
    setEventAuxiliary(std::unique_ptr<EventAuxiliary>(new EventAuxiliary(id, std::string(), dqmEventMsgView.timeStamp(), true, EventAuxiliary::PhysicsTrigger)));

    if(!runAuxiliary() || runAuxiliary()->run() != eventAuxiliary().run()) {
      setRunAuxiliary(new RunAuxiliary(eventAuxiliary().run(), eventAuxiliary().time(), Timestamp::invalidTimestamp()));
    }
    if(!luminosityBlockAuxiliary() || luminosityBlockAuxiliary()->luminosityBlock() != eventAuxiliary().luminosityBlock()) {
      setLuminosityBlockAuxiliary(new LuminosityBlockAuxiliary(eventAuxiliary().run(), eventAuxiliary().luminosityBlock(), eventAuxiliary().time(), Timestamp::invalidTimestamp()));
    }
    setEventCached();
    return true;
  }
EventAuxiliary const& edm::DQMHttpSource::eventAuxiliary ( ) const [inline, private]

Definition at line 51 of file DQMHttpSource.h.

References eventAuxiliary_.

Referenced by checkNextEvent(), and read().

                                                 {
      return *eventAuxiliary_;
    }
void edm::DQMHttpSource::initializeDQMStore ( ) [private]

Definition at line 115 of file DQMHttpSource.cc.

References dqmStore_, Exception, and cppFunctionSkipper::operator.

Referenced by checkNextEvent().

  {
    if ( ! dqmStore_ )
      dqmStore_ = edm::Service<DQMStore>().operator->();
    
    if ( ! dqmStore_ )
      throw cms::Exception("readOneEvent", "DQMHttpSource")
        << "Unable to lookup the DQMStore service!\n";
  }
EventPrincipal * edm::DQMHttpSource::read ( EventPrincipal eventPrincipal) [private, virtual]

Implements edm::RawInputSource.

Definition at line 64 of file DQMHttpSource.cc.

References alignCSCRings::e, eventAuxiliary(), and edm::RawInputSource::makeEvent().

  {
    // make a fake event principal containing no data but the evId and runId from DQMEvent
    // and the time stamp from the event at update
    EventPrincipal* e = makeEvent(
      eventPrincipal,
      eventAuxiliary()
    );

    return e;
  }
void edm::DQMHttpSource::setEventAuxiliary ( std::unique_ptr< EventAuxiliary aux) [inline, private]

Definition at line 54 of file DQMHttpSource.h.

References eventAuxiliary_.

Referenced by checkNextEvent().

                                                              {
      eventAuxiliary_ = std::move(aux);
    }

Member Data Documentation

Definition at line 62 of file DQMHttpSource.h.

Referenced by checkNextEvent().

Definition at line 63 of file DQMHttpSource.h.

Referenced by checkNextEvent(), and initializeDQMStore().

Definition at line 61 of file DQMHttpSource.h.

Referenced by eventAuxiliary(), and setEventAuxiliary().

Definition at line 65 of file DQMHttpSource.h.