00001 #ifndef DQMSERVICES_COMPONEntS_DQMFILESAVER_H 00002 # define DQMSERVICES_COMPONEntS_DQMFILESAVER_H 00003 00004 # include "FWCore/Framework/interface/EDAnalyzer.h" 00005 # include <sys/time.h> 00006 # include <string> 00007 00008 class DQMStore; 00009 class DQMFileSaver : public edm::EDAnalyzer 00010 { 00011 public: 00012 DQMFileSaver(const edm::ParameterSet &ps); 00013 00014 protected: 00015 virtual void beginJob(const edm::EventSetup &); 00016 virtual void beginRun(const edm::Run &, const edm::EventSetup &); 00017 virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &); 00018 virtual void analyze(const edm::Event &e, const edm::EventSetup &); 00019 virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &); 00020 virtual void endRun(const edm::Run &, const edm::EventSetup &); 00021 virtual void endJob(void); 00022 00023 private: 00024 void saveForOffline(const std::string &workflow, int run); 00025 void saveForOnline(const std::string &suffix, const std::string &rewrite); 00026 00027 enum Convention 00028 { 00029 Online, 00030 Offline, 00031 RelVal 00032 }; 00033 00034 Convention convention_; 00035 std::string workflow_; 00036 std::string producer_; 00037 std::string dirName_; 00038 00039 int saveByLumiSection_; 00040 int saveByEvent_; 00041 int saveByMinute_; 00042 int saveByTime_; 00043 int saveByRun_; 00044 bool saveAtJobEnd_; 00045 int saveReference_; 00046 int saveReferenceQMin_; 00047 int forceRunNumber_; 00048 00049 std::string fileBaseName_; 00050 DQMStore *dbe_; 00051 int irun_; 00052 int ilumi_; 00053 int ilumiprev_; 00054 int ievent_; 00055 int nrun_; 00056 int nlumi_; 00057 int nevent_; 00058 timeval start_; 00059 timeval saved_; 00060 }; 00061 00062 #endif // DQMSERVICES_COMPONEntS_DQMFILESAVER_H