CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/EventFilter/Modules/interface/FUShmDQMOutputService.h

Go to the documentation of this file.
00001 #ifndef FUShmDQMOutputService_H
00002 #define FUShmDQMOutputService_H
00003 
00015 #include "DQMServices/Core/interface/DQMStore.h"
00016 #include "DQMServices/Core/interface/MonitorElement.h"
00017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00018 #include "FWCore/ServiceRegistry/interface/ActivityRegistry.h"
00019 #include "FWCore/Framework/interface/Event.h"
00020 #include "FWCore/Framework/interface/EventSetup.h"
00021 #include "IOPool/Streamer/interface/DQMEventMessage.h"
00022 #include "IOPool/Streamer/interface/DQMEventMsgBuilder.h"
00023 #include "FWCore/Framework/interface/LuminosityBlock.h"
00024 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
00025 #include "IOPool/Streamer/interface/StreamDQMSerializer.h"
00026 #include "IOPool/Streamer/interface/StreamDQMDeserializer.h"
00027 #include "EventFilter/ShmBuffer/interface/FUShmBuffer.h"
00028 #include "EventFilter/Utilities/interface/ServiceWeb.h"
00029 
00030 #include "xdata/UnsignedInteger32.h"
00031 
00032 class FUShmDQMOutputService : public evf::ServiceWeb
00033 {
00034  public:
00035   FUShmDQMOutputService(const edm::ParameterSet &pset,
00036                         edm::ActivityRegistry &actReg);
00037   ~FUShmDQMOutputService(void);
00038 
00039   //serviceweb interface
00040   void defaultWebPage(xgi::Input *in, xgi::Output *out); 
00041   void publish(xdata::InfoSpace *);
00042 
00043   void postEventProcessing(const edm::Event &event,
00044                            const edm::EventSetup &eventSetup);
00045 
00046   // test routines to check on timing of various signals
00047   void postEndJobProcessing();
00048   void postSourceConstructionProcessing(const edm::ModuleDescription &modDesc);
00049   void preBeginRun(const edm::RunID &runID, const edm::Timestamp &timestamp);
00050   void postEndLumi(edm::LuminosityBlock const&, edm::EventSetup const&);
00051   bool attachToShm();
00052   bool detachFromShm();
00053   void reset(){
00054     nbUpdates_ = 0;
00055     initializationIsNeeded_ = true;
00056   }
00057  protected:
00058   DQMStore *bei;
00059 
00060   void findMonitorElements(DQMEvent::TObjectTable &toTable,
00061                            std::string folderPath);
00062 
00063  private:
00064   void writeShmDQMData(DQMEventMsgBuilder const& dqmMsgBuilder);
00065 
00066   std::vector<char> messageBuffer_;
00067   int lumiSectionInterval_;  
00068   double lumiSectionsPerUpdate_;
00069   uint32 updateNumber_;
00070   unsigned int lumiSectionOfPreviousUpdate_;
00071   unsigned int firstLumiSectionSeen_;
00072   double timeInSecSinceUTC_;
00073   bool initializationIsNeeded_;
00074   bool useCompression_;
00075   int compressionLevel_;
00076   edm::StreamDQMSerializer serializeWorker_;
00077   edm::StreamDQMDeserializer deserializeWorker_;
00078 
00079   evf::FUShmBuffer* shmBuffer_;
00080 
00081   xdata::UnsignedInteger32 nbUpdates_;
00082   char host_name_[255];
00083 
00084   const std::string input;
00085   const std::string dqm;
00086 
00087   static bool fuIdsInitialized_;
00088   static uint32 fuGuidValue_;
00089 
00090   bool attach_;
00091  public:
00092   void setAttachToShm();
00093 };
00094 
00095 #endif