test
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 protected:
21  virtual void beginJob(void);
22  virtual std::shared_ptr<saverDetails::NoCache> globalBeginRun(const edm::Run &, const edm::EventSetup &) const;
23  virtual std::shared_ptr<saverDetails::NoCache> globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const;
24  virtual void analyze(edm::StreamID, const edm::Event &e, const edm::EventSetup &) const;
25  virtual void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const;
26  virtual void globalEndRun(const edm::Run &, const edm::EventSetup &) const;
27  virtual void endJob(void);
28  virtual void postForkReacquireResources(unsigned int childIndex, unsigned int numberOfChildren);
29 
30 public:
32  {
36  };
37 
39  {
42  };
43 
44 private:
45  void saveForOfflinePB(const std::string &workflow, int run) const;
46  void saveForOffline(const std::string &workflow, int run, int lumi) const;
47 
48  void saveForOnlinePB(int run, const std::string &suffix) const;
49  void saveForOnline(int run, const std::string &suffix, const std::string &rewrite) const;
50 
51  void saveForFilterUnit(const std::string& rewrite, int run, int lumi, const FileFormat fileFormat) const;
52  void saveJobReport(const std::string &filename) const;
53  void fillJson(int run, int lumi, const std::string& dataFilePathName, boost::property_tree::ptree& pt) const;
54 
63  int version_;
67 
74 
76  mutable std::atomic<int> fileUpdate_;
77 
79  mutable std::atomic<int> nrun_;
80  mutable std::atomic<int> nlumi_;
81 
82  // needed only for the harvesting step when saving in the endJob
83  mutable std::atomic<int> irun_;
84 
85  // Services used in DAQ2 (so for FilterUnit case only)
87 
88  static const std::string streamPrefix_;
89  static const std::string streamSuffix_;
90 };
91 
92 #endif // DQMSERVICES_COMPONEntS_DQMFILESAVER_H
DQMFileSaver(const edm::ParameterSet &ps)
int forceRunNumber_
Definition: DQMFileSaver.h:73
int saveReferenceQMin_
Definition: DQMFileSaver.h:72
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:55
tuple lumi
Definition: fjr2json.py:35
evf::FastMonitoringService * fms_
Definition: DQMFileSaver.h:86
DQMStore * dbe_
Definition: DQMFileSaver.h:78
std::atomic< int > nlumi_
Definition: DQMFileSaver.h:80
std::string dirName_
Definition: DQMFileSaver.h:60
std::string fileBaseName_
Definition: DQMFileSaver.h:75
virtual void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const
void fillJson(int run, int lumi, const std::string &dataFilePathName, boost::property_tree::ptree &pt) const
int saveByLumiSection_
Definition: DQMFileSaver.h:68
bool enableMultiThread_
Definition: DQMFileSaver.h:65
void saveJobReport(const std::string &filename) const
void saveForOnline(int run, const std::string &suffix, const std::string &rewrite) const
bool fakeFilterUnitMode_
Definition: DQMFileSaver.h:66
bool runIsComplete_
Definition: DQMFileSaver.h:64
std::string stream_label_
Definition: DQMFileSaver.h:59
static const std::string streamPrefix_
Definition: DQMFileSaver.h:88
std::string workflow_
Definition: DQMFileSaver.h:57
virtual std::shared_ptr< saverDetails::NoCache > globalBeginRun(const edm::Run &, const edm::EventSetup &) const
std::string producer_
Definition: DQMFileSaver.h:58
std::string child_
Definition: DQMFileSaver.h:61
int saveReference_
Definition: DQMFileSaver.h:71
void saveForOnlinePB(int run, const std::string &suffix) const
std::string filterName_
Definition: DQMFileSaver.h:62
std::atomic< int > fileUpdate_
Definition: DQMFileSaver.h:76
FileFormat fileFormat_
Definition: DQMFileSaver.h:56
virtual void analyze(edm::StreamID, const edm::Event &e, const edm::EventSetup &) const
std::atomic< int > irun_
Definition: DQMFileSaver.h:83
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:70
std::atomic< int > nrun_
Definition: DQMFileSaver.h:79
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:89
Definition: Run.h:41
void saveForFilterUnit(const std::string &rewrite, int run, int lumi, const FileFormat fileFormat) const