CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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);
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:
86 };
87 
88 } // dqm namespace
89 
90 #endif // DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
DQMFileSaverBase(const edm::ParameterSet &ps)
void saveJobReport(const std::string &filename) const
virtual void saveRun(const FileParameters &fp) const
static boost::mutex mutex
Definition: LHEProxy.cc:11
static const std::string filename(const FileParameters &fp, bool useLumi=false)
SaveReferenceTag
Definition: DQMStore.h:78
virtual void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const overridefinal
virtual void saveLumi(const FileParameters &fp) const
virtual std::shared_ptr< NoCache > globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const overridefinal
tuple d
Definition: ztail.py:151
virtual void postForkReacquireResources(unsigned int childIndex, unsigned int numberOfChildren)
virtual void analyze(edm::StreamID, const edm::Event &e, const edm::EventSetup &) const overridefinal
void logFileAction(const std::string &msg, const std::string &fileName) const
DQMStore::SaveReferenceTag saveReference_
string const
Definition: compareJSON.py:14
FileParameters initial_fp_
virtual std::shared_ptr< NoCache > globalBeginRun(const edm::Run &, const edm::EventSetup &) const overridefinal
static void fillDescription(edm::ParameterSetDescription &d)
virtual void initRun(void) const
virtual void globalEndRun(const edm::Run &, const edm::EventSetup &) const overridefinal
Definition: Run.h:43