CMS 3D CMS Logo

DQMFileSaverBase.h
Go to the documentation of this file.
1 #ifndef DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
2 #define DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
3 
6 
9 
14 
16 
17 #include <sys/time.h>
18 #include <string>
19 #include <mutex>
20 
21 #include <boost/property_tree/ptree.hpp>
22 
23 namespace dqm {
24 
25  struct NoCache {};
26 
27  class DQMFileSaverBase : public edm::global::EDAnalyzer<edm::RunCache<NoCache>, edm::LuminosityBlockCache<NoCache> > {
28  public:
31 
33  ~DQMFileSaverBase() override;
34 
35  protected:
36  // file name components, in order
37  struct FileParameters {
39  std::string producer_; // DQM or Playback
40  int version_;
42  long run_;
43  long lumi_;
44  std::string child_; // child of a fork
45  };
46 
47  protected:
48  //virtual void beginJob(void) const override final;
49  //virtual void endJob(void) const override final;
50 
51  std::shared_ptr<NoCache> globalBeginRun(const edm::Run &, const edm::EventSetup &) const final;
52 
53  std::shared_ptr<NoCache> globalBeginLuminosityBlock(const edm::LuminosityBlock &,
54  const edm::EventSetup &) const final;
55 
56  void analyze(edm::StreamID, const edm::Event &e, const edm::EventSetup &) const final;
57 
58  void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const final;
59  void globalEndRun(const edm::Run &, const edm::EventSetup &) const final;
60 
61  // these method (and only these) should be overriden
62  // so we need to call all file savers
63  virtual void initRun() const {};
64  virtual void saveLumi(const FileParameters &fp) const {};
65  virtual void saveRun(const FileParameters &fp) const {};
66 
67  static const std::string filename(const FileParameters &fp, bool useLumi = false);
68 
69  // utilities
70  void logFileAction(const std::string &msg, const std::string &fileName) const;
71  void saveJobReport(const std::string &filename) const;
72 
73  // members
77 
80 
81  public:
83  };
84 } // namespace dqm
85 
86 #endif // DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
DQMFileSaverBase(const edm::ParameterSet &ps)
void logFileAction(const std::string &msg, const std::string &fileName) const
~DQMFileSaverBase() override
virtual void saveLumi(const FileParameters &fp) const
static std::mutex mutex
Definition: Proxy.cc:8
void analyze(edm::StreamID, const edm::Event &e, const edm::EventSetup &) const final
static const std::string filename(const FileParameters &fp, bool useLumi=false)
edm::GetterOfProducts< DQMToken > rungetter_
void saveJobReport(const std::string &filename) const
virtual void initRun() const
virtual void saveRun(const FileParameters &fp) const
d
Definition: ztail.py:151
dqm::legacy::MonitorElement MonitorElement
std::shared_ptr< NoCache > globalBeginRun(const edm::Run &, const edm::EventSetup &) const final
std::shared_ptr< NoCache > globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const final
void globalEndRun(const edm::Run &, const edm::EventSetup &) const final
tuple msg
Definition: mps_check.py:286
FileParameters initial_fp_
edm::GetterOfProducts< DQMToken > lumigetter_
static void fillDescription(edm::ParameterSetDescription &d)
dqm::legacy::DQMStore DQMStore
Definition: DQMStore.h:18
void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const final
Definition: Run.h:45