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