From 1a6f3f4c5fba83fdc5c7a9a5d8889bd3b4e39d8a Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 1 Jul 2021 16:03:42 +0200 Subject: [PATCH 01/18] Fix averageDigiOccupancy and avgfedDigiOccvsLumi ME --- DQM/SiPixelCommon/python/SiPixelOfflineDQM_source_cff.py | 5 +++++ DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h | 1 + DQM/SiPixelMonitorDigi/python/SiPixelMonitorDigi_cfi.py | 1 + DQM/SiPixelMonitorDigi/src/SiPixelDigiSource.cc | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/DQM/SiPixelCommon/python/SiPixelOfflineDQM_source_cff.py b/DQM/SiPixelCommon/python/SiPixelOfflineDQM_source_cff.py index 671e8083d47a1..9816b631a0c11 100644 --- a/DQM/SiPixelCommon/python/SiPixelOfflineDQM_source_cff.py +++ b/DQM/SiPixelCommon/python/SiPixelOfflineDQM_source_cff.py @@ -115,6 +115,11 @@ subSystemFolder = cms.untracked.string('Pixel') ) +#Check if perLSsaving is enabled to mask MEs vs LS +from DQMServices.Core.DQMStore_cfi import DQMStore +if(DQMStore.saveByLumi): + SiPixelDigiSource.perLSsaving=True + #FED integrity from DQM.SiPixelMonitorRawData.SiPixelMonitorHLT_cfi import * diff --git a/DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h b/DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h index 99c1eb5c4f9cd..ea49aa3c67bae 100644 --- a/DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h +++ b/DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h @@ -57,6 +57,7 @@ class SiPixelDigiSource : public DQMOneEDAnalyzer("isPIB", false)), slowDown(conf_.getUntrackedParameter("slowDown", false)), modOn(conf_.getUntrackedParameter("modOn", true)), + perLSsaving(conf_.getUntrackedParameter("perLSsaving", false)), twoDimOn(conf_.getUntrackedParameter("twoDimOn", true)), twoDimModOn(conf_.getUntrackedParameter("twoDimModOn", true)), twoDimOnlyLayDisk(conf_.getUntrackedParameter("twoDimOnlyLayDisk", false)), @@ -1254,7 +1255,7 @@ void SiPixelDigiSource::bookMEs(DQMStore::IBooker& iBooker, const edm::EventSetu 0., 3200.); } - if (!modOn) { + if (!modOn && !perLSsaving) { averageDigiOccupancy = iBooker.book1D( "averageDigiOccupancy", title7, 40, -0.5, 39.5); //Book as TH1 for offline to ensure thread-safe behaviour avgfedDigiOccvsLumi = iBooker.book2D("avgfedDigiOccvsLumi", title8, 3200, 0., 3200., 40, -0.5, 39.5); From 65c73d7779a96c2dcbeba51d9012e1352feae32c Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 1 Jul 2021 16:04:06 +0200 Subject: [PATCH 02/18] Fix ES Good Channel Fraction ME --- .../python/es_dqm_source_offline_cff.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DQM/EcalPreshowerMonitorModule/python/es_dqm_source_offline_cff.py b/DQM/EcalPreshowerMonitorModule/python/es_dqm_source_offline_cff.py index 1c5f6ed5b58dc..32ecb00341484 100644 --- a/DQM/EcalPreshowerMonitorModule/python/es_dqm_source_offline_cff.py +++ b/DQM/EcalPreshowerMonitorModule/python/es_dqm_source_offline_cff.py @@ -2,7 +2,10 @@ from DQM.EcalPreshowerMonitorModule.ESRawDataTask_cfi import * from DQM.EcalPreshowerMonitorModule.ESIntegrityTask_cfi import * -ecalPreshowerIntegrityTask.DoLumiAnalysis = True +#Check if perLSsaving is enabled to mask MEs vs LS +from DQMServices.Core.DQMStore_cfi import DQMStore +if(not DQMStore.saveByLumi): + ecalPreshowerIntegrityTask.DoLumiAnalysis = True from DQM.EcalPreshowerMonitorModule.ESFEDIntegrityTask_cfi import * from DQM.EcalPreshowerMonitorModule.ESOccupancyTask_cfi import * from DQM.EcalPreshowerMonitorModule.ESTrendTask_cfi import * From 48c7fdc06b83f3c3ac3f67ab37dc306d355093e7 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 1 Jul 2021 16:04:38 +0200 Subject: [PATCH 03/18] Fix rctFedVectorMonitorLS ME --- DQM/L1TMonitor/interface/L1TdeRCT.h | 1 + DQM/L1TMonitor/python/L1TEmulatorMonitor_cff.py | 5 +++++ DQM/L1TMonitor/python/L1TdeRCT_cfi.py | 1 + DQM/L1TMonitor/src/L1TdeRCT.cc | 12 +++++++----- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/DQM/L1TMonitor/interface/L1TdeRCT.h b/DQM/L1TMonitor/interface/L1TdeRCT.h index e2ccd926122e3..b9af45675c9db 100644 --- a/DQM/L1TMonitor/interface/L1TdeRCT.h +++ b/DQM/L1TMonitor/interface/L1TdeRCT.h @@ -255,6 +255,7 @@ class L1TdeRCT : public DQMOneEDAnalyzer rctSourceEmul_rgnEmul_; edm::EDGetTokenT rctSourceEmul_emEmul_; diff --git a/DQM/L1TMonitor/python/L1TEmulatorMonitor_cff.py b/DQM/L1TMonitor/python/L1TEmulatorMonitor_cff.py index a3f334b5291c7..1612961a4ee12 100644 --- a/DQM/L1TMonitor/python/L1TEmulatorMonitor_cff.py +++ b/DQM/L1TMonitor/python/L1TEmulatorMonitor_cff.py @@ -37,6 +37,11 @@ from DQM.L1TMonitor.L1TdeStage1Layer2_cfi import * from DQM.L1TMonitor.L1TdeRCT_cfi import * +#Check if perLSsaving is enabled to mask MEs vs LS +from DQMServices.Core.DQMStore_cfi import DQMStore +if(DQMStore.saveByLumi): + l1TdeRCT.perLSsaving=True + l1TdeRCTRun1 = l1TdeRCT.clone() l1TdeRCT.rctSourceData = 'caloStage1Digis' #l1TdeRCT.gctSourceData = 'caloStage1Digis' diff --git a/DQM/L1TMonitor/python/L1TdeRCT_cfi.py b/DQM/L1TMonitor/python/L1TdeRCT_cfi.py index 4838b110b5f42..b797135a7860b 100644 --- a/DQM/L1TMonitor/python/L1TdeRCT_cfi.py +++ b/DQM/L1TMonitor/python/L1TdeRCT_cfi.py @@ -6,6 +6,7 @@ HistFolder = cms.untracked.string('L1TEMU/L1TdeRCT'), verbose = cms.untracked.bool(False), DQMStore = cms.untracked.bool(True), + perLSsaving = cms.untracked.bool(False), #driven by DQMServices/Core/python/DQMStore_cfi.py singlechannelhistos = cms.untracked.bool(False), ecalTPGData = cms.InputTag("ecalDigis","EcalTriggerPrimitives"), rctSourceEmul = cms.InputTag("valRctDigis"), diff --git a/DQM/L1TMonitor/src/L1TdeRCT.cc b/DQM/L1TMonitor/src/L1TdeRCT.cc index 63dc6eda1fa28..f8f9eaa9c71c9 100644 --- a/DQM/L1TMonitor/src/L1TdeRCT.cc +++ b/DQM/L1TMonitor/src/L1TdeRCT.cc @@ -92,6 +92,8 @@ L1TdeRCT::L1TdeRCT(const ParameterSet& ps) dataInputTagName_(ps.getParameter("rctSourceData").label()) { singlechannelhistos_ = ps.getUntrackedParameter("singlechannelhistos", false); + perLSsaving_ = (ps.getUntrackedParameter("perLSsaving", false)); + if (singlechannelhistos_) if (verbose_) std::cout << "L1TdeRCT: single channels histos ON" << std::endl; @@ -1959,18 +1961,18 @@ void L1TdeRCT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, c ibooker.setCurrentFolder(histFolder_ + "/DBData"); fedVectorMonitorRUN_ = ibooker.book2D("rctFedVectorMonitorRUN", "FED Vector Monitor Per Run", 108, 0, 108, 2, 0, 2); - fedVectorMonitorLS_ = ibooker.book2D("rctFedVectorMonitorLS", "FED Vector Monitor Per LS", 108, 0, 108, 2, 0, 2); + if(!perLSsaving_) fedVectorMonitorLS_ = ibooker.book2D("rctFedVectorMonitorLS", "FED Vector Monitor Per LS", 108, 0, 108, 2, 0, 2); for (unsigned int i = 0; i < 108; ++i) { char fed[10]; sprintf(fed, "%d", crateFED[i]); fedVectorMonitorRUN_->setBinLabel(i + 1, fed); - fedVectorMonitorLS_->setBinLabel(i + 1, fed); + if(!perLSsaving_) fedVectorMonitorLS_->setBinLabel(i + 1, fed); } fedVectorMonitorRUN_->getTH2F()->GetYaxis()->SetBinLabel(1, "OUT"); fedVectorMonitorRUN_->getTH2F()->GetYaxis()->SetBinLabel(2, "IN"); - fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(1, "OUT"); - fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(2, "IN"); + if(!perLSsaving_) {fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(1, "OUT"); + fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(2, "IN");} // for single channels @@ -2081,7 +2083,7 @@ void L1TdeRCT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, c std::shared_ptr L1TdeRCT::globalBeginLuminosityBlock(const edm::LuminosityBlock& ls, const edm::EventSetup& es) const { - readFEDVector(fedVectorMonitorLS_, es); + if(!perLSsaving_) readFEDVector(fedVectorMonitorLS_, es); return std::shared_ptr(); } From b41febc4f4fbde95a060a7f8ce591b37eaf6e833 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 1 Jul 2021 16:10:38 +0200 Subject: [PATCH 04/18] Code format --- DQM/L1TMonitor/interface/L1TdeRCT.h | 2 +- DQM/L1TMonitor/src/L1TdeRCT.cc | 15 ++++++++++----- .../interface/SiPixelDigiSource.h | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/DQM/L1TMonitor/interface/L1TdeRCT.h b/DQM/L1TMonitor/interface/L1TdeRCT.h index b9af45675c9db..c7fa09130fbf1 100644 --- a/DQM/L1TMonitor/interface/L1TdeRCT.h +++ b/DQM/L1TMonitor/interface/L1TdeRCT.h @@ -255,7 +255,7 @@ class L1TdeRCT : public DQMOneEDAnalyzer rctSourceEmul_rgnEmul_; edm::EDGetTokenT rctSourceEmul_emEmul_; diff --git a/DQM/L1TMonitor/src/L1TdeRCT.cc b/DQM/L1TMonitor/src/L1TdeRCT.cc index f8f9eaa9c71c9..6398f898fffd9 100644 --- a/DQM/L1TMonitor/src/L1TdeRCT.cc +++ b/DQM/L1TMonitor/src/L1TdeRCT.cc @@ -1961,18 +1961,22 @@ void L1TdeRCT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, c ibooker.setCurrentFolder(histFolder_ + "/DBData"); fedVectorMonitorRUN_ = ibooker.book2D("rctFedVectorMonitorRUN", "FED Vector Monitor Per Run", 108, 0, 108, 2, 0, 2); - if(!perLSsaving_) fedVectorMonitorLS_ = ibooker.book2D("rctFedVectorMonitorLS", "FED Vector Monitor Per LS", 108, 0, 108, 2, 0, 2); + if (!perLSsaving_) + fedVectorMonitorLS_ = ibooker.book2D("rctFedVectorMonitorLS", "FED Vector Monitor Per LS", 108, 0, 108, 2, 0, 2); for (unsigned int i = 0; i < 108; ++i) { char fed[10]; sprintf(fed, "%d", crateFED[i]); fedVectorMonitorRUN_->setBinLabel(i + 1, fed); - if(!perLSsaving_) fedVectorMonitorLS_->setBinLabel(i + 1, fed); + if (!perLSsaving_) + fedVectorMonitorLS_->setBinLabel(i + 1, fed); } fedVectorMonitorRUN_->getTH2F()->GetYaxis()->SetBinLabel(1, "OUT"); fedVectorMonitorRUN_->getTH2F()->GetYaxis()->SetBinLabel(2, "IN"); - if(!perLSsaving_) {fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(1, "OUT"); - fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(2, "IN");} + if (!perLSsaving_) { + fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(1, "OUT"); + fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(2, "IN"); + } // for single channels @@ -2083,7 +2087,8 @@ void L1TdeRCT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, c std::shared_ptr L1TdeRCT::globalBeginLuminosityBlock(const edm::LuminosityBlock& ls, const edm::EventSetup& es) const { - if(!perLSsaving_) readFEDVector(fedVectorMonitorLS_, es); + if (!perLSsaving_) + readFEDVector(fedVectorMonitorLS_, es); return std::shared_ptr(); } diff --git a/DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h b/DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h index ea49aa3c67bae..8afe3be8cde82 100644 --- a/DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h +++ b/DQM/SiPixelMonitorDigi/interface/SiPixelDigiSource.h @@ -57,7 +57,7 @@ class SiPixelDigiSource : public DQMOneEDAnalyzer Date: Thu, 1 Jul 2021 16:11:24 +0200 Subject: [PATCH 05/18] Disable LS plots for AlcaBeamMonitor --- DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc | 22 +++++++++++-------- DQM/BeamMonitor/plugins/AlcaBeamMonitor.h | 1 + .../python/AlcaBeamMonitorHeavyIons_cff.py | 4 +++- DQM/BeamMonitor/python/AlcaBeamMonitor_cff.py | 7 ++++++ DQM/BeamMonitor/python/AlcaBeamMonitor_cfi.py | 1 + 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc b/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc index 590e27c847323..226529d6570c8 100644 --- a/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc +++ b/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc @@ -34,6 +34,7 @@ AlcaBeamMonitor::AlcaBeamMonitor(const ParameterSet& ps) trackLabel_(consumes(ps.getUntrackedParameter("TrackLabel"))), scalerLabel_(consumes(ps.getUntrackedParameter("ScalerLabel"))), beamSpotToken_(esConsumes()), + perLSsaving_(ps.getUntrackedParameter("perLSsaving", false)), numberOfValuesToSave_(0) { if (!monitorName_.empty()) monitorName_ = monitorName_ + "/"; @@ -63,15 +64,17 @@ AlcaBeamMonitor::AlcaBeamMonitor(const ParameterSet& ps) histoByCategoryNames_.insert(pair("run", "PrimaryVertex-BeamFit")); histoByCategoryNames_.insert(pair("run", "PrimaryVertex-Scalers")); - histoByCategoryNames_.insert(pair("lumi", "Lumibased BeamSpotFit")); - histoByCategoryNames_.insert(pair("lumi", "Lumibased PrimaryVertex")); - histoByCategoryNames_.insert(pair("lumi", "Lumibased DataBase")); - histoByCategoryNames_.insert(pair("lumi", "Lumibased Scalers")); - histoByCategoryNames_.insert(pair("lumi", "Lumibased PrimaryVertex-DataBase fit")); - histoByCategoryNames_.insert(pair("lumi", "Lumibased PrimaryVertex-Scalers fit")); - histoByCategoryNames_.insert(pair("validation", "Lumibased Scalers-DataBase fit")); - histoByCategoryNames_.insert(pair("validation", "Lumibased PrimaryVertex-DataBase")); - histoByCategoryNames_.insert(pair("validation", "Lumibased PrimaryVertex-Scalers")); + if (!perLSsaving_) { + histoByCategoryNames_.insert(pair("lumi", "Lumibased BeamSpotFit")); + histoByCategoryNames_.insert(pair("lumi", "Lumibased PrimaryVertex")); + histoByCategoryNames_.insert(pair("lumi", "Lumibased DataBase")); + histoByCategoryNames_.insert(pair("lumi", "Lumibased Scalers")); + histoByCategoryNames_.insert(pair("lumi", "Lumibased PrimaryVertex-DataBase fit")); + histoByCategoryNames_.insert(pair("lumi", "Lumibased PrimaryVertex-Scalers fit")); + histoByCategoryNames_.insert(pair("validation", "Lumibased Scalers-DataBase fit")); + histoByCategoryNames_.insert(pair("validation", "Lumibased PrimaryVertex-DataBase")); + histoByCategoryNames_.insert(pair("validation", "Lumibased PrimaryVertex-Scalers")); + } for (vector::iterator itV = varNamesV_.begin(); itV != varNamesV_.end(); itV++) { for (multimap::iterator itM = histoByCategoryNames_.begin(); itM != histoByCategoryNames_.end(); @@ -88,6 +91,7 @@ void AlcaBeamMonitor::fillDescriptions(edm::ConfigurationDescriptions& iDesc) { ps.addUntracked("PrimaryVertexLabel"); ps.addUntracked("TrackLabel"); ps.addUntracked("ScalerLabel"); + ps.addUntracked("perLSsaving"); BeamFitter::fillDescription(ps); PVFitter::fillDescription(ps); diff --git a/DQM/BeamMonitor/plugins/AlcaBeamMonitor.h b/DQM/BeamMonitor/plugins/AlcaBeamMonitor.h index 241a9677ce6cf..0d708d8bcaa51 100644 --- a/DQM/BeamMonitor/plugins/AlcaBeamMonitor.h +++ b/DQM/BeamMonitor/plugins/AlcaBeamMonitor.h @@ -59,6 +59,7 @@ class AlcaBeamMonitor : public DQMOneEDAnalyzer trackLabel_; const edm::EDGetTokenT scalerLabel_; const edm::ESGetToken beamSpotToken_; + bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py //Service variables int numberOfValuesToSave_; diff --git a/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py b/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py index bb5a9f8ee19ff..1eae59f567a7a 100644 --- a/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py +++ b/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py @@ -7,7 +7,9 @@ AlcaBeamMonitor.BeamFitter.TrackCollection = 'hiGeneralTracks' AlcaBeamMonitor.BeamFitter.TrackQuality = ['highPurity'] AlcaBeamMonitor.PVFitter.VertexCollection = 'hiSelectedVertex' - +#Check if perLSsaving is enabled to mask MEs vs LS +if(DQMstore.saveByLumi): + AlcaBeamMonitor.perLSsaving=True import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi scalerBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone() alcaBeamMonitor = cms.Sequence( scalerBeamSpot*AlcaBeamMonitor ) diff --git a/DQM/BeamMonitor/python/AlcaBeamMonitor_cff.py b/DQM/BeamMonitor/python/AlcaBeamMonitor_cff.py index b4945921bdd60..565bb105604a1 100644 --- a/DQM/BeamMonitor/python/AlcaBeamMonitor_cff.py +++ b/DQM/BeamMonitor/python/AlcaBeamMonitor_cff.py @@ -1,7 +1,14 @@ import FWCore.ParameterSet.Config as cms from DQM.BeamMonitor.AlcaBeamMonitor_cfi import * +#Check if perLSsaving is enabled to mask MEs vs LS +from DQMServices.Core.DQMStore_cfi import DQMStore +if(DQMStore.saveByLumi): + AlcaBeamMonitor.perLSsaving=True + import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi scalerBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone() + alcaBeamMonitor = cms.Sequence( scalerBeamSpot*AlcaBeamMonitor ) + diff --git a/DQM/BeamMonitor/python/AlcaBeamMonitor_cfi.py b/DQM/BeamMonitor/python/AlcaBeamMonitor_cfi.py index 3e3254fc8aceb..dc2b6be303a75 100644 --- a/DQM/BeamMonitor/python/AlcaBeamMonitor_cfi.py +++ b/DQM/BeamMonitor/python/AlcaBeamMonitor_cfi.py @@ -4,6 +4,7 @@ AlcaBeamMonitor = DQMEDAnalyzer('AlcaBeamMonitor', MonitorName = cms.untracked.string('AlcaBeamMonitor'), PrimaryVertexLabel = cms.untracked.InputTag('offlinePrimaryVertices'), + perLSsaving = cms.untracked.bool(False), #driven by DQMServices/Core/python/DQMStore_cfi.py #TrackLabel = cms.untracked.InputTag('ALCARECOTkAlMinBias'), TrackLabel = cms.untracked.InputTag('generalTracks'), ScalerLabel = cms.untracked.InputTag('scalerBeamSpot'), From 7ba59bfa905b12016980db5b11b714304bc1dda5 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 1 Jul 2021 16:47:56 +0200 Subject: [PATCH 06/18] Fix ME rpstate per LS in CTPPS --- DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc index 7db4a49d9e33f..7bb613fa34e13 100644 --- a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc @@ -52,6 +52,7 @@ class CTPPSCommonDQMSource : public DQMOneEDAnalyzer> tokenRecoProtons; bool makeProtonRecoPlots_; + bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py int currentLS; int endLS; @@ -123,14 +124,14 @@ void CTPPSCommonDQMSource::GlobalPlots::Init(DQMStore::IBooker &ibooker) { 2 -> warning 3 -> ok */ - RPState = ibooker.book2D("rpstate per LS", + /* RPState = ibooker.book2D("rpstate per LS", "RP State per Lumisection;Luminosity Section;", MAX_LUMIS, 0, MAX_LUMIS, MAX_VBINS, 0., - MAX_VBINS); + MAX_VBINS);*/ { TH2F *hist = RPState->getTH2F(); hist->SetCanExtend(TH1::kAllAxes); @@ -287,7 +288,8 @@ CTPPSCommonDQMSource::CTPPSCommonDQMSource(const edm::ParameterSet &ps) ctppsRecordToken(consumes(ps.getUntrackedParameter("ctppsmetadata"))), tokenLocalTrackLite(consumes>(ps.getParameter("tagLocalTrackLite"))), tokenRecoProtons(consumes>(ps.getParameter("tagRecoProtons"))), - makeProtonRecoPlots_(ps.getParameter("makeProtonRecoPlots")) { + makeProtonRecoPlots_(ps.getParameter("makeProtonRecoPlots")), + perLSsaving_(ps.getUntrackedParameter("perLSsaving", false)) { currentLS = 0; endLS = 0; rpstate.clear(); @@ -545,8 +547,10 @@ std::shared_ptr> CTPPSCommonDQMSource::globalBeginLuminosityBlo void CTPPSCommonDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &c) { auto const &rpstate = *luminosityBlockCache(iLumi.index()); auto currentLS = iLumi.id().luminosityBlock(); - for (std::vector::size_type i = 0; i < rpstate.size(); i++) - globalPlots.RPState->setBinContent(currentLS, i + 1, rpstate[i]); + if (!perLSsaving_) { + for (std::vector::size_type i = 0; i < rpstate.size(); i++) + globalPlots.RPState->setBinContent(currentLS, i + 1, rpstate[i]); + } } //---------------------------------------------------------------------------------------------------- From 8e6cb0f0f32af46fa7b578692d35a66f8197f946 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 1 Jul 2021 16:48:39 +0200 Subject: [PATCH 07/18] Fix ME hits in planes lumisection in CTPPS and TOTEM --- DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc | 18 +++++++++++------- DQM/CTPPS/plugins/TotemTimingDQMSource.cc | 21 ++++++++++++++------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc index 82b4cd6406803..5f5f7dda8af8a 100644 --- a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc @@ -107,6 +107,7 @@ class CTPPSDiamondDQMSource : public DQMOneEDAnalyzer ctppsGeometryEventToken_; bool excludeMultipleHits_; + bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py double horizontalShiftBwDiamondPixels_; double horizontalShiftOfDiamond_; std::vector> runParameters_; @@ -257,14 +258,14 @@ CTPPSDiamondDQMSource::PotPlots::PotPlots(DQMStore::IBooker& ibooker, unsigned i 19. * INV_DISPLAY_RESOLUTION_FOR_HITS_MM, -0.5, 18.5); - hitDistribution2d_lumisection = ibooker.book2D("hits in planes lumisection", + /* hitDistribution2d_lumisection = ibooker.book2D("hits in planes lumisection", title + " hits in planes in the last lumisection;plane number;x (mm)", 10, -0.5, 4.5, 19. * INV_DISPLAY_RESOLUTION_FOR_HITS_MM, -0.5, - 18.5); + 18.5);*/ hitDistribution2dOOT = ibooker.book2D("hits with OOT in planes", title + " hits with OOT in planes;plane number + 0.25 OOT;x (mm)", 17, @@ -486,6 +487,7 @@ CTPPSDiamondDQMSource::CTPPSDiamondDQMSource(const edm::ParameterSet& ps) ctppsGeometryRunToken_(esConsumes()), ctppsGeometryEventToken_(esConsumes()), excludeMultipleHits_(ps.getParameter("excludeMultipleHits")), + perLSsaving_(ps.getUntrackedParameter("perLSsaving", false)), centralOOT_(-999), verbosity_(ps.getUntrackedParameter("verbosity", 0)), EC_difference_56_(-500), @@ -554,9 +556,9 @@ std::shared_ptr CTPPSDiamondDQMSource::globalBeginLuminosityBlock(co const edm::EventSetup&) const { auto d = std::make_shared(); d->hitDistribution2dMap.reserve(potPlots_.size()); - for (auto& plot : potPlots_) - d->hitDistribution2dMap[plot.first] = - std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); + // for (auto& plot : potPlots_) + // d->hitDistribution2dMap[plot.first] = + // std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); return d; } @@ -1129,8 +1131,10 @@ void CTPPSDiamondDQMSource::analyze(const edm::Event& event, const edm::EventSet void CTPPSDiamondDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock& iLumi, const edm::EventSetup&) { auto lumiCache = luminosityBlockCache(iLumi.index()); - for (auto& plot : potPlots_) { - *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); + if (!perLSsaving_) { + for (auto& plot : potPlots_) { + *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); + } } for (auto& plot : channelPlots_) { auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first]; diff --git a/DQM/CTPPS/plugins/TotemTimingDQMSource.cc b/DQM/CTPPS/plugins/TotemTimingDQMSource.cc index a36b800878f0d..359ab0d6da281 100644 --- a/DQM/CTPPS/plugins/TotemTimingDQMSource.cc +++ b/DQM/CTPPS/plugins/TotemTimingDQMSource.cc @@ -104,6 +104,7 @@ class TotemTimingDQMSource : public DQMOneEDAnalyzer("minimumStripAngleForTomography")), maximumStripAngleForTomography_(ps.getParameter("maximumStripAngleForTomography")), samplesForNoise_(ps.getUntrackedParameter("samplesForNoise", 5)), + perLSsaving_(ps.getUntrackedParameter("perLSsaving", false)), verbosity_(ps.getUntrackedParameter("verbosity", 0)), timeOfPreviousEvent_(0) {} @@ -472,9 +474,11 @@ std::shared_ptr TotemTimingDQMSource::globalBeginLuminosityBlock const edm::EventSetup &) const { auto d = std::make_shared(); d->hitDistribution2dMap.reserve(potPlots_.size()); - for (auto &plot : potPlots_) - d->hitDistribution2dMap[plot.first] = - std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); + if (!perLSsaving_) { + for (auto &plot : potPlots_) + d->hitDistribution2dMap[plot.first] = + std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); + } return d; } @@ -607,8 +611,9 @@ void TotemTimingDQMSource::analyze(const edm::Event &event, const edm::EventSetu for (int i = 0; i < numOfBins; ++i) { potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + 0.25 * (rechit.x() > 2), hitHistoTmpYAxis->GetBinCenter(startBin + i)); - potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(x_shift, - hitHistoTmpYAxis->GetBinCenter(startBin + i)); + if (!perLSsaving_) + potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(x_shift, + hitHistoTmpYAxis->GetBinCenter(startBin + i)); } //All plots with Time @@ -735,8 +740,10 @@ void TotemTimingDQMSource::analyze(const edm::Event &event, const edm::EventSetu void TotemTimingDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &) { auto lumiCache = luminosityBlockCache(iLumi.index()); - for (auto &plot : potPlots_) { - *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); + if (!perLSsaving_) { + for (auto &plot : potPlots_) { + *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); + } } globalPlot_.digiSentPercentage->Reset(); From d18bca2577be1cb6a534d9cdf490f810b0af7362 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 1 Jul 2021 18:32:22 +0200 Subject: [PATCH 08/18] Disable Coordinate and PrimaryVertex fit-DataBase in AlcaBeamMonitor --- DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc b/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc index 226529d6570c8..292f81cc19c62 100644 --- a/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc +++ b/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc @@ -56,8 +56,10 @@ AlcaBeamMonitor::AlcaBeamMonitor(const ParameterSet& ps) varNamesV_.push_back("sigmaY"); varNamesV_.push_back("sigmaZ"); + if (!perLSsaving_){ histoByCategoryNames_.insert(pair("run", "Coordinate")); histoByCategoryNames_.insert(pair("run", "PrimaryVertex fit-DataBase")); + } histoByCategoryNames_.insert(pair("run", "PrimaryVertex fit-BeamFit")); histoByCategoryNames_.insert(pair("run", "PrimaryVertex fit-Scalers")); histoByCategoryNames_.insert(pair("run", "PrimaryVertex-DataBase")); From 88385dd5a4f70bb26bfdf23ff0e1bd8f12dda907 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 1 Jul 2021 18:33:17 +0200 Subject: [PATCH 09/18] Disable vs LS plots in CTPPS&TOTEM --- DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc | 4 ++-- DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc | 14 +++++++------- DQM/CTPPS/plugins/TotemTimingDQMSource.cc | 8 ++++---- DQM/CTPPS/python/ctppsCommonDQMSource_cfi.py | 2 ++ DQM/CTPPS/python/ctppsDQM_cff.py | 7 +++++++ DQM/CTPPS/python/ctppsDiamondDQMSource_cfi.py | 2 ++ DQM/CTPPS/python/totemTimingDQMSource_cfi.py | 4 +++- 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc index 7bb613fa34e13..0f101a61d38de 100644 --- a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc @@ -124,14 +124,14 @@ void CTPPSCommonDQMSource::GlobalPlots::Init(DQMStore::IBooker &ibooker) { 2 -> warning 3 -> ok */ - /* RPState = ibooker.book2D("rpstate per LS", + RPState = ibooker.book2D("rpstate per LS", "RP State per Lumisection;Luminosity Section;", MAX_LUMIS, 0, MAX_LUMIS, MAX_VBINS, 0., - MAX_VBINS);*/ + MAX_VBINS); { TH2F *hist = RPState->getTH2F(); hist->SetCanExtend(TH1::kAllAxes); diff --git a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc index 5f5f7dda8af8a..36d635827b003 100644 --- a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc @@ -258,14 +258,14 @@ CTPPSDiamondDQMSource::PotPlots::PotPlots(DQMStore::IBooker& ibooker, unsigned i 19. * INV_DISPLAY_RESOLUTION_FOR_HITS_MM, -0.5, 18.5); - /* hitDistribution2d_lumisection = ibooker.book2D("hits in planes lumisection", + hitDistribution2d_lumisection = ibooker.book2D("hits in planes lumisection", title + " hits in planes in the last lumisection;plane number;x (mm)", 10, -0.5, 4.5, 19. * INV_DISPLAY_RESOLUTION_FOR_HITS_MM, -0.5, - 18.5);*/ + 18.5); hitDistribution2dOOT = ibooker.book2D("hits with OOT in planes", title + " hits with OOT in planes;plane number + 0.25 OOT;x (mm)", 17, @@ -556,9 +556,9 @@ std::shared_ptr CTPPSDiamondDQMSource::globalBeginLuminosityBlock(co const edm::EventSetup&) const { auto d = std::make_shared(); d->hitDistribution2dMap.reserve(potPlots_.size()); - // for (auto& plot : potPlots_) - // d->hitDistribution2dMap[plot.first] = - // std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); + for (auto& plot : potPlots_) + d->hitDistribution2dMap[plot.first] = + std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); return d; } @@ -1135,7 +1135,7 @@ void CTPPSDiamondDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock& for (auto& plot : potPlots_) { *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); } - } + for (auto& plot : channelPlots_) { auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first]; if (hitsCounterPerLumisection != 0) { @@ -1171,7 +1171,6 @@ void CTPPSDiamondDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock& } } } - // Efficiencies of single channels for (auto& plot : potPlots_) { plot.second.EfficiencyOfChannelsInPot->Reset(); @@ -1198,6 +1197,7 @@ void CTPPSDiamondDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock& hitHistoTmp->Divide(&(plot.second.pixelTracksMapWithDiamonds), &(potPlots_[detId_pot].pixelTracksMap)); } + }//perLSsaving } //---------------------------------------------------------------------------------------------------- diff --git a/DQM/CTPPS/plugins/TotemTimingDQMSource.cc b/DQM/CTPPS/plugins/TotemTimingDQMSource.cc index 359ab0d6da281..aa35b4e4be49d 100644 --- a/DQM/CTPPS/plugins/TotemTimingDQMSource.cc +++ b/DQM/CTPPS/plugins/TotemTimingDQMSource.cc @@ -741,10 +741,9 @@ void TotemTimingDQMSource::analyze(const edm::Event &event, const edm::EventSetu void TotemTimingDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &) { auto lumiCache = luminosityBlockCache(iLumi.index()); if (!perLSsaving_) { - for (auto &plot : potPlots_) { - *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); - } - } + for (auto &plot : potPlots_) { + *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); + } globalPlot_.digiSentPercentage->Reset(); TH2F *hitHistoGlobalTmp = globalPlot_.digiSentPercentage->getTH2F(); @@ -782,6 +781,7 @@ void TotemTimingDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock & plot.second.hitRate->Fill((double)hitsCounterPerLumisection * HIT_RATE_FACTOR); } } + } } DEFINE_FWK_MODULE(TotemTimingDQMSource); diff --git a/DQM/CTPPS/python/ctppsCommonDQMSource_cfi.py b/DQM/CTPPS/python/ctppsCommonDQMSource_cfi.py index fa4fc95c65773..d05e70d2d807b 100644 --- a/DQM/CTPPS/python/ctppsCommonDQMSource_cfi.py +++ b/DQM/CTPPS/python/ctppsCommonDQMSource_cfi.py @@ -9,5 +9,7 @@ makeProtonRecoPlots = cms.bool(True), + perLSsaving = cms.untracked.bool(False), #driven by DQMServices/Core/python/DQMStore_cfi.py + verbosity = cms.untracked.uint32(0), ) diff --git a/DQM/CTPPS/python/ctppsDQM_cff.py b/DQM/CTPPS/python/ctppsDQM_cff.py index 64ecae982a47a..a5ce31e654d9f 100644 --- a/DQM/CTPPS/python/ctppsDQM_cff.py +++ b/DQM/CTPPS/python/ctppsDQM_cff.py @@ -49,6 +49,13 @@ makeProtonRecoPlots = True ) +#Check if perLSsaving is enabled to mask MEs vs LS +from DQMServices.Core.DQMStore_cfi import DQMStore +if(DQMStore.saveByLumi): + ctppsDiamondDQMSource.perLSsaving=True + totemTimingDQMSource.perLSsaving=True + ctppsCommonDQMSourceOffline.perLSsaving=True + _ctppsDQMOfflineSource = cms.Sequence( ctppsPixelDQMOfflineSource + ctppsDiamondDQMSource diff --git a/DQM/CTPPS/python/ctppsDiamondDQMSource_cfi.py b/DQM/CTPPS/python/ctppsDiamondDQMSource_cfi.py index 989fbcc29a307..7611902ba1a6c 100644 --- a/DQM/CTPPS/python/ctppsDiamondDQMSource_cfi.py +++ b/DQM/CTPPS/python/ctppsDiamondDQMSource_cfi.py @@ -33,6 +33,8 @@ centralOOT = cms.int32(0), ), ), + + perLSsaving = cms.untracked.bool(False), #driven by DQMServices/Core/python/DQMStore_cfi.py verbosity = cms.untracked.uint32(10), ) diff --git a/DQM/CTPPS/python/totemTimingDQMSource_cfi.py b/DQM/CTPPS/python/totemTimingDQMSource_cfi.py index 9df4f5bd33797..cc6bc9876d62d 100644 --- a/DQM/CTPPS/python/totemTimingDQMSource_cfi.py +++ b/DQM/CTPPS/python/totemTimingDQMSource_cfi.py @@ -12,5 +12,7 @@ maximumStripAngleForTomography = cms.double(1), samplesForNoise = cms.untracked.uint32(6), + perLSsaving = cms.untracked.bool(False), #driven by DQMServices/Core/python/DQMStore_cfi.py + verbosity = cms.untracked.uint32(10), -) \ No newline at end of file +) From bee325643c00614f952734ceb33e191c7328b532 Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 1 Jul 2021 18:49:19 +0200 Subject: [PATCH 10/18] Code format --- DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc | 18 ++-- DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc | 2 +- DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc | 111 +++++++++++---------- DQM/CTPPS/plugins/TotemTimingDQMSource.cc | 72 ++++++------- 4 files changed, 101 insertions(+), 102 deletions(-) diff --git a/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc b/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc index 292f81cc19c62..f77a33549e63e 100644 --- a/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc +++ b/DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc @@ -56,17 +56,15 @@ AlcaBeamMonitor::AlcaBeamMonitor(const ParameterSet& ps) varNamesV_.push_back("sigmaY"); varNamesV_.push_back("sigmaZ"); - if (!perLSsaving_){ - histoByCategoryNames_.insert(pair("run", "Coordinate")); - histoByCategoryNames_.insert(pair("run", "PrimaryVertex fit-DataBase")); - } - histoByCategoryNames_.insert(pair("run", "PrimaryVertex fit-BeamFit")); - histoByCategoryNames_.insert(pair("run", "PrimaryVertex fit-Scalers")); - histoByCategoryNames_.insert(pair("run", "PrimaryVertex-DataBase")); - histoByCategoryNames_.insert(pair("run", "PrimaryVertex-BeamFit")); - histoByCategoryNames_.insert(pair("run", "PrimaryVertex-Scalers")); - if (!perLSsaving_) { + histoByCategoryNames_.insert(pair("run", "Coordinate")); + histoByCategoryNames_.insert(pair("run", "PrimaryVertex fit-DataBase")); + histoByCategoryNames_.insert(pair("run", "PrimaryVertex fit-BeamFit")); + histoByCategoryNames_.insert(pair("run", "PrimaryVertex fit-Scalers")); + histoByCategoryNames_.insert(pair("run", "PrimaryVertex-DataBase")); + histoByCategoryNames_.insert(pair("run", "PrimaryVertex-BeamFit")); + histoByCategoryNames_.insert(pair("run", "PrimaryVertex-Scalers")); + histoByCategoryNames_.insert(pair("lumi", "Lumibased BeamSpotFit")); histoByCategoryNames_.insert(pair("lumi", "Lumibased PrimaryVertex")); histoByCategoryNames_.insert(pair("lumi", "Lumibased DataBase")); diff --git a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc index 0f101a61d38de..a281905ce3ce9 100644 --- a/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSCommonDQMSource.cc @@ -124,7 +124,7 @@ void CTPPSCommonDQMSource::GlobalPlots::Init(DQMStore::IBooker &ibooker) { 2 -> warning 3 -> ok */ - RPState = ibooker.book2D("rpstate per LS", + RPState = ibooker.book2D("rpstate per LS", "RP State per Lumisection;Luminosity Section;", MAX_LUMIS, 0, diff --git a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc index 36d635827b003..8edd4c2637f31 100644 --- a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc @@ -558,7 +558,7 @@ std::shared_ptr CTPPSDiamondDQMSource::globalBeginLuminosityBlock(co d->hitDistribution2dMap.reserve(potPlots_.size()); for (auto& plot : potPlots_) d->hitDistribution2dMap[plot.first] = - std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); + std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); return d; } @@ -1135,69 +1135,70 @@ void CTPPSDiamondDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock& for (auto& plot : potPlots_) { *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); } - - for (auto& plot : channelPlots_) { - auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first]; - if (hitsCounterPerLumisection != 0) { - plot.second.hit_rate->Fill((double)hitsCounterPerLumisection / SEC_PER_LUMI_SECTION); - } - double HundredOverHitCounter = .0; - if (plot.second.HitCounter != 0) - HundredOverHitCounter = 100. / plot.second.HitCounter; - plot.second.HPTDCErrorFlags->setBinContent(16, HundredOverHitCounter * plot.second.MHCounter); - plot.second.leadingWithoutTrailing->setBinContent(1, HundredOverHitCounter * plot.second.LeadingOnlyCounter); - plot.second.leadingWithoutTrailing->setBinContent(2, HundredOverHitCounter * plot.second.TrailingOnlyCounter); - plot.second.leadingWithoutTrailing->setBinContent(3, HundredOverHitCounter * plot.second.CompleteCounter); - } + for (auto& plot : channelPlots_) { + auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first]; + if (hitsCounterPerLumisection != 0) { + plot.second.hit_rate->Fill((double)hitsCounterPerLumisection / SEC_PER_LUMI_SECTION); + } + + double HundredOverHitCounter = .0; + if (plot.second.HitCounter != 0) + HundredOverHitCounter = 100. / plot.second.HitCounter; + plot.second.HPTDCErrorFlags->setBinContent(16, HundredOverHitCounter * plot.second.MHCounter); + plot.second.leadingWithoutTrailing->setBinContent(1, HundredOverHitCounter * plot.second.LeadingOnlyCounter); + plot.second.leadingWithoutTrailing->setBinContent(2, HundredOverHitCounter * plot.second.TrailingOnlyCounter); + plot.second.leadingWithoutTrailing->setBinContent(3, HundredOverHitCounter * plot.second.CompleteCounter); + } - for (auto& plot : potPlots_) { - double HundredOverHitCounterPot = 0.; - if (plot.second.HitCounter != 0) - HundredOverHitCounterPot = 100. / plot.second.HitCounter; - plot.second.leadingWithoutTrailingCumulativePot->setBinContent( - 1, HundredOverHitCounterPot * plot.second.LeadingOnlyCounter); - plot.second.leadingWithoutTrailingCumulativePot->setBinContent( - 2, HundredOverHitCounterPot * plot.second.TrailingOnlyCounter); - plot.second.leadingWithoutTrailingCumulativePot->setBinContent( - 3, HundredOverHitCounterPot * plot.second.CompleteCounter); - - plot.second.MHComprensive->Reset(); - CTPPSDiamondDetId rpId(plot.first); - for (auto& chPlot : channelPlots_) { - CTPPSDiamondDetId chId(chPlot.first); - if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) { - plot.second.MHComprensive->Fill(chId.plane(), chId.channel(), chPlot.second.HPTDCErrorFlags->getBinContent(16)); + for (auto& plot : potPlots_) { + double HundredOverHitCounterPot = 0.; + if (plot.second.HitCounter != 0) + HundredOverHitCounterPot = 100. / plot.second.HitCounter; + plot.second.leadingWithoutTrailingCumulativePot->setBinContent( + 1, HundredOverHitCounterPot * plot.second.LeadingOnlyCounter); + plot.second.leadingWithoutTrailingCumulativePot->setBinContent( + 2, HundredOverHitCounterPot * plot.second.TrailingOnlyCounter); + plot.second.leadingWithoutTrailingCumulativePot->setBinContent( + 3, HundredOverHitCounterPot * plot.second.CompleteCounter); + + plot.second.MHComprensive->Reset(); + CTPPSDiamondDetId rpId(plot.first); + for (auto& chPlot : channelPlots_) { + CTPPSDiamondDetId chId(chPlot.first); + if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) { + plot.second.MHComprensive->Fill( + chId.plane(), chId.channel(), chPlot.second.HPTDCErrorFlags->getBinContent(16)); + } } } - } - // Efficiencies of single channels - for (auto& plot : potPlots_) { - plot.second.EfficiencyOfChannelsInPot->Reset(); - for (auto& element : plot.second.effTriplecountingChMap) { - if (plot.second.effDoublecountingChMap[element.first] > 0) { - int plane = element.first / 100; - int channel = element.first % 100; - double counted = element.second; - double total = plot.second.effDoublecountingChMap[element.first]; - double efficiency = counted / total; - // double error = std::sqrt( efficiency * ( 1 - efficiency ) / total ); - - plot.second.EfficiencyOfChannelsInPot->Fill(plane, channel, 100 * efficiency); + // Efficiencies of single channels + for (auto& plot : potPlots_) { + plot.second.EfficiencyOfChannelsInPot->Reset(); + for (auto& element : plot.second.effTriplecountingChMap) { + if (plot.second.effDoublecountingChMap[element.first] > 0) { + int plane = element.first / 100; + int channel = element.first % 100; + double counted = element.second; + double total = plot.second.effDoublecountingChMap[element.first]; + double efficiency = counted / total; + // double error = std::sqrt( efficiency * ( 1 - efficiency ) / total ); + + plot.second.EfficiencyOfChannelsInPot->Fill(plane, channel, 100 * efficiency); + } } } - } - // Efficeincy wrt pixels //TODO - for (auto& plot : planePlots_) { - TH2F* hitHistoTmp = plot.second.EfficiencyWRTPixelsInPlane->getTH2F(); + // Efficeincy wrt pixels //TODO + for (auto& plot : planePlots_) { + TH2F* hitHistoTmp = plot.second.EfficiencyWRTPixelsInPlane->getTH2F(); - CTPPSDiamondDetId detId_pot(plot.first); - detId_pot.setPlane(0); + CTPPSDiamondDetId detId_pot(plot.first); + detId_pot.setPlane(0); - hitHistoTmp->Divide(&(plot.second.pixelTracksMapWithDiamonds), &(potPlots_[detId_pot].pixelTracksMap)); - } - }//perLSsaving + hitHistoTmp->Divide(&(plot.second.pixelTracksMapWithDiamonds), &(potPlots_[detId_pot].pixelTracksMap)); + } + } //perLSsaving } //---------------------------------------------------------------------------------------------------- diff --git a/DQM/CTPPS/plugins/TotemTimingDQMSource.cc b/DQM/CTPPS/plugins/TotemTimingDQMSource.cc index aa35b4e4be49d..2d618b48e01d2 100644 --- a/DQM/CTPPS/plugins/TotemTimingDQMSource.cc +++ b/DQM/CTPPS/plugins/TotemTimingDQMSource.cc @@ -741,47 +741,47 @@ void TotemTimingDQMSource::analyze(const edm::Event &event, const edm::EventSetu void TotemTimingDQMSource::globalEndLuminosityBlock(const edm::LuminosityBlock &iLumi, const edm::EventSetup &) { auto lumiCache = luminosityBlockCache(iLumi.index()); if (!perLSsaving_) { - for (auto &plot : potPlots_) { - *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); - } - - globalPlot_.digiSentPercentage->Reset(); - TH2F *hitHistoGlobalTmp = globalPlot_.digiSentPercentage->getTH2F(); - for (auto &plot : potPlots_) { - TH2F *hitHistoTmp = plot.second.digiSentPercentage->getTH2F(); - TH2F *histoSent = plot.second.digiSent->getTH2F(); - TH2F *histoAll = plot.second.digiAll->getTH2F(); - - hitHistoTmp->Divide(histoSent, histoAll); - hitHistoTmp->Scale(100); - hitHistoGlobalTmp->Add(hitHistoTmp, 1); - - plot.second.baseline->Reset(); - plot.second.noiseRMS->Reset(); - plot.second.meanAmplitude->Reset(); - plot.second.cellOfMax->Reset(); - plot.second.hitRate->Reset(); - TotemTimingDetId rpId(plot.first); - for (auto &chPlot : channelPlots_) { - TotemTimingDetId chId(chPlot.first); - if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) { - plot.second.baseline->Fill(chId.plane(), chId.channel(), chPlot.second.noiseSamples->getTH1F()->GetMean()); - plot.second.noiseRMS->Fill(chId.plane(), chId.channel(), chPlot.second.noiseSamples->getTH1F()->GetRMS()); - plot.second.meanAmplitude->Fill(chId.plane(), chId.channel(), chPlot.second.amplitude->getTH1F()->GetMean()); - plot.second.cellOfMax->Fill(chId.plane(), chId.channel(), chPlot.second.cellOfMax->getTH1F()->GetMean()); - auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[chPlot.first]; - plot.second.hitRate->Fill(chId.plane(), chId.channel(), (double)hitsCounterPerLumisection * HIT_RATE_FACTOR); + for (auto &plot : potPlots_) { + *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]); + } + + globalPlot_.digiSentPercentage->Reset(); + TH2F *hitHistoGlobalTmp = globalPlot_.digiSentPercentage->getTH2F(); + for (auto &plot : potPlots_) { + TH2F *hitHistoTmp = plot.second.digiSentPercentage->getTH2F(); + TH2F *histoSent = plot.second.digiSent->getTH2F(); + TH2F *histoAll = plot.second.digiAll->getTH2F(); + + hitHistoTmp->Divide(histoSent, histoAll); + hitHistoTmp->Scale(100); + hitHistoGlobalTmp->Add(hitHistoTmp, 1); + + plot.second.baseline->Reset(); + plot.second.noiseRMS->Reset(); + plot.second.meanAmplitude->Reset(); + plot.second.cellOfMax->Reset(); + plot.second.hitRate->Reset(); + TotemTimingDetId rpId(plot.first); + for (auto &chPlot : channelPlots_) { + TotemTimingDetId chId(chPlot.first); + if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) { + plot.second.baseline->Fill(chId.plane(), chId.channel(), chPlot.second.noiseSamples->getTH1F()->GetMean()); + plot.second.noiseRMS->Fill(chId.plane(), chId.channel(), chPlot.second.noiseSamples->getTH1F()->GetRMS()); + plot.second.meanAmplitude->Fill(chId.plane(), chId.channel(), chPlot.second.amplitude->getTH1F()->GetMean()); + plot.second.cellOfMax->Fill(chId.plane(), chId.channel(), chPlot.second.cellOfMax->getTH1F()->GetMean()); + auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[chPlot.first]; + plot.second.hitRate->Fill(chId.plane(), chId.channel(), (double)hitsCounterPerLumisection * HIT_RATE_FACTOR); + } } } - } - for (auto &plot : channelPlots_) { - auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first]; - if (hitsCounterPerLumisection != 0) { - plot.second.hitRate->Fill((double)hitsCounterPerLumisection * HIT_RATE_FACTOR); + for (auto &plot : channelPlots_) { + auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first]; + if (hitsCounterPerLumisection != 0) { + plot.second.hitRate->Fill((double)hitsCounterPerLumisection * HIT_RATE_FACTOR); + } } } - } } DEFINE_FWK_MODULE(TotemTimingDQMSource); From d0960d3e253d2b659235abaf94e9e94355223ad3 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 2 Jul 2021 17:02:52 +0200 Subject: [PATCH 11/18] Last fixes on CTPPS --- DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc index 8edd4c2637f31..061ad366fa586 100644 --- a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc @@ -556,9 +556,11 @@ std::shared_ptr CTPPSDiamondDQMSource::globalBeginLuminosityBlock(co const edm::EventSetup&) const { auto d = std::make_shared(); d->hitDistribution2dMap.reserve(potPlots_.size()); + if(!perLSsaving_){ for (auto& plot : potPlots_) d->hitDistribution2dMap[plot.first] = std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); + } return d; } @@ -749,6 +751,7 @@ void CTPPSDiamondDQMSource::analyze(const edm::Event& event, const edm::EventSet hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin + i)); } + if(!perLSsaving_){ hitHistoTmp = lumiCache->hitDistribution2dMap[detId_pot].get(); hitHistoTmpYAxis = hitHistoTmp->GetYaxis(); startBin = hitHistoTmpYAxis->FindBin(rechit.x() - horizontalShiftOfDiamond_ - 0.5 * rechit.xWidth()); @@ -756,6 +759,7 @@ void CTPPSDiamondDQMSource::analyze(const edm::Event& event, const edm::EventSet for (int i = 0; i < numOfBins; ++i) { hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin + i)); } + } } if (rechit.toT() != 0) { From 91431fa769564c64cf4778e7534eb3583c7600ff Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 2 Jul 2021 17:38:30 +0200 Subject: [PATCH 12/18] Code format --- DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc index 061ad366fa586..adba4530d145e 100644 --- a/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc +++ b/DQM/CTPPS/plugins/CTPPSDiamondDQMSource.cc @@ -556,10 +556,10 @@ std::shared_ptr CTPPSDiamondDQMSource::globalBeginLuminosityBlock(co const edm::EventSetup&) const { auto d = std::make_shared(); d->hitDistribution2dMap.reserve(potPlots_.size()); - if(!perLSsaving_){ - for (auto& plot : potPlots_) - d->hitDistribution2dMap[plot.first] = - std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); + if (!perLSsaving_) { + for (auto& plot : potPlots_) + d->hitDistribution2dMap[plot.first] = + std::unique_ptr(static_cast(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone())); } return d; } @@ -751,14 +751,14 @@ void CTPPSDiamondDQMSource::analyze(const edm::Event& event, const edm::EventSet hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin + i)); } - if(!perLSsaving_){ - hitHistoTmp = lumiCache->hitDistribution2dMap[detId_pot].get(); - hitHistoTmpYAxis = hitHistoTmp->GetYaxis(); - startBin = hitHistoTmpYAxis->FindBin(rechit.x() - horizontalShiftOfDiamond_ - 0.5 * rechit.xWidth()); - numOfBins = rechit.xWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM; - for (int i = 0; i < numOfBins; ++i) { - hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin + i)); - } + if (!perLSsaving_) { + hitHistoTmp = lumiCache->hitDistribution2dMap[detId_pot].get(); + hitHistoTmpYAxis = hitHistoTmp->GetYaxis(); + startBin = hitHistoTmpYAxis->FindBin(rechit.x() - horizontalShiftOfDiamond_ - 0.5 * rechit.xWidth()); + numOfBins = rechit.xWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM; + for (int i = 0; i < numOfBins; ++i) { + hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin + i)); + } } } From f0d911d4c1703923ab3f01efb6bed01fffce2f66 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 2 Jul 2021 17:39:08 +0200 Subject: [PATCH 13/18] Fixes to trigvsnvtx ME in HigPhotonJetHLTOfflineSource --- .../plugins/HigPhotonJetHLTOfflineSource.cc | 18 +++++++++++------- .../Trigger/python/DQMOffline_Trigger_cff.py | 5 ++++- .../python/HigPhotonJetHLTOfflineSource_cfi.py | 1 + 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/DQMOffline/Trigger/plugins/HigPhotonJetHLTOfflineSource.cc b/DQMOffline/Trigger/plugins/HigPhotonJetHLTOfflineSource.cc index 533c737e6e587..f9d5608d0c7b6 100644 --- a/DQMOffline/Trigger/plugins/HigPhotonJetHLTOfflineSource.cc +++ b/DQMOffline/Trigger/plugins/HigPhotonJetHLTOfflineSource.cc @@ -61,6 +61,7 @@ class HigPhotonJetHLTOfflineSource : public DQMOneEDAnalyzer<> { std::string dirname_; bool verbose_; bool triggerAccept_; + bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py edm::EDGetTokenT triggerResultsToken_; edm::EDGetTokenT pvToken_; @@ -109,6 +110,7 @@ HigPhotonJetHLTOfflineSource::HigPhotonJetHLTOfflineSource(const edm::ParameterS hltProcessName_ = pset.getParameter("hltProcessName"); hltPathsToCheck_ = pset.getParameter>("hltPathsToCheck"); verbose_ = pset.getUntrackedParameter("verbose", false); + perLSsaving_ = pset.getUntrackedParameter("perLSsaving", false); triggerAccept_ = pset.getUntrackedParameter("triggerAccept", true); triggerResultsToken_ = consumes(pset.getParameter("triggerResultsToken")); dirname_ = pset.getUntrackedParameter("dirname", std::string("HLT/Higgs/PhotonJet/")); @@ -327,13 +329,15 @@ void HigPhotonJetHLTOfflineSource::analyze(const edm::Event& iEvent, const edm:: void HigPhotonJetHLTOfflineSource::dqmEndRun(const edm::Run& iRun, const edm::EventSetup& iSetup) { // Normalize to the total number of events in the run - TH2F* h = trigvsnvtx_->getTH2F(); - double integral = h->Integral(); - double norm = (integral > 0.) ? evtsrun_ * hltPathsToCheck_.size() / integral : 1.; - h->Scale(norm); - if (verbose_) { - std::cout << "xshi:: endRun total number of events: " << evtsrun_ << ", integral = " << h->Integral() - << ", norm = " << norm << std::endl; + if (!perLSsaving_) { + TH2F* h = trigvsnvtx_->getTH2F(); + double integral = h->Integral(); + double norm = (integral > 0.) ? evtsrun_ * hltPathsToCheck_.size() / integral : 1.; + h->Scale(norm); + if (verbose_) { + std::cout << "xshi:: endRun total number of events: " << evtsrun_ << ", integral = " << h->Integral() + << ", norm = " << norm << std::endl; + } } } diff --git a/DQMOffline/Trigger/python/DQMOffline_Trigger_cff.py b/DQMOffline/Trigger/python/DQMOffline_Trigger_cff.py index ecda8358b0448..0d8c18513d65e 100644 --- a/DQMOffline/Trigger/python/DQMOffline_Trigger_cff.py +++ b/DQMOffline/Trigger/python/DQMOffline_Trigger_cff.py @@ -71,7 +71,10 @@ from DQMOffline.Trigger.HiggsMonitoring_cff import * # photon jet from DQMOffline.Trigger.HigPhotonJetHLTOfflineSource_cfi import * # ?!?!?! - +#Check if perLSsaving is enabled to mask MEs vs LS +from DQMServices.Core.DQMStore_cfi import DQMStore +if(DQMStore.saveByLumi): + higPhotonJetHLTOfflineSource.perLSsaving=True # SMP from DQMOffline.Trigger.StandardModelMonitoring_cff import * diff --git a/DQMOffline/Trigger/python/HigPhotonJetHLTOfflineSource_cfi.py b/DQMOffline/Trigger/python/HigPhotonJetHLTOfflineSource_cfi.py index eac20c6296127..fd5aa36543f59 100644 --- a/DQMOffline/Trigger/python/HigPhotonJetHLTOfflineSource_cfi.py +++ b/DQMOffline/Trigger/python/HigPhotonJetHLTOfflineSource_cfi.py @@ -29,6 +29,7 @@ # dirname = cms.untracked.string("HLT/Higgs/PhotonJet"), dirname = cms.untracked.string("HLT/HIG/PhotonJet"), verbose = cms.untracked.bool(False), # default: False + perLSsaving = cms.untracked.bool(False), #driven by DQMServices/Core/python/DQMStore_cfi.py triggerAccept = cms.untracked.bool(True), # default: True triggerResultsToken = cms.InputTag("TriggerResults","","HLT"), pvToken = cms.InputTag("offlinePrimaryVertices"), From 9024180251da2899e4084cbfd85e084a13818681 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 2 Jul 2021 21:57:16 +0200 Subject: [PATCH 14/18] Fix typo in DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py --- DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py | 1 + 1 file changed, 1 insertion(+) diff --git a/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py b/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py index 1eae59f567a7a..64827c4152081 100644 --- a/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py +++ b/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py @@ -8,6 +8,7 @@ AlcaBeamMonitor.BeamFitter.TrackQuality = ['highPurity'] AlcaBeamMonitor.PVFitter.VertexCollection = 'hiSelectedVertex' #Check if perLSsaving is enabled to mask MEs vs LS +fromm DQMServices.Core.DQMStore_cfi import DQMStore if(DQMstore.saveByLumi): AlcaBeamMonitor.perLSsaving=True import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi From 71acd9df13d796b382c10d6a8cb75d0e1975088e Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 7 Jul 2021 13:13:05 +0200 Subject: [PATCH 15/18] Fix to HcalPhiSymAlCaReco --- DQMOffline/CalibCalo/python/MonitorAlCaHcalPhisym_cfi.py | 2 ++ DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.cc | 4 +++- DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h | 2 ++ DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py | 4 ++++ DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py | 4 ++++ DQMServices/Core/python/DQMStore_cfi.py | 2 +- 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/DQMOffline/CalibCalo/python/MonitorAlCaHcalPhisym_cfi.py b/DQMOffline/CalibCalo/python/MonitorAlCaHcalPhisym_cfi.py index 23decabb8c0f6..4e3503e8d89f6 100644 --- a/DQMOffline/CalibCalo/python/MonitorAlCaHcalPhisym_cfi.py +++ b/DQMOffline/CalibCalo/python/MonitorAlCaHcalPhisym_cfi.py @@ -22,6 +22,8 @@ # File to save SaveToFile = cms.untracked.bool(False), FileName = cms.untracked.string('MonitorAlCaHcalPhiSym.root'), + #driven by DQMServices/Core/python/DQMStore_cfi.py + perLSsaving = cms.untracked.bool(False), # DQM folder to write to FolderName = cms.untracked.string('AlCaReco/HcalPhiSym') ) diff --git a/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.cc b/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.cc index 934a69acf4e09..712bfee58744d 100644 --- a/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.cc +++ b/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.cc @@ -62,6 +62,8 @@ DQMHcalPhiSymAlCaReco::DQMHcalPhiSymAlCaReco(const edm::ParameterSet &ps) : even saveToFile_ = ps.getUntrackedParameter("SaveToFile", false); fileName_ = ps.getUntrackedParameter("FileName", "MonitorAlCaHcalPhiSym.root"); + perLSsaving_ = (ps.getUntrackedParameter("perLSsaving", false)); + // histogram parameters // Distribution of rechits in iPhi, iEta @@ -441,7 +443,7 @@ void DQMHcalPhiSymAlCaReco::analyze(const Event &iEvent, const EventSetup &iSetu //-------------------------------------------------------- void DQMHcalPhiSymAlCaReco::dqmEndRun(const Run &r, const EventSetup &context) { // Keep Variances - if (eventCounter_ > 0) { + if (eventCounter_ > 0 && !perLSsaving_) { for (int k = 0; k <= hiDistr_x_nbin_; k++) { for (int j = 0; j <= hiDistr_y_nbin_; j++) { // First moment diff --git a/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h b/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h index 29e91e3b9ec45..378a3bcbfc420 100644 --- a/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h +++ b/DQMOffline/CalibCalo/src/DQMHcalPhiSymAlCaReco.h @@ -69,6 +69,8 @@ class DQMHcalPhiSymAlCaReco : public DQMOneEDAnalyzer<> { double ihbhe_size_; double ihf_size_; + bool perLSsaving_; //to avoid nanoDQMIO crashing, driven by DQMServices/Core/python/DQMStore_cfi.py + /// object to monitor edm::EDGetTokenT hbherecoMB; diff --git a/DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py b/DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py index 5167950cb0079..bbb3f142757aa 100644 --- a/DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py +++ b/DQMOffline/Configuration/python/ALCARECOHcalCalDQMHI_cff.py @@ -6,6 +6,10 @@ import DQMOffline.CalibCalo.MonitorHcalIsolatedBunchAlCaReco_cfi import DQMOffline.CalibCalo.MonitorHOAlCaRecoStream_cfi +#Check if perLSsaving is enabled to mask MEs vs LS +from DQMServices.Core.DQMStore_cfi import DQMStore +if(DQMStore.saveByLumi): + DQMOffline.CalibCalo.MonitorAlCaHcalPhisym_cfi.HcalPhiSymMon.perLSsaving=True ALCARECOHcalCalPhisymDQM = DQMOffline.CalibCalo.MonitorAlCaHcalPhisym_cfi.HcalPhiSymMon.clone() diff --git a/DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py b/DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py index 0924c4e3c7970..1273fb3424662 100644 --- a/DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py +++ b/DQMOffline/Configuration/python/ALCARECOHcalCalDQM_cff.py @@ -6,6 +6,10 @@ import DQMOffline.CalibCalo.MonitorHcalIsolatedBunchAlCaReco_cfi import DQMOffline.CalibCalo.MonitorHOAlCaRecoStream_cfi +#Check if perLSsaving is enabled to mask MEs vs LS +from DQMServices.Core.DQMStore_cfi import DQMStore +if(DQMStore.saveByLumi): + DQMOffline.CalibCalo.MonitorAlCaHcalPhisym_cfi.HcalPhiSymMon.perLSsaving=True ALCARECOHcalCalPhisymDQM = DQMOffline.CalibCalo.MonitorAlCaHcalPhisym_cfi.HcalPhiSymMon.clone() diff --git a/DQMServices/Core/python/DQMStore_cfi.py b/DQMServices/Core/python/DQMStore_cfi.py index 5650ea1f0ac36..2f6ba78fca30b 100644 --- a/DQMServices/Core/python/DQMStore_cfi.py +++ b/DQMServices/Core/python/DQMStore_cfi.py @@ -5,7 +5,7 @@ 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), + saveByLumi = cms.untracked.bool(True), #Following list has no effect if saveByLumi is False MEsToSave = cms.untracked.vstring(nanoDQMIO_perLSoutput.MEsToSave), trackME = cms.untracked.string(""), From cf3948a6d56994a7a9e0086667e7866215c8c78d Mon Sep 17 00:00:00 2001 From: jfernan2 Date: Wed, 7 Jul 2021 13:20:51 +0200 Subject: [PATCH 16/18] Update DQMStore_cfi.py Fix mistake --- DQMServices/Core/python/DQMStore_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQMServices/Core/python/DQMStore_cfi.py b/DQMServices/Core/python/DQMStore_cfi.py index 2f6ba78fca30b..5650ea1f0ac36 100644 --- a/DQMServices/Core/python/DQMStore_cfi.py +++ b/DQMServices/Core/python/DQMStore_cfi.py @@ -5,7 +5,7 @@ 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(True), + 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(""), From 6abaf56b62831744d8d8a9be14cb729c16245780 Mon Sep 17 00:00:00 2001 From: jfernan2 Date: Wed, 7 Jul 2021 15:08:18 +0200 Subject: [PATCH 17/18] Typo in AlcaBeamMonitorHeavyIons_cff --- DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py b/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py index 64827c4152081..d7dc728f1d5c4 100644 --- a/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py +++ b/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py @@ -8,7 +8,7 @@ AlcaBeamMonitor.BeamFitter.TrackQuality = ['highPurity'] AlcaBeamMonitor.PVFitter.VertexCollection = 'hiSelectedVertex' #Check if perLSsaving is enabled to mask MEs vs LS -fromm DQMServices.Core.DQMStore_cfi import DQMStore +from DQMServices.Core.DQMStore_cfi import DQMStore if(DQMstore.saveByLumi): AlcaBeamMonitor.perLSsaving=True import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi From cf4488383f6de403c49d5276601871ae69ab37c6 Mon Sep 17 00:00:00 2001 From: jfernan2 Date: Wed, 7 Jul 2021 16:56:50 +0200 Subject: [PATCH 18/18] Update AlcaBeamMonitorHeavyIons_cff.py --- DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py b/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py index d7dc728f1d5c4..fa716749371c4 100644 --- a/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py +++ b/DQM/BeamMonitor/python/AlcaBeamMonitorHeavyIons_cff.py @@ -9,7 +9,7 @@ AlcaBeamMonitor.PVFitter.VertexCollection = 'hiSelectedVertex' #Check if perLSsaving is enabled to mask MEs vs LS from DQMServices.Core.DQMStore_cfi import DQMStore -if(DQMstore.saveByLumi): +if(DQMStore.saveByLumi): AlcaBeamMonitor.perLSsaving=True import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi scalerBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()