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

void initializeDQMStore ()
virtual std::auto_ptr< edm::EventreadOneEvent ()

Private Attributes

stor::EventServerProxy
< stor::DQMEventConsumerRegistrationInfo
dqmEventServerProxy_
DQMStoredqmStore_

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:
mommsen
Revision:
1.13
Date:
2011/04/04 16:05:37

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 24 of file DQMHttpSource.cc.

    :
  edm::RawInputSource(pset, desc),
  dqmEventServerProxy_(pset),
  dqmStore_(0)
  {}
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 63 of file DQMHttpSource.cc.

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

Referenced by readOneEvent(), 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;
      }
    }
  }
void edm::DQMHttpSource::initializeDQMStore ( ) [private]

Definition at line 100 of file DQMHttpSource.cc.

References dqmStore_, Exception, and cmsCodeRules::cppFunctionSkipper::operator.

Referenced by readOneEvent().

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

Implements edm::RawInputSource.

Definition at line 34 of file DQMHttpSource.cc.

References addEventToDQMBackend(), HeaderView::code(), AlCaHLTBitMon_QueryRunRegistry::data, Header::DONE, dqmEventServerProxy_, dqmStore_, DQMEventMsgView::eventNumberAtUpdate(), stor::EventServerProxy< RegInfo >::getOneEvent(), initializeDQMStore(), DQMEventMsgView::lumiSection(), edm::RawInputSource::makeEvent(), DQMEventMsgView::runNumber(), and DQMEventMsgView::timeStamp().

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

    dqmEventServerProxy_.getOneEvent(data);
    if ( data.empty() ) return std::auto_ptr<edm::Event>();

    HeaderView hdrView(&data[0]);
    if (hdrView.code() == Header::DONE)
      return std::auto_ptr<edm::Event>();

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

    // make a fake event containing no data but the evId and runId from DQMEvent
    // and the time stamp from the event at update
    std::auto_ptr<Event> e = makeEvent(
      dqmEventMsgView.runNumber(),
      dqmEventMsgView.lumiSection(),
      dqmEventMsgView.eventNumberAtUpdate(),
      dqmEventMsgView.timeStamp()
    );

    return e;
  }

Member Data Documentation

Definition at line 54 of file DQMHttpSource.h.

Referenced by readOneEvent().

Definition at line 55 of file DQMHttpSource.h.

Referenced by initializeDQMStore(), and readOneEvent().

Definition at line 57 of file DQMHttpSource.h.