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 
12 
13 #include <sys/time.h>
14 #include <string>
15 #include <mutex>
16 
17 #include <boost/property_tree/ptree.hpp>
18 
19 namespace dqm {
20 
21  struct NoCache {};
22 
23  class DQMFileSaverBase : public edm::global::EDAnalyzer<edm::RunCache<NoCache>, edm::LuminosityBlockCache<NoCache> > {
24  public:
27 
29  ~DQMFileSaverBase() override;
30 
31  protected:
32  // file name components, in order
33  struct FileParameters {
35  std::string producer_; // DQM or Playback
36  int version_;
38  long run_;
39  long lumi_;
40  std::string child_; // child of a fork
41 
42  // other parameters
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
76 
77  public:
78  static void fillDescription(edm::ParameterSetDescription &d);
79  };
80 
81 } // namespace dqm
82 
83 #endif // DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
static boost::mutex mutex
Definition: Proxy.cc:9
static void logFileAction(char const *msg, std::string const &fileName)
Definition: LHEReader.cc:37
virtual void saveRun(const FileParameters &fp) const
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
virtual void saveLumi(const FileParameters &fp) const
d
Definition: ztail.py:151
dqm::legacy::MonitorElement MonitorElement
DQMStore::SaveReferenceTag saveReference_
tuple msg
Definition: mps_check.py:285
FileParameters initial_fp_
HLT enums.
dqm::legacy::DQMStore DQMStore
Definition: Run.h:45