CMS 3D CMS Logo

DQMFileSaverBase.h
Go to the documentation of this file.
1 #ifndef DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
2 #define DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
3 
6 
9 
12 
13 #include <sys/time.h>
14 #include <string>
15 #include <mutex>
16 
17 #include <boost/property_tree/ptree.hpp>
18 
19 namespace dqm {
20 
21  struct NoCache {};
22 
23  class DQMFileSaverBase : public edm::global::EDAnalyzer<edm::RunCache<NoCache>, edm::LuminosityBlockCache<NoCache> > {
24  public:
27 
29  ~DQMFileSaverBase() override;
30 
31  protected:
32  // file name components, in order
33  struct FileParameters {
35  std::string producer_; // DQM or Playback
36  int version_;
38  long run_;
39  long lumi_;
40  std::string child_; // child of a fork
41  };
42 
43  protected:
44  //virtual void beginJob(void) const override final;
45  //virtual void endJob(void) const override final;
46 
47  std::shared_ptr<NoCache> globalBeginRun(const edm::Run &, const edm::EventSetup &) const final;
48 
49  std::shared_ptr<NoCache> globalBeginLuminosityBlock(const edm::LuminosityBlock &,
50  const edm::EventSetup &) const final;
51 
52  void analyze(edm::StreamID, const edm::Event &e, const edm::EventSetup &) const final;
53 
54  void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const final;
55  void globalEndRun(const edm::Run &, const edm::EventSetup &) const final;
56 
57  // these method (and only these) should be overriden
58  // so we need to call all file savers
59  virtual void initRun() const {};
60  virtual void saveLumi(const FileParameters &fp) const {};
61  virtual void saveRun(const FileParameters &fp) const {};
62 
63  static const std::string filename(const FileParameters &fp, bool useLumi = false);
64 
65  // utilities
66  void logFileAction(const std::string &msg, const std::string &fileName) const;
67  void saveJobReport(const std::string &filename) const;
68 
69  // members
73 
74  public:
76  };
77 
78 } // namespace dqm
79 
80 #endif // DQMSERVICES_COMPONENTS_DQMFILESAVERBASE_H
ConfigurationDescriptions.h
dqm::DQMFileSaverBase::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: DQMFileSaverBase.h:26
edm::StreamID
Definition: StreamID.h:30
dqm::DQMFileSaverBase::FileParameters
Definition: DQMFileSaverBase.h:33
dqm::DQMFileSaverBase::globalEndLuminosityBlock
void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const final
Definition: DQMFileSaverBase.cc:66
dqm::DQMFileSaverBase::logFileAction
void logFileAction(const std::string &msg, const std::string &fileName) const
Definition: DQMFileSaverBase.cc:133
dqm::DQMFileSaverBase::saveLumi
virtual void saveLumi(const FileParameters &fp) const
Definition: DQMFileSaverBase.h:60
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
dqm::DQMFileSaverBase::filename
static const std::string filename(const FileParameters &fp, bool useLumi=false)
Definition: DQMFileSaverBase.cc:91
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::DQMFileSaverBase::analyze
void analyze(edm::StreamID, const edm::Event &e, const edm::EventSetup &) const final
Definition: DQMFileSaverBase.cc:62
DQMStore.h
personalPlayback.fp
fp
Definition: personalPlayback.py:523
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
mps_check.msg
tuple msg
Definition: mps_check.py:285
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
dqm::DQMFileSaverBase::~DQMFileSaverBase
~DQMFileSaverBase() override
dqm::DQMFileSaverBase::initRun
virtual void initRun() const
Definition: DQMFileSaverBase.h:59
dqm::DQMFileSaverBase::initial_fp_lock_
std::mutex initial_fp_lock_
Definition: DQMFileSaverBase.h:70
dqm::DQMFileSaverBase::FileParameters::run_
long run_
Definition: DQMFileSaverBase.h:38
dqm::DQMFileSaverBase::saveRun
virtual void saveRun(const FileParameters &fp) const
Definition: DQMFileSaverBase.h:61
dqm::legacy::DQMStore
Definition: DQMStore.h:727
dqm::DQMFileSaverBase::FileParameters::version_
int version_
Definition: DQMFileSaverBase.h:36
dqm::DQMFileSaverBase::runNumber_
int runNumber_
Definition: DQMFileSaverBase.h:72
dqm::DQMFileSaverBase::MonitorElement
dqm::legacy::MonitorElement MonitorElement
Definition: DQMFileSaverBase.h:25
dqm::DQMFileSaverBase::FileParameters::lumi_
long lumi_
Definition: DQMFileSaverBase.h:39
ParameterSetDescription.h
mutex
static boost::mutex mutex
Definition: Proxy.cc:9
dqm::DQMFileSaverBase
Definition: DQMFileSaverBase.h:23
dqm::DQMFileSaverBase::saveJobReport
void saveJobReport(const std::string &filename) const
Definition: DQMFileSaverBase.cc:122
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
dqm::DQMFileSaverBase::globalBeginLuminosityBlock
std::shared_ptr< NoCache > globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const final
Definition: DQMFileSaverBase.cc:57
edm::ParameterSet
Definition: ParameterSet.h:36
dqm::DQMFileSaverBase::FileParameters::path_
std::string path_
Definition: DQMFileSaverBase.h:34
dqm::DQMFileSaverBase::initial_fp_
FileParameters initial_fp_
Definition: DQMFileSaverBase.h:71
EvFDaqDirector.h
FastMonitoringService.h
dqm::NoCache
Definition: DQMFileSaverBase.h:21
edm::EventSetup
Definition: EventSetup.h:57
dqm::DQMFileSaverBase::FileParameters::tag_
std::string tag_
Definition: DQMFileSaverBase.h:37
dqm::DQMFileSaverBase::globalBeginRun
std::shared_ptr< NoCache > globalBeginRun(const edm::Run &, const edm::EventSetup &) const final
Definition: DQMFileSaverBase.cc:51
dqm::DQMFileSaverBase::globalEndRun
void globalEndRun(const edm::Run &, const edm::EventSetup &) const final
Definition: DQMFileSaverBase.cc:80
dqm::DQMFileSaverBase::FileParameters::child_
std::string child_
Definition: DQMFileSaverBase.h:40
dqm::DQMFileSaverBase::DQMFileSaverBase
DQMFileSaverBase(const edm::ParameterSet &ps)
Definition: DQMFileSaverBase.cc:28
ztail.d
d
Definition: ztail.py:151
dqm
Definition: DQMStore.h:18
dqm::DQMFileSaverBase::FileParameters::producer_
std::string producer_
Definition: DQMFileSaverBase.h:35
dqm::DQMFileSaverBase::fillDescription
static void fillDescription(edm::ParameterSetDescription &d)
Definition: DQMFileSaverBase.cc:138
edm::Event
Definition: Event.h:73
EDAnalyzer.h
edm::global::EDAnalyzer
Definition: EDAnalyzer.h:32
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37