Skip to content

Commit

Permalink
Merge pull request #28588 from schneiml/dqm-new-legacy-io
Browse files Browse the repository at this point in the history
DQM: new DQMFileSaver
  • Loading branch information
cmsbuild authored Jan 13, 2020
2 parents 4b548d6 + b3259d5 commit e3e4a3c
Show file tree
Hide file tree
Showing 13 changed files with 397 additions and 1,026 deletions.
664 changes: 106 additions & 558 deletions DQMServices/Components/plugins/DQMFileSaver.cc

Large diffs are not rendered by default.

100 changes: 0 additions & 100 deletions DQMServices/Components/plugins/DQMFileSaver.h

This file was deleted.

2 changes: 0 additions & 2 deletions DQMServices/Components/plugins/SealModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// The module providing event information
#include "DQMEventInfo.h"
DEFINE_FWK_MODULE(DQMEventInfo);
#include "DQMFileSaver.h"
DEFINE_FWK_MODULE(DQMFileSaver);
#include "DQMFEDIntegrityClient.h"
DEFINE_FWK_MODULE(DQMFEDIntegrityClient);
#include "DQMStoreStats.h"
Expand Down
19 changes: 0 additions & 19 deletions DQMServices/Core/interface/DQMStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ namespace dqm::dqmstoreimpl {
SaveReferenceTag ref = SaveWithReference,
int minStatus = dqm::qstatus::STATUS_OK,
std::string const& fileupdate = "RECREATE");
void savePB(std::string const& filename, std::string const& path = "", uint32_t run = 0, uint32_t lumi = 0);
bool open(std::string const& filename,
bool overwrite = false,
std::string const& path = "",
Expand Down Expand Up @@ -580,24 +579,6 @@ namespace dqm::dqmstoreimpl {
using MEMap = std::set<MonitorElement>;

// ------------------------ private I/O helpers ------------------------------
void saveMonitorElementToPB(MonitorElement const& me, dqmstorepb::ROOTFilePB& file);
void saveMonitorElementRangeToPB(std::string const& dir,
unsigned int run,
MEMap::const_iterator begin,
MEMap::const_iterator end,
dqmstorepb::ROOTFilePB& file,
unsigned int& counter);
void saveMonitorElementToROOT(MonitorElement const& me, TFile& file);
void saveMonitorElementRangeToROOT(std::string const& dir,
std::string const& refpath,
SaveReferenceTag ref,
int minStatus,
unsigned int run,
MEMap::const_iterator begin,
MEMap::const_iterator end,
TFile& file,
unsigned int& counter);

unsigned verbose_{1};
unsigned verboseQT_{1};
bool reset_{false};
Expand Down
32 changes: 32 additions & 0 deletions DQMServices/Core/interface/LegacyIOHelper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#ifndef DQMSERVICES_CORE_LEGACYIOHELPER_H
#define DQMSERVICES_CORE_LEGACYIOHELPER_H

#include "DQMServices/Core/interface/DQMStore.h"

// This class encapsulates the TDirectory based file format used for DQMGUI
// uploads and many other use cases.
// This should be part of `DQMFileSaver`, however since DQMServices/Components
// DQMFileSaver and DQMServices/FileIO DQMFileSaverOnline both write this
// format, the code is shared here (evnetually, these modules should become one
// again).
// This code is in DQMServices/Core to also allow the legacy DQMStore::save
// interface to use this without adding another dependency.
class LegacyIOHelper {
public:
typedef dqm::legacy::DQMStore DQMStore;
typedef dqm::legacy::MonitorElement MonitorElement;
LegacyIOHelper(DQMStore* dqmstore) : dbe_(dqmstore){};

// Replace or append to `filename`, a TDirectory ROOT file. If a run number
// is passed, the paths are rewritten to the "Run Summary" format used by
// DQMGUI. The run number does not affect which MEs are saved; this code only
// supports non-threaded mode. `fileupdate` is passed to ROOT unchanged.
// TODO: allow to select only RUN, LUMI or JOB histograms.
void save(std::string const& filename, uint32_t const run = 0, std::string const& fileupdate = "RECREATE");

private:
bool createDirectoryIfNeededAndCd(const std::string& path);
DQMStore* dbe_;
};

#endif
1 change: 1 addition & 0 deletions DQMServices/Core/interface/MonitorElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ namespace dqm::impl {
/// this ME is meant to be an efficiency plot that must not be
/// normalized when drawn in the DQM GUI.
void setEfficiencyFlag() { data_.flags |= DQMNet::DQM_PROP_EFFICIENCY_PLOT; }
bool getEfficiencyFlag() { return data_.flags & DQMNet::DQM_PROP_EFFICIENCY_PLOT; }

// A static assert to check that T actually fits in
// int64_t.
Expand Down
3 changes: 3 additions & 0 deletions DQMServices/Core/interface/QReport.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class QReport {
/// get name of quality test
const std::string &getQRName() const { return qvalue_->qtname; }

/// get quality test algorithm
const std::string &getAlgorithm() const { return qvalue_->algorithm; }

/// get vector of channels that failed test
/// (not relevant for all quality tests!)
const std::vector<DQMChannel> &getBadChannels() const { return badChannels_; }
Expand Down
Loading

0 comments on commit e3e4a3c

Please sign in to comment.