CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

Public Member Functions

 DQMHttpSource (const edm::ParameterSet &, const edm::InputSourceDescription &)
 
virtual ~DQMHttpSource ()
 
- Public Member Functions inherited from edm::RawInputSource
 RawInputSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
virtual ~RawInputSource ()
 
- Public Member Functions inherited from edm::InputSource
boost::shared_ptr
< ActivityRegistry
actReg () const
 Accessor for Activity Registry. More...
 
void closeFile (boost::shared_ptr< FileBlock >, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
void doBeginLumi (LuminosityBlockPrincipal &lbp)
 Called by framework at beginning of lumi block. More...
 
void doBeginRun (RunPrincipal &rp)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp, bool cleaningUpAfterException)
 Called by framework at end of run. More...
 
void doPostForkReacquireResources (boost::shared_ptr< multicore::MessageReceiverForSource >)
 
void doPreForkReleaseResources ()
 Called by the framework before forking the process. More...
 
ProcessingController::ForwardState forwardState () const
 
bool goToEvent (EventID const &eventID)
 
 InputSource (ParameterSet const &, InputSourceDescription const &)
 Constructor. More...
 
void issueReports (EventID const &eventID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
luminosityBlockAuxiliary () const
 Called by the framework to merge or insert lumi in principal cache. More...
 
int markLumi ()
 Mark lumi as read. More...
 
int markRun ()
 Mark run as read. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 
bool primary () const
 Accessor for primary input source flag. More...
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry () const
 Accessor for product registry. More...
 
bool randomAccess () const
 
void readAndCacheLumi (bool merge, HistoryAppender &historyAppender)
 Read next luminosity block. More...
 
void readAndCacheRun (bool merge, HistoryAppender &historyAppender)
 Read next run. More...
 
EventPrincipalreadEvent (boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
 
EventPrincipalreadEvent (EventID const &)
 Read a specific event. More...
 
boost::shared_ptr< FileBlockreadFile ()
 Read next file. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
boost::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
void registerProducts ()
 Register any produced products. More...
 
int remainingEvents () const
 
int remainingLuminosityBlocks () const
 
void repeat ()
 Reset the remaining number of events/lumis to the maximum number. More...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
boost::shared_ptr< RunAuxiliaryrunAuxiliary () const
 Called by the framework to merge or insert run in principal cache. More...
 
void setLuminosityBlockNumber_t (LuminosityBlockNumber_t lb)
 Set the luminosity block ID. More...
 
void setRunNumber (RunNumber_t r)
 Set the run number. More...
 
void skipEvents (int offset)
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource ()
 Destructor. More...
 

Static Public Member Functions

static void addEventToDQMBackend (DQMStore *, const DQMEventMsgView &, const bool overwrite)
 
- Static Public Member Functions inherited from edm::InputSource
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

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_
 

Additional Inherited Members

- Public Types inherited from edm::InputSource
enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::RawInputSource
std::auto_ptr< EventmakeEvent (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, Timestamp const &tstamp)
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
EventPrincipaleventPrincipalCache ()
 
boost::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
PrincipalCache const & principalCache () const
 
PrincipalCacheprincipalCache ()
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetLuminosityBlockAuxiliary () const
 
void resetRunAuxiliary () const
 
boost::shared_ptr
< RunPrincipal > const 
runPrincipal () const
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
ItemType state () const
 

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.

27  :
28  edm::RawInputSource(pset, desc),
30  dqmStore_(0)
31  {}
stor::EventServerProxy< stor::DQMEventConsumerRegistrationInfo > dqmEventServerProxy_
Definition: DQMHttpSource.h:54
DQMStore * dqmStore_
Definition: DQMHttpSource.h:55
virtual edm::DQMHttpSource::~DQMHttpSource ( )
inlinevirtual

Definition at line 40 of file DQMHttpSource.h.

40 {};

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().

68  {
69  boost::mutex::scoped_lock sl(mutex_);
70 
71  MonitorElement* me = dqmStore->get("SM_SMPS_Stats/mergeCount");
72  if (!me){
73  dqmStore->setCurrentFolder("SM_SMPS_Stats");
74  me = dqmStore->bookInt("mergeCount");
75  }
76  me->Fill(dqmEventMsgView.mergeCount());
77 
78  edm::StreamDQMDeserializer deserializeWorker;
79  std::auto_ptr<DQMEvent::TObjectTable> toTablePtr =
80  deserializeWorker.deserializeDQMEvent(dqmEventMsgView);
81 
82  for (DQMEvent::TObjectTable::const_iterator tableIter = toTablePtr->begin(),
83  tableIterEnd = toTablePtr->end(); tableIter != tableIterEnd; ++tableIter)
84  {
85  const std::string subFolderName = tableIter->first;
86  std::vector<TObject*> toList = tableIter->second;
87  dqmStore->setCurrentFolder(subFolderName); // creates dir if needed
88 
89  for (std::vector<TObject*>::const_iterator objectIter = toList.begin(),
90  objectIterEnd = toList.end(); objectIter != objectIterEnd; ++objectIter)
91  {
92  dqmStore->extract(*objectIter, dqmStore->pwd(), overwrite);
93  // TObject cloned into DQMStore. Thus, delete it here.
94  delete *objectIter;
95  }
96  }
97  }
void Fill(long long x)
static boost::mutex mutex_
Definition: DQMHttpSource.h:57
bool extract(TObject *obj, const std::string &dir, bool overwrite)
Definition: DQMStore.cc:1771
std::auto_ptr< DQMEvent::TObjectTable > deserializeDQMEvent(DQMEventMsgView const &dqmEventView)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
uint32 mergeCount() const
const std::string & pwd(void) const
Definition: DQMStore.cc:401
void edm::DQMHttpSource::initializeDQMStore ( )
private

Definition at line 100 of file DQMHttpSource.cc.

References dqmStore_, edm::hlt::Exception, and cppFunctionSkipper::operator.

Referenced by readOneEvent().

101  {
102  if ( ! dqmStore_ )
104 
105  if ( ! dqmStore_ )
106  throw cms::Exception("readOneEvent", "DQMHttpSource")
107  << "Unable to lookup the DQMStore service!\n";
108  }
DQMStore * dqmStore_
Definition: DQMHttpSource.h:55
std::auto_ptr< Event > edm::DQMHttpSource::readOneEvent ( )
privatevirtual

Implements edm::RawInputSource.

Definition at line 34 of file DQMHttpSource.cc.

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

35  {
38 
40  if ( data.empty() ) return std::auto_ptr<edm::Event>();
41 
42  HeaderView hdrView(&data[0]);
43  if (hdrView.code() == Header::DONE)
44  return std::auto_ptr<edm::Event>();
45 
46  const DQMEventMsgView dqmEventMsgView(&data[0]);
47  addEventToDQMBackend(dqmStore_, dqmEventMsgView, true);
48 
49  // make a fake event containing no data but the evId and runId from DQMEvent
50  // and the time stamp from the event at update
51  std::auto_ptr<Event> e = makeEvent(
52  dqmEventMsgView.runNumber(),
53  dqmEventMsgView.lumiSection(),
54  dqmEventMsgView.eventNumberAtUpdate(),
55  dqmEventMsgView.timeStamp()
56  );
57 
58  return e;
59  }
static void addEventToDQMBackend(DQMStore *, const DQMEventMsgView &, const bool overwrite)
std::auto_ptr< Event > makeEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, Timestamp const &tstamp)
stor::EventServerProxy< stor::DQMEventConsumerRegistrationInfo > dqmEventServerProxy_
Definition: DQMHttpSource.h:54
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void getOneEvent(CurlInterface::Content &data)
DQMStore * dqmStore_
Definition: DQMHttpSource.h:55
std::vector< char > Content
Definition: CurlInterface.h:31

Member Data Documentation

stor::EventServerProxy<stor::DQMEventConsumerRegistrationInfo> edm::DQMHttpSource::dqmEventServerProxy_
private

Definition at line 54 of file DQMHttpSource.h.

Referenced by readOneEvent().

DQMStore* edm::DQMHttpSource::dqmStore_
private

Definition at line 55 of file DQMHttpSource.h.

Referenced by initializeDQMStore(), and readOneEvent().

boost::mutex edm::DQMHttpSource::mutex_
staticprivate

Definition at line 57 of file DQMHttpSource.h.