Skip to content

Commit

Permalink
Merge pull request #41752 from jfernan2/fixDQMOnlineMode130X
Browse files Browse the repository at this point in the history
[13_0_X] DQM: Online mode for DQMStore
  • Loading branch information
cmsbuild authored May 25, 2023
2 parents 3b80a3c + 999fe77 commit af3ea6f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DQM/Integration/python/config/environment_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def loadDQMRunConfigFromFile():
# now start the actual configuration
print("dqmRunConfig:", dqmRunConfig)

from DQMServices.Core.DQMStore_cfi import *
from DQMServices.Core.DQMStore_Online_cfi import *

DQM = cms.Service("DQM",
debug = cms.untracked.bool(False),
Expand Down
5 changes: 5 additions & 0 deletions DQMServices/Core/interface/DQMStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ namespace dqm {
void debugTrackME(const char* message, MonitorElement* me_local, MonitorElement* me_global) const;
// accesor to keep MEsToSave_ private
const auto& getMEsToSave() const { return MEsToSave_; }
// accesor to keep onlineMode_ private
const bool& getMode() const { return onlineMode_; }

private:
// MEComparison is a name-only comparison on MEs and Paths, allowing
Expand Down Expand Up @@ -800,6 +802,9 @@ namespace dqm {
// if non-empty, debugTrackME calls will log some information whenever a
// ME path contains this string.
std::string trackME_;

// Online mode
bool onlineMode_;
};
} // namespace implementation

Expand Down
20 changes: 20 additions & 0 deletions DQMServices/Core/python/DQMStore_Online_cfi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.nanoDQMIO_perLSoutput_cff import *

DQMStore = cms.Service("DQMStore",
verbose = cms.untracked.int32(0),
# similar to LSBasedMode but for offline. Explicitly sets LumiFLag on all
# MEs/modules that allow it (canSaveByLumi)
saveByLumi = cms.untracked.bool(False),
#Following list has no effect if saveByLumi is False
MEsToSave = cms.untracked.vstring(nanoDQMIO_perLSoutput.MEsToSave),
trackME = cms.untracked.string(""),
#Legacy code should be out. Suggested on:
#https://github.com/cms-sw/cmssw/pull/34231#issuecomment-874789622
assertLegacySafe = cms.untracked.bool(False),
# UNUSED: historical HLT configs expect this option to be present, so it
# remains here, even though the DQMStore does not use it any more.
enableMultiThread = cms.untracked.bool(True),
# Online mode
onlineMode = cms.untracked.bool(True)
)
4 changes: 3 additions & 1 deletion DQMServices/Core/python/DQMStore_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
assertLegacySafe = cms.untracked.bool(False),
# UNUSED: historical HLT configs expect this option to be present, so it
# remains here, even though the DQMStore does not use it any more.
enableMultiThread = cms.untracked.bool(True)
enableMultiThread = cms.untracked.bool(True),
# Online mode
onlineMode = cms.untracked.bool(False)
)
5 changes: 3 additions & 2 deletions DQMServices/Core/src/DQMStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace dqm::implementation {

const auto& MEs = store_->getMEsToSave();

if (not MEs.empty()) {
if (not MEs.empty() && not store_->getMode()) {
bool pathInList = false;
for (const auto& thepath : MEs) {
if (fullpath == thepath) {
Expand Down Expand Up @@ -684,7 +684,7 @@ namespace dqm::implementation {
for (std::vector<std::string>::const_iterator ipath = store_->MEsToSave_.begin();
ipath != store_->MEsToSave_.end();
++ipath) {
std::string nameToSave = *ipath;
const std::string& nameToSave = *ipath;
// option 1 (used in the past): inclusive selection
// (store all MEs that contain any of the requested patterns)
// if (name.find(nameToSave) != std::string::npos) {
Expand Down Expand Up @@ -781,6 +781,7 @@ namespace dqm::implementation {
doSaveByLumi_ = pset.getUntrackedParameter<bool>("saveByLumi", false);
MEsToSave_ = pset.getUntrackedParameter<std::vector<std::string>>("MEsToSave", std::vector<std::string>());
trackME_ = pset.getUntrackedParameter<std::string>("trackME", "");
onlineMode_ = pset.getUntrackedParameter<bool>("onlineMode", false);

// Set lumi and run for legacy booking.
// This is no more than a guess with concurrent runs/lumis, but should be
Expand Down

0 comments on commit af3ea6f

Please sign in to comment.