Skip to content

Commit

Permalink
Merge pull request #41400 from jfernan2/nanoDQMIOoneShot130X
Browse files Browse the repository at this point in the history
[Backport] nanoDQMIO in one shot
  • Loading branch information
cmsbuild authored Apr 29, 2023
2 parents 5e67b9d + 5053a4c commit 4bbfa3b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
3 changes: 3 additions & 0 deletions DQMServices/Core/interface/DQMStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,8 @@ namespace dqm {
void printTrace(std::string const& message);
// print a log message if ME matches trackME_.
void debugTrackME(const char* message, MonitorElement* me_local, MonitorElement* me_global) const;
// accesor to keep MEsToSave_ private
const auto& getMEsToSave() const { return MEsToSave_; }

private:
// MEComparison is a name-only comparison on MEs and Paths, allowing
Expand Down Expand Up @@ -792,6 +794,7 @@ namespace dqm {

// Book MEs by lumi by default whenever possible.
bool doSaveByLumi_;
// Book MEs by lumi from list in DQMServices/Core/python/DQMStore_cfi.py
std::vector<std::string> MEsToSave_; //just if perLS is ON

// if non-empty, debugTrackME calls will log some information whenever a
Expand Down
8 changes: 4 additions & 4 deletions DQMServices/Core/python/nanoDQMIO_perLSoutput_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@
"SiStrip/MechanicalView/MainDiagonal Position",
"SiStrip/MechanicalView/NumberOfClustersInPixel",
"SiStrip/MechanicalView/NumberOfClustersInStrip",
"Tracking/TrackParameters/GeneralProperties/Chi2oNDF_lumiFlag_GenTk",
"Tracking/TrackParameters/GeneralProperties/NumberOfRecHitsPerTrack_lumiFlag_GenTk",
"Tracking/TrackParameters/GeneralProperties/NumberOfTracks_lumiFlag_GenTk",
"Tracking/TrackParameters/generalTracks/LSanalysis/Chi2oNDF_lumiFlag_GenTk",
"Tracking/TrackParameters/generalTracks/LSanalysis/NumberOfRecHitsPerTrack_lumiFlag_GenTk",
"Tracking/TrackParameters/generalTracks/LSanalysis/NumberOfTracks_lumiFlag_GenTk",
"Tracking/TrackParameters/highPurityTracks/pt_1/GeneralProperties/SIPDxyToPV_GenTk",
"Tracking/TrackParameters/highPurityTracks/pt_1/GeneralProperties/SIPDzToPV_GenTk",
"Tracking/TrackParameters/highPurityTracks/pt_1/GeneralProperties/SIP3DToPV_GenTk",
"Tracking/TrackParameters/generalTracks/HitProperties/NumberOfMissingOuterRecHitsPerTrack_GenTk",
"Tracking/TrackParameters/generalTracks/HitProperties/NumberMORecHitsPerTrackVsPt_GenTk",
"OfflinePV/offlinePrimaryVertices/tagVtxProb",
"OfflinePV/offlinePrimaryVertice/tagType",
"OfflinePV/offlinePrimaryVertices/tagType",
"OfflinePV/Resolution/PV/pull_x",
"OfflinePV/Resolution/PV/pull_y",
"OfflinePV/Resolution/PV/pull_z",
Expand Down
23 changes: 19 additions & 4 deletions DQMServices/Core/src/DQMStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,30 @@ namespace dqm::implementation {
MonitorElementData medata;
medata.key_.path_ = path;
medata.key_.kind_ = kind;
medata.key_.scope_ = this->scope_;

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

if (not MEs.empty()) {
bool pathInList = false;
for (const auto& thepath : MEs) {
if (fullpath == thepath) {
medata.key_.scope_ = MonitorElementData::Scope::LUMI;
pathInList = true;
break;
}
}
if (not pathInList)
medata.key_.scope_ = this->scope_;
} else
medata.key_.scope_ = this->scope_;

// will be (0,0) ( = prototype) in the common case.
// This branching is for harvesting, where we have run/lumi in the booker.
if (this->scope_ == MonitorElementData::Scope::JOB) {
if (medata.key_.scope_ == MonitorElementData::Scope::JOB) {
medata.key_.id_ = edm::LuminosityBlockID();
} else if (this->scope_ == MonitorElementData::Scope::RUN) {
} else if (medata.key_.scope_ == MonitorElementData::Scope::RUN) {
medata.key_.id_ = edm::LuminosityBlockID(this->runlumi_.run(), 0);
} else if (this->scope_ == MonitorElementData::Scope::LUMI) {
} else if (medata.key_.scope_ == MonitorElementData::Scope::LUMI) {
// In the messy case of legacy-booking a LUMI ME in beginRun (or
// similar), where we don't have a valid lumi number yet, make sure to
// book a prototype instead.
Expand Down

0 comments on commit 4bbfa3b

Please sign in to comment.