Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:59:04

0001 #ifndef DQMSERVICES_COMPONENTS_DQMFILESAVEROUTPUT_H
0002 #define DQMSERVICES_COMPONENTS_DQMFILESAVEROUTPUT_H
0003 
0004 #include "DQMServices/Core/interface/DQMStore.h"
0005 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0006 
0007 #include <sys/time.h>
0008 #include <mutex>
0009 #include <string>
0010 
0011 #include "DQMFileSaverBase.h"
0012 
0013 namespace dqm {
0014 
0015   class DQMFileSaverOnline : public DQMFileSaverBase {
0016   public:
0017     DQMFileSaverOnline(const edm::ParameterSet& ps);
0018     ~DQMFileSaverOnline() override;
0019 
0020     static const std::string fillOrigin(const std::string& filename, const std::string& final_filename);
0021 
0022   protected:
0023     void saveLumi(const FileParameters& fp) const override;
0024     void saveRun(const FileParameters& fp) const override;
0025 
0026   protected:
0027     int backupLumiCount_;
0028     bool keepBackupLumi_;
0029 
0030     // snapshot making
0031     struct SnapshotFiles {
0032       std::string data;
0033       std::string meta;
0034     };
0035 
0036     void makeSnapshot(const FileParameters& fp, bool final) const;
0037     void appendSnapshot(SnapshotFiles new_snap) const;
0038 
0039     mutable std::mutex snapshots_lock_;
0040     mutable std::list<SnapshotFiles> snapshots_;
0041 
0042     void checkError(const char* msg, const std::string& file, int status) const;
0043 
0044   public:
0045     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0046   };
0047 
0048 }  // namespace dqm
0049 
0050 #endif  // DQMSERVICES_COMPONENTS_DQMFILESAVEROUTPUT_H