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  virtual void postForkReacquireResources(unsigned int childIndex,
65  unsigned int numberOfChildren) override;
66 
67  // these method (and only these) should be overriden
68  // so we need to call all file savers
69  virtual void initRun(void) const {};
70  virtual void saveLumi(const FileParameters& fp) const {};
71  virtual void saveRun(const FileParameters& fp) const {};
72 
73  static const std::string filename(const FileParameters& fp, bool useLumi = false);
74 
75  // utilities
76  void logFileAction(const std::string& msg, const std::string& fileName) const;
77  void saveJobReport(const std::string &filename) const;
78 
79  // members
82 
83 
84  public:
85  static void fillDescription(edm::ParameterSetDescription& d);
86 };
87 
88 } // dqm namespace
89 
90 #endif // DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
static void logFileAction(char const *msg, std::string const &fileName)
Definition: LHEReader.cc:37
virtual void saveRun(const FileParameters &fp) const
static boost::mutex mutex
Definition: LHEProxy.cc:11
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