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 
7 
10 
13 
14 #include <sys/time.h>
15 #include <string>
16 #include <mutex>
17 
18 #include <boost/property_tree/ptree.hpp>
19 
20 namespace dqm {
21 
22 struct NoCache {};
23 
25  : public edm::global::EDAnalyzer<edm::RunCache<NoCache>,
26  edm::LuminosityBlockCache<NoCache> > {
27  public:
29  ~DQMFileSaverBase() override;
30 
31  protected:
32 
33  // file name components, in order
34  struct FileParameters {
36  std::string producer_; // DQM or Playback
37  int version_;
39  long run_;
40  long lumi_;
41  std::string child_; // child of a fork
42 
43  // other parameters
46  };
47 
48  protected:
49  //virtual void beginJob(void) const override final;
50  //virtual void endJob(void) const override final;
51 
52  std::shared_ptr<NoCache> globalBeginRun(
53  const edm::Run &, const edm::EventSetup &) const final;
54 
55  std::shared_ptr<NoCache> globalBeginLuminosityBlock(
56  const edm::LuminosityBlock &, const edm::EventSetup &) const final;
57 
58  void analyze(edm::StreamID, const edm::Event &e,
59  const edm::EventSetup &) const final;
60 
61  void globalEndLuminosityBlock(const edm::LuminosityBlock &,
62  const edm::EventSetup &) const final ;
63  void globalEndRun(const edm::Run &, const edm::EventSetup &) const final;
64 
65  // these method (and only these) should be overriden
66  // so we need to call all file savers
67  virtual void initRun() const {};
68  virtual void saveLumi(const FileParameters& fp) const {};
69  virtual void saveRun(const FileParameters& fp) const {};
70 
71  static const std::string filename(const FileParameters& fp, bool useLumi = false);
72 
73  // utilities
74  void logFileAction(const std::string& msg, const std::string& fileName) const;
75  void saveJobReport(const std::string &filename) const;
76 
77  // members
80 
81 
82  public:
83  static void fillDescription(edm::ParameterSetDescription& d);
84 };
85 
86 } // dqm namespace
87 
88 #endif // DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
static boost::mutex mutex
Definition: Proxy.cc:11
static void logFileAction(char const *msg, std::string const &fileName)
Definition: LHEReader.cc:37
virtual void saveRun(const FileParameters &fp) const
virtual example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
SaveReferenceTag
Definition: DQMStore.h:81
virtual void saveLumi(const FileParameters &fp) const
DQMStore::SaveReferenceTag saveReference_
tuple msg
Definition: mps_check.py:277
FileParameters initial_fp_
HLT enums.
Definition: Run.h:44