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...
 
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper () const
 Accessor for branchIDListHelper. More...
 
void closeFile (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...
 
 InputSource (InputSource const &)=delete
 
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 maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 
InputSourceoperator= (InputSource const &)=delete
 
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
 
boost::shared_ptr
< LuminosityBlockPrincipal
readAndCacheLumi (HistoryAppender &historyAppender)
 Read next luminosity block (new lumi) More...
 
boost::shared_ptr< RunPrincipalreadAndCacheRun (HistoryAppender &historyAppender)
 Read next run (new run) More...
 
void readAndMergeLumi (boost::shared_ptr< LuminosityBlockPrincipal > lbp)
 Read next luminosity block (same as a prior lumi) More...
 
void readAndMergeRun (boost::shared_ptr< RunPrincipal > rp)
 Read next run (same as a prior run) More...
 
EventPrincipalreadEvent (EventPrincipal &ep)
 
EventPrincipalreadEvent (EventPrincipal &ep, EventID const &)
 Read a specific event. More...
 
std::unique_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)
 
bool skipForForking ()
 
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::RawInputSource
static void fillDescription (ParameterSetDescription &description)
 
- 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

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_
 

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
EventPrincipalmakeEvent (EventPrincipal &eventPrincipal, EventAuxiliary const &eventAuxiliary)
 
void setInputFileTransitionsEachEvent ()
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
bool eventCached () const
 
boost::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
bool newLumi () const
 
bool newRun () const
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) const
 
boost::shared_ptr
< RunPrincipal > const 
runPrincipal () const
 
void setEventCached ()
 Called by the framework to merge or ached() const {return eventCached_;}. More...
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setNewLumi ()
 
void setNewRun ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
virtual void skip (int offset)
 
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:
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.

29  :
30  edm::RawInputSource(pset, desc),
33  dqmStore_(0)
34  {}
stor::EventServerProxy< stor::DQMEventConsumerRegistrationInfo > dqmEventServerProxy_
Definition: DQMHttpSource.h:62
std::unique_ptr< EventAuxiliary > eventAuxiliary_
Definition: DQMHttpSource.h:61
DQMStore * dqmStore_
Definition: DQMHttpSource.h:63
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 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().

83  {
84  boost::mutex::scoped_lock sl(mutex_);
85 
86  MonitorElement* me = dqmStore->get("SM_SMPS_Stats/mergeCount");
87  if (!me){
88  dqmStore->setCurrentFolder("SM_SMPS_Stats");
89  me = dqmStore->bookInt("mergeCount");
90  }
91  me->Fill(dqmEventMsgView.mergeCount());
92 
93  edm::StreamDQMDeserializer deserializeWorker;
94  std::auto_ptr<DQMEvent::TObjectTable> toTablePtr =
95  deserializeWorker.deserializeDQMEvent(dqmEventMsgView);
96 
97  for (DQMEvent::TObjectTable::const_iterator tableIter = toTablePtr->begin(),
98  tableIterEnd = toTablePtr->end(); tableIter != tableIterEnd; ++tableIter)
99  {
100  const std::string subFolderName = tableIter->first;
101  std::vector<TObject*> toList = tableIter->second;
102  dqmStore->setCurrentFolder(subFolderName); // creates dir if needed
103 
104  for (std::vector<TObject*>::const_iterator objectIter = toList.begin(),
105  objectIterEnd = toList.end(); objectIter != objectIterEnd; ++objectIter)
106  {
107  dqmStore->extract(*objectIter, dqmStore->pwd(), overwrite);
108  // TObject cloned into DQMStore. Thus, delete it here.
109  delete *objectIter;
110  }
111  }
112  }
void Fill(long long x)
static boost::mutex mutex_
Definition: DQMHttpSource.h:65
bool extract(TObject *obj, const std::string &dir, bool overwrite)
Definition: DQMStore.cc:1776
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:1473
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:629
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
uint32 mergeCount() const
const std::string & pwd(void) const
Definition: DQMStore.cc:406
bool edm::DQMHttpSource::checkNextEvent ( )
privatevirtual

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::EventAuxiliary::run(), edm::InputSource::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().

37  {
40 
42  if ( data.empty() ) return false;
43 
44  HeaderView hdrView(&data[0]);
45  if (hdrView.code() == Header::DONE) return false;
46 
47  const DQMEventMsgView dqmEventMsgView(&data[0]);
48  addEventToDQMBackend(dqmStore_, dqmEventMsgView, true);
49 
50  EventID id(dqmEventMsgView.runNumber(), dqmEventMsgView.lumiSection(), dqmEventMsgView.eventNumberAtUpdate());
51 
52  setEventAuxiliary(std::unique_ptr<EventAuxiliary>(new EventAuxiliary(id, std::string(), dqmEventMsgView.timeStamp(), true, EventAuxiliary::PhysicsTrigger)));
53 
54  if(!runAuxiliary() || runAuxiliary()->run() != eventAuxiliary().run()) {
56  }
59  }
61  return true;
62  }
static void addEventToDQMBackend(DQMStore *, const DQMEventMsgView &, const bool overwrite)
RunNumber_t run() const
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:247
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:605
stor::EventServerProxy< stor::DQMEventConsumerRegistrationInfo > dqmEventServerProxy_
Definition: DQMHttpSource.h:62
void setLuminosityBlockAuxiliary(LuminosityBlockAuxiliary *lbp)
Definition: InputSource.h:322
void setEventAuxiliary(std::unique_ptr< EventAuxiliary > aux)
Definition: DQMHttpSource.h:54
void setEventCached()
Called by the framework to merge or ached() const {return eventCached_;}.
Definition: InputSource.h:349
EventAuxiliary const & eventAuxiliary() const
Definition: DQMHttpSource.h:51
LuminosityBlockNumber_t luminosityBlock() const
Accessor for current luminosity block number.
Definition: InputSource.cc:611
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:244
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void setRunAuxiliary(RunAuxiliary *rp)
Definition: InputSource.h:318
void getOneEvent(CurlInterface::Content &data)
DQMStore * dqmStore_
Definition: DQMHttpSource.h:63
std::vector< char > Content
Definition: CurlInterface.h:31
EventAuxiliary const& edm::DQMHttpSource::eventAuxiliary ( ) const
inlineprivate

Definition at line 51 of file DQMHttpSource.h.

References eventAuxiliary_.

Referenced by checkNextEvent(), and read().

51  {
52  return *eventAuxiliary_;
53  }
std::unique_ptr< EventAuxiliary > eventAuxiliary_
Definition: DQMHttpSource.h:61
void edm::DQMHttpSource::initializeDQMStore ( )
private

Definition at line 115 of file DQMHttpSource.cc.

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

Referenced by checkNextEvent().

116  {
117  if ( ! dqmStore_ )
119 
120  if ( ! dqmStore_ )
121  throw cms::Exception("readOneEvent", "DQMHttpSource")
122  << "Unable to lookup the DQMStore service!\n";
123  }
DQMStore * dqmStore_
Definition: DQMHttpSource.h:63
EventPrincipal * edm::DQMHttpSource::read ( EventPrincipal eventPrincipal)
privatevirtual

Implements edm::RawInputSource.

Definition at line 64 of file DQMHttpSource.cc.

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

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

65  {
66  // make a fake event principal containing no data but the evId and runId from DQMEvent
67  // and the time stamp from the event at update
68  EventPrincipal* e = makeEvent(
69  eventPrincipal,
71  );
72 
73  return e;
74  }
EventPrincipal * makeEvent(EventPrincipal &eventPrincipal, EventAuxiliary const &eventAuxiliary)
EventAuxiliary const & eventAuxiliary() const
Definition: DQMHttpSource.h:51
void edm::DQMHttpSource::setEventAuxiliary ( std::unique_ptr< EventAuxiliary aux)
inlineprivate

Definition at line 54 of file DQMHttpSource.h.

References eventAuxiliary_.

Referenced by checkNextEvent().

54  {
55  eventAuxiliary_ = std::move(aux);
56  }
std::unique_ptr< EventAuxiliary > eventAuxiliary_
Definition: DQMHttpSource.h:61

Member Data Documentation

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

Definition at line 62 of file DQMHttpSource.h.

Referenced by checkNextEvent().

DQMStore* edm::DQMHttpSource::dqmStore_
private

Definition at line 63 of file DQMHttpSource.h.

Referenced by checkNextEvent(), and initializeDQMStore().

std::unique_ptr<EventAuxiliary> edm::DQMHttpSource::eventAuxiliary_
private

Definition at line 61 of file DQMHttpSource.h.

Referenced by eventAuxiliary(), and setEventAuxiliary().

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

Definition at line 65 of file DQMHttpSource.h.