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  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  {
49  PB
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_;
99 };
100 
101 #endif // DQMSERVICES_COMPONEntS_DQMFILESAVER_H
int forceRunNumber_
Definition: DQMFileSaver.h:80
int saveReferenceQMin_
Definition: DQMFileSaver.h:79
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
Convention convention_
Definition: DQMFileSaver.h:62
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
void beginJob()
Definition: Breakpoints.cc:15
int saveByLumiSection_
Definition: DQMFileSaver.h:75
bool enableMultiThread_
Definition: DQMFileSaver.h:72
std::string transferDestination_
Definition: DQMFileSaver.h:97
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
std::string producer_
Definition: DQMFileSaver.h:65
std::string child_
Definition: DQMFileSaver.h:68
int saveReference_
Definition: DQMFileSaver.h:78
std::string filterName_
Definition: DQMFileSaver.h:69
std::atomic< int > fileUpdate_
Definition: DQMFileSaver.h:83
FileFormat fileFormat_
Definition: DQMFileSaver.h:63
std::atomic< int > irun_
Definition: DQMFileSaver.h:90
bool saveAtJobEnd_
Definition: DQMFileSaver.h:77
std::atomic< int > nrun_
Definition: DQMFileSaver.h:86
std::string mergeType_
Definition: DQMFileSaver.h:98
static const std::string streamSuffix_
Definition: DQMFileSaver.h:96
Definition: Run.h:42