CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMFileSaver.h
Go to the documentation of this file.
1 #ifndef DQMSERVICES_COMPONENTS_DQMFILESAVER_H
2 #define DQMSERVICES_COMPONENTS_DQMFILESAVER_H
3 
6 
7 #include <boost/property_tree/ptree.hpp>
8 #include <sys/time.h>
9 #include <string>
10 
11 namespace evf { class FastMonitoringService; }
12 namespace saverDetails { struct NoCache {}; }
13 
14 class DQMStore;
15 class DQMFileSaver : public edm::global::EDAnalyzer<edm::RunCache<saverDetails::NoCache>, edm::LuminosityBlockCache<saverDetails::NoCache> >
16 {
17 public:
19 
20 
21  // used by the JsonWritingTimedPoolOutputModule,
22  // fms will be nullptr in such case
23  static boost::property_tree::ptree fillJson(
24  int run, int lumi, const std::string &dataFilePathName,
26 
27 
28 protected:
29  virtual void beginJob(void);
30  virtual std::shared_ptr<saverDetails::NoCache> globalBeginRun(const edm::Run &, const edm::EventSetup &) const;
31  virtual std::shared_ptr<saverDetails::NoCache> globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const;
32  virtual void analyze(edm::StreamID, const edm::Event &e, const edm::EventSetup &) const;
33  virtual void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const;
34  virtual void globalEndRun(const edm::Run &, const edm::EventSetup &) const;
35  virtual void endJob(void);
36  virtual void postForkReacquireResources(unsigned int childIndex, unsigned int numberOfChildren);
37 
38 public:
40  {
44  };
45 
47  {
50  };
51 
52 private:
53  void saveForOfflinePB(const std::string &workflow, int run) const;
54  void saveForOffline(const std::string &workflow, int run, int lumi) const;
55 
56  void saveForOnlinePB(int run, const std::string &suffix) const;
57  void saveForOnline(int run, const std::string &suffix, const std::string &rewrite) const;
58 
59  void saveForFilterUnit(const std::string& rewrite, int run, int lumi, const FileFormat fileFormat) const;
60  void saveJobReport(const std::string &filename) const;
61 
70  int version_;
74 
81 
83  mutable std::atomic<int> fileUpdate_;
84 
86  mutable std::atomic<int> nrun_;
87  mutable std::atomic<int> nlumi_;
88 
89  // needed only for the harvesting step when saving in the endJob
90  mutable std::atomic<int> irun_;
91 
92  // Services used in DAQ2 (so for FilterUnit case only)
94 
95  static const std::string streamPrefix_;
96  static const std::string streamSuffix_;
97 };
98 
99 #endif // DQMSERVICES_COMPONEntS_DQMFILESAVER_H
DQMFileSaver(const edm::ParameterSet &ps)
int forceRunNumber_
Definition: DQMFileSaver.h:80
int saveReferenceQMin_
Definition: DQMFileSaver.h:79
void saveForOffline(const std::string &workflow, int run, int lumi) const
Definition: DQMFileSaver.cc:86
virtual void globalEndRun(const edm::Run &, const edm::EventSetup &) const
Convention convention_
Definition: DQMFileSaver.h:62
tuple lumi
Definition: fjr2json.py:35
evf::FastMonitoringService * fms_
Definition: DQMFileSaver.h:93
DQMStore * dbe_
Definition: DQMFileSaver.h:85
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:87
std::string dirName_
Definition: DQMFileSaver.h:67
std::string fileBaseName_
Definition: DQMFileSaver.h:82
virtual void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const
int saveByLumiSection_
Definition: DQMFileSaver.h:75
bool enableMultiThread_
Definition: DQMFileSaver.h:72
void saveJobReport(const std::string &filename) const
static boost::property_tree::ptree fillJson(int run, int lumi, const std::string &dataFilePathName, evf::FastMonitoringService *fms)
void saveForOnline(int run, const std::string &suffix, const std::string &rewrite) const
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:73
bool runIsComplete_
Definition: DQMFileSaver.h:71
std::string stream_label_
Definition: DQMFileSaver.h:66
static const std::string streamPrefix_
Definition: DQMFileSaver.h:95
std::string workflow_
Definition: DQMFileSaver.h:64
virtual std::shared_ptr< saverDetails::NoCache > globalBeginRun(const edm::Run &, const edm::EventSetup &) const
std::string producer_
Definition: DQMFileSaver.h:65
std::string child_
Definition: DQMFileSaver.h:68
int saveReference_
Definition: DQMFileSaver.h:78
void saveForOnlinePB(int run, const std::string &suffix) const
std::string filterName_
Definition: DQMFileSaver.h:69
std::atomic< int > fileUpdate_
Definition: DQMFileSaver.h:83
FileFormat fileFormat_
Definition: DQMFileSaver.h:63
virtual void analyze(edm::StreamID, const edm::Event &e, const edm::EventSetup &) const
std::atomic< int > irun_
Definition: DQMFileSaver.h:90
virtual std::shared_ptr< saverDetails::NoCache > globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const
void saveForOfflinePB(const std::string &workflow, int run) const
Definition: DQMFileSaver.cc:77
bool saveAtJobEnd_
Definition: DQMFileSaver.h:77
std::atomic< int > nrun_
Definition: DQMFileSaver.h:86
tuple filename
Definition: lut2db_cfg.py:20
virtual void postForkReacquireResources(unsigned int childIndex, unsigned int numberOfChildren)
virtual void beginJob(void)
virtual void endJob(void)
static const std::string streamSuffix_
Definition: DQMFileSaver.h:96
Definition: Run.h:41
void saveForFilterUnit(const std::string &rewrite, int run, int lumi, const FileFormat fileFormat) const