00001 #ifndef DQMSERVICES_COMPONENTS_DQMFILESAVER_H 00002 #define DQMSERVICES_COMPONENTS_DQMFILESAVER_H 00003 00004 #include "FWCore/Framework/interface/EDAnalyzer.h" 00005 #include "DQMServices/Core/interface/MonitorElement.h" 00006 #include <sys/time.h> 00007 #include <string> 00008 00009 class DQMStore; 00010 class DQMFileSaver : public edm::EDAnalyzer 00011 { 00012 public: 00013 DQMFileSaver(const edm::ParameterSet &ps); 00014 00015 protected: 00016 virtual void beginJob(void); 00017 virtual void beginRun(const edm::Run &, const edm::EventSetup &); 00018 virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &); 00019 virtual void analyze(const edm::Event &e, const edm::EventSetup &); 00020 virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &); 00021 virtual void endRun(const edm::Run &, const edm::EventSetup &); 00022 virtual void endJob(void); 00023 00024 private: 00025 void saveForOffline(const std::string &workflow, int run, int lumi); 00026 void saveForOnline(const std::string &suffix, const std::string &rewrite); 00027 void saveJobReport(const std::string &filename); 00028 00029 enum Convention 00030 { 00031 Online, 00032 Offline 00033 }; 00034 00035 Convention convention_; 00036 std::string workflow_; 00037 std::string producer_; 00038 std::string dirName_; 00039 int version_; 00040 bool runIsComplete_; 00041 00042 int saveByLumiSection_; 00043 int saveByEvent_; 00044 int saveByMinute_; 00045 int saveByTime_; 00046 int saveByRun_; 00047 bool saveAtJobEnd_; 00048 int saveReference_; 00049 int saveReferenceQMin_; 00050 int forceRunNumber_; 00051 00052 std::string fileBaseName_; 00053 std::string fileUpdate_; 00054 00055 DQMStore *dbe_; 00056 00057 int irun_; 00058 int ilumi_; 00059 int ilumiprev_; 00060 int ievent_; 00061 int nrun_; 00062 int nlumi_; 00063 int nevent_; 00064 timeval start_; 00065 timeval saved_; 00066 00067 int numKeepSavedFiles_; 00068 std::list<std::string> pastSavedFiles_; 00069 00070 MonitorElement * versCMSSW_ ; 00071 MonitorElement * versDataset_ ; 00072 MonitorElement * versTaglist_ ; 00073 MonitorElement * versGlobaltag_ ; 00074 MonitorElement * hostName_; 00075 MonitorElement * processName_; 00076 MonitorElement * workingDir_; 00077 MonitorElement * processId_; 00078 MonitorElement * isComplete_; 00079 MonitorElement * fileVersion_; 00080 00081 00082 00083 }; 00084 00085 #endif // DQMSERVICES_COMPONEntS_DQMFILESAVER_H