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 
24  : public edm::global::EDAnalyzer<edm::RunCache<NoCache>,
25  edm::LuminosityBlockCache<NoCache> > {
26  public:
29 
30  protected:
31 
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  virtual std::shared_ptr<NoCache> globalBeginRun(
52  const edm::Run &, const edm::EventSetup &) const override final;
53 
54  virtual std::shared_ptr<NoCache> globalBeginLuminosityBlock(
55  const edm::LuminosityBlock &, const edm::EventSetup &) const override final;
56 
57  virtual void analyze(edm::StreamID, const edm::Event &e,
58  const edm::EventSetup &) const override final;
59 
60  virtual void globalEndLuminosityBlock(const edm::LuminosityBlock &,
61  const edm::EventSetup &) const override final ;
62  virtual void globalEndRun(const edm::Run &, const edm::EventSetup &) const override final;
63 
64  // these method (and only these) should be overriden
65  // so we need to call all file savers
66  virtual void initRun(void) const {};
67  virtual void saveLumi(const FileParameters& fp) const {};
68  virtual void saveRun(const FileParameters& fp) const {};
69 
70  static const std::string filename(const FileParameters& fp, bool useLumi = false);
71 
72  // utilities
73  void logFileAction(const std::string& msg, const std::string& fileName) const;
74  void saveJobReport(const std::string &filename) const;
75 
76  // members
79 
80 
81  public:
82  static void fillDescription(edm::ParameterSetDescription& d);
83 };
84 
85 } // dqm namespace
86 
87 #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
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
SaveReferenceTag
Definition: DQMStore.h:78
virtual void saveLumi(const FileParameters &fp) const
DQMStore::SaveReferenceTag saveReference_
FileParameters initial_fp_
HLT enums.
Definition: Run.h:42