Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13_0_X] DQM: Online mode for DQMStore #41752

Merged
merged 2 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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