CMS 3D CMS Logo

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