Skip to content

Commit

Permalink
Merge pull request #28622 from schneiml/dqm-prepare-for-stream-v4
Browse files Browse the repository at this point in the history
DQM: new DQMStore.
  • Loading branch information
cmsbuild authored Feb 10, 2020
2 parents 21e2136 + 2f51722 commit 7bf830b
Show file tree
Hide file tree
Showing 169 changed files with 3,001 additions and 5,555 deletions.
438 changes: 0 additions & 438 deletions Alignment/LaserDQM/plugins/LaserDQMInitMonitors.cc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ void MuonAlignmentAnalyzer::beginJob() {
hprofLocalPositionRmsCSC->GetYaxis()->SetLabelSize(labelSize);
hprofLocalAngleRmsCSC->GetYaxis()->SetLabelSize(labelSize);

char binLabel[15];
char binLabel[32];
for (int i = 1; i < 15; i++) {
snprintf(binLabel, sizeof(binLabel), "Sec-%d", i);
hprofGlobalPositionDT->GetXaxis()->SetBinLabel(i, binLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ void TrackerOfflineValidationSummary::endJob() {
this->fillTree(*tree, mTobResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo);
this->fillTree(*tree, mTecResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo);

//dbe_->showDirStructure();
//dbe_->save("dqmOut.root");

// Method for filling histograms which show summarized values (mean, rms, median ...)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ SiStripGainFromCalibTree::SiStripGainFromCalibTree(const edm::ParameterSet& iCon

// Gather DQM Service
dbe = edm::Service<DQMStore>().operator->();
dbe->setVerbose(10);

//Set the monitoring element tag and store
dqm_tag_.reserve(7);
Expand Down
8 changes: 4 additions & 4 deletions Calibration/HcalCalibAlgos/plugins/Analyzer_minbias.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ namespace cms {

edm::LogInfo("AnalyzerMB") << " Before ordering Histos ";

char str0[15];
char str1[15];
char str0[32];
char str1[32];

char str10[15];
char str11[15];
char str10[32];
char str11[32];

int k = 0;
nevent = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ void CorrPCCProducer::resetBlock() {
//--------------------------------------------------------------------------------------------------
void CorrPCCProducer::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& context) {
ibooker.setCurrentFolder("AlCaReco/LumiPCC/");
auto scope = DQMStore::IBooker::UseRunScope(ibooker);
Type1FracMon = ibooker.book1D("type1Fraction", "Type1Fraction;Lumisection;Type 1 Fraction", maxLS, 0, maxLS);
Type1ResMon = ibooker.book1D("type1Residual", "Type1Residual;Lumisection;Type 1 Residual", maxLS, 0, maxLS);
Type2ResMon = ibooker.book1D("type2Residual", "Type2Residual;Lumisection;Type 2 Residual", maxLS, 0, maxLS);
Expand Down
3 changes: 0 additions & 3 deletions Calibration/TkAlCaRecoProducers/test/DQMRootFileReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ DQMRootFileReader::~DQMRootFileReader() {
}

void DQMRootFileReader::endJob(void) {
cout << "Dumping DQMStore dir structure:" << endl;
dbe->showDirStructure();
// dbe->save("test.root");
}

Expand All @@ -83,7 +81,6 @@ void DQMRootFileReader::analyze(const edm::Event &iEvent, const edm::EventSetup
// NOTE: this is here just because we need it after the beginRun of
// MEtoEDMCoverter which calls a Reset on all MEs.
dbe->open(filename, false, "", "", DQMStore::OpenRunDirs::StripRunDirs);
dbe->showDirStructure();
}

// define this as a plug-in
Expand Down
4 changes: 2 additions & 2 deletions Configuration/DataProcessing/python/Merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def mergeProcess(*inputFiles, **options):
# // input source
#//
if newDQMIO:
process.source = Source("DQMRootSource")
process.add_(Service("DQMStore", forceResetOnBeginLumi = CfgTypes.untracked.bool(True)))
process.source = Source("DQMRootSource", reScope = CfgTypes.untracked.string(""))
process.add_(Service("DQMStore"))
else:
process.source = Source("PoolSource")
if bypassVersionCheck:
Expand Down
23 changes: 12 additions & 11 deletions DQM/BeamMonitor/plugins/AlcaBeamMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "RecoVertex/BeamSpotProducer/interface/BeamFitter.h"
#include "RecoVertex/BeamSpotProducer/interface/PVFitter.h"
#include "DQM/BeamMonitor/plugins/AlcaBeamMonitor.h"
#include "DQMServices/Core/interface/QReport.h"
#include "FWCore/Framework/interface/Run.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand Down Expand Up @@ -174,16 +173,18 @@ void AlcaBeamMonitor::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const&
}
}
ibooker.setCurrentFolder(monitorName_ + "Service");
theValuesContainer_ = ibooker.bookProfile("hHistoLumiValues",
"Histo Lumi Values",
3 * numberOfValuesToSave_,
0.,
3 * numberOfValuesToSave_,
100.,
-100.,
9000.,
" ");
theValuesContainer_->setLumiFlag();
{
auto scope = DQMStore::IBooker::UseLumiScope(ibooker);
theValuesContainer_ = ibooker.bookProfile("hHistoLumiValues",
"Histo Lumi Values",
3 * numberOfValuesToSave_,
0.,
3 * numberOfValuesToSave_,
100.,
-100.,
9000.,
" ");
}

// create and cd into new folder
ibooker.setCurrentFolder(monitorName_ + "Validation");
Expand Down
1 change: 0 additions & 1 deletion DQM/BeamMonitor/plugins/AlcaBeamMonitorClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "DQM/BeamMonitor/plugins/AlcaBeamMonitorClient.h"
#include <numeric>
#include "DQMServices/Core/interface/QReport.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
Expand Down
3 changes: 0 additions & 3 deletions DQM/BeamMonitor/plugins/BeamMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ V00-03-25
*/

#include "DQM/BeamMonitor/plugins/BeamMonitor.h"
#include "DQMServices/Core/interface/QReport.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DataFormats/TrackCandidate/interface/TrackCandidate.h"
Expand Down Expand Up @@ -1023,7 +1022,6 @@ void BeamMonitor::FitAndFill(const LuminosityBlock& lumiSeg, int& lastlumi, int&
auto tmphisto = h_PVy[0]->getTH1F();
h_PVy[1]->getTH1()->SetBins(
tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
h_PVy[1]->update();
h_PVy[1]->Reset();
h_PVy[1]->getTH1()->Add(tmphisto);
h_PVy[1]->getTH1()->Fit(fgaus.get(), "QLM");
Expand Down Expand Up @@ -1054,7 +1052,6 @@ void BeamMonitor::FitAndFill(const LuminosityBlock& lumiSeg, int& lastlumi, int&
auto tmphisto = h_PVz[0]->getTH1F();
h_PVz[1]->getTH1()->SetBins(
tmphisto->GetNbinsX(), tmphisto->GetXaxis()->GetXmin(), tmphisto->GetXaxis()->GetXmax());
h_PVz[1]->update();
h_PVz[1]->Reset();
h_PVz[1]->getTH1()->Add(tmphisto);
h_PVz[1]->getTH1()->Fit(fgaus.get(), "QLM");
Expand Down
1 change: 0 additions & 1 deletion DQM/BeamMonitor/plugins/BeamSpotProblemMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#include "DQM/BeamMonitor/plugins/BeamSpotProblemMonitor.h"
#include "DQMServices/Core/interface/QReport.h"
#include "DataFormats/BeamSpot/interface/BeamSpot.h"
#include "DataFormats/TrackCandidate/interface/TrackCandidate.h"
#include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
Expand Down
2 changes: 2 additions & 0 deletions DQM/CastorMonitor/src/CastorMonitorModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ void CastorMonitorModule::bookHistograms(DQMStore::IBooker &ibooker,
const edm::Run &iRun,
const edm::EventSetup &iSetup) {
if (DigiMon_) {
// Run histos only since there is endRun processing.
auto scope = DQMStore::IBooker::UseRunScope(ibooker);
DigiMon_->bookHistograms(ibooker, iRun, iSetup);
}
if (RecHitMon_) {
Expand Down
18 changes: 9 additions & 9 deletions DQM/DTMonitorClient/src/DTDCSByLumiSummary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ void DTDCSByLumiSummary::dqmEndLuminosityBlock(DQMStore::IBooker& ibooker,
if (!bookingdone) {
ibooker.setCurrentFolder("DT/EventInfo/DCSContents");

totalDCSFraction = ibooker.bookFloat("DTDCSSummary");
totalDCSFraction->setLumiFlag(); // set LumiFlag to DCS content value (save it by lumi)

globalHVSummary = ibooker.book2D("HVGlbSummary", "HV Status Summary", 1, 1, 13, 5, -2, 3);
globalHVSummary->setAxisTitle("Sectors", 1);
globalHVSummary->setAxisTitle("Wheel", 2);

for (int wh = -2; wh <= 2; wh++) {
stringstream wheel_str;
wheel_str << wh;
{
auto scope = DQMStore::IBooker::UseLumiScope(ibooker);
totalDCSFraction = ibooker.bookFloat("DTDCSSummary");
for (int wh = -2; wh <= 2; wh++) {
stringstream wheel_str;
wheel_str << wh;

MonitorElement* FractionWh = ibooker.bookFloat("DT_Wheel" + wheel_str.str());
FractionWh->setLumiFlag(); // set LumiFlag to DCS content value (save it by lumi)
MonitorElement* FractionWh = ibooker.bookFloat("DT_Wheel" + wheel_str.str());

totalDCSFractionWh.push_back(FractionWh);
totalDCSFractionWh.push_back(FractionWh);
}
}

globalHVSummary->Reset();
Expand Down
12 changes: 7 additions & 5 deletions DQM/DTMonitorModule/src/DTDCSByLumiTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ void DTDCSByLumiTask::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const&
stringstream wheel_str;
wheel_str << wheel;

MonitorElement* ME =
ibooker.book1D("hActiveUnits" + wheel_str.str(), "Active Untis x LS Wh" + wheel_str.str(), 2, 0.5, 2.5);
ME->setLumiFlag(); // Set LumiFlag in order to save histo every LS

hActiveUnits.push_back(ME);
{
// Set Lumi scope in order to save histo every LS
auto scope = DQMStore::IBooker::UseLumiScope(ibooker);
MonitorElement* ME =
ibooker.book1D("hActiveUnits" + wheel_str.str(), "Active Untis x LS Wh" + wheel_str.str(), 2, 0.5, 2.5);
hActiveUnits.push_back(ME);
}
}
}

Expand Down
10 changes: 7 additions & 3 deletions DQM/EcalCommon/src/MESetEcal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ namespace ecaldqm {
void MESetEcal::book(DQMStore::IBooker &_ibooker) {
using namespace std;

auto oldscope = MonitorElementData::Scope::RUN;
if (lumiFlag_)
oldscope = _ibooker.setScope(MonitorElementData::Scope::LUMI);

clear();

vector<string> mePaths(generatePaths());
Expand Down Expand Up @@ -264,12 +268,12 @@ namespace ecaldqm {
me->getTH1()->SetUniqueID(uint32_t(2 * (actualObject + 1) + (isMap ? 1 : 0)));
}

if (lumiFlag_)
me->setLumiFlag();

mes_.push_back(me);
}

if (lumiFlag_)
_ibooker.setScope(oldscope);

active_ = true;
}

Expand Down
5 changes: 4 additions & 1 deletion DQM/EcalCommon/src/MESetNonObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ namespace ecaldqm {
size_t slashPos(path_.find_last_of('/'));
string name(path_.substr(slashPos + 1));
_ibooker.setCurrentFolder(path_.substr(0, slashPos));
auto oldscope = MonitorElementData::Scope::RUN;
if (lumiFlag_)
oldscope = _ibooker.setScope(MonitorElementData::Scope::LUMI);

MonitorElement *me(nullptr);

Expand Down Expand Up @@ -172,7 +175,7 @@ namespace ecaldqm {
}

if (lumiFlag_)
me->setLumiFlag();
_ibooker.setScope(oldscope);

mes_.push_back(me);

Expand Down
4 changes: 2 additions & 2 deletions DQM/EcalMonitorClient/python/SummaryClient_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
kind = cms.untracked.string('REAL'),
otype = cms.untracked.string('SM'),
btype = cms.untracked.string('Report'),
perLumi = cms.untracked.bool(True),
perLumi = cms.untracked.bool(False),
description = cms.untracked.string('')
),
GlobalSummary = cms.untracked.PSet(
Expand Down Expand Up @@ -88,7 +88,7 @@
kind = cms.untracked.string('REAL'),
otype = cms.untracked.string('Ecal'),
btype = cms.untracked.string('Report'),
perLumi = cms.untracked.bool(True),
perLumi = cms.untracked.bool(False),
description = cms.untracked.string('')
)
)
Expand Down
3 changes: 0 additions & 3 deletions DQM/EcalMonitorDbModule/plugins/EcalBarrelMonitorDbModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ EcalBarrelMonitorDbModule::EcalBarrelMonitorDbModule(const edm::ParameterSet &ps

ME_Db_ = new MonitorElementsDb(ps, xmlFile_);

if (dqmStore_)
dqmStore_->showDirStructure();

icycle_ = 0;
session_ = nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion DQM/EcalPreshowerMonitorModule/src/ESIntegrityTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ void ESIntegrityTask::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const&

if (doLumiAnalysis_) {
sprintf(histo, "ES Good Channel Fraction");
auto scope = DQMStore::IBooker::UseLumiScope(iBooker);
meDIFraction_ = iBooker.book2D(histo, histo, 3, 1.0, 3.0, 3, 1.0, 3.0);
meDIFraction_->setLumiFlag();
}
}

Expand Down
12 changes: 0 additions & 12 deletions DQM/HLXMonitor/src/HLXMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,6 @@ void HLXMonitor::SetupHists(DQMStore::IBooker &iBooker) {
}
}

if (!Accumulate) {
for (unsigned int iWedge = 0; iWedge < NUM_HLX; ++iWedge) {
Set1Below[iWedge]->setResetMe(true);
Set1Between[iWedge]->setResetMe(true);
Set1Above[iWedge]->setResetMe(true);
Set2Below[iWedge]->setResetMe(true);
Set2Between[iWedge]->setResetMe(true);
Set2Above[iWedge]->setResetMe(true);
ETSum[iWedge]->setResetMe(true);
}
}

if (Style == "BX") {
OccXAxisTitle = "Bunch Crossing";
OccYAxisTitle = "Tower Occupancy";
Expand Down
3 changes: 0 additions & 3 deletions DQM/HcalCommon/interface/Container1D.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ namespace hcaldqm {
// TO BE USED IN THE FUTURE!
virtual void extendAxisRange(int);

// set lumi flags for all mes
virtual void setLumiFlag();

virtual void showOverflowX(bool showOverflow);
virtual void showOverflowY(bool showOverflow);

Expand Down
6 changes: 0 additions & 6 deletions DQM/HcalCommon/src/Container1D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -766,12 +766,6 @@ namespace hcaldqm {
}
}

/* virtual */ void Container1D::setLumiFlag() {
for (auto const &pair : _mes) {
pair.second->setLumiFlag();
}
}

void Container1D::showOverflowX(bool showOverflow) { _qx->showOverflow(showOverflow); }

void Container1D::showOverflowY(bool showOverflow) { _qy->showOverflow(showOverflow); }
Expand Down
8 changes: 4 additions & 4 deletions DQM/HcalTasks/plugins/DigiPhase1Task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ DigiPhase1Task::DigiPhase1Task(edm::ParameterSet const& ps) : DQTask(ps) {
_cTimingCut_depth.book(ib, _emap, _subsystem);

_cOccupancyvsLS_Subdet.book(ib, _emap, _subsystem);
_cOccupancy_depth.book(ib, _emap, _subsystem);
_cOccupancyCut_depth.book(ib, _emap, _subsystem);
if (_ptype != fOffline)
_cOccupancy_depth.book(ib, _emap, _subsystem);

if (_ptype != fOffline) { // hidefed2crate
_cShapeCut_FED.book(ib, _emap, _subsystem);
Expand All @@ -286,21 +287,20 @@ DigiPhase1Task::DigiPhase1Task(edm::ParameterSet const& ps) : DQTask(ps) {
_dhashmap.initialize(_emap, electronicsmap::fE2DHashMap);

// MARK THESE HISTOGRAMS AS LUMI BASED FOR OFFLINE PROCESSING
auto scope = DQMStore::IBooker::UseLumiScope(ib);
if (_ptype == fOffline) {
//_cDigiSize_FED.setLumiFlag(); // hidefed2crate : FED stuff not available offline anymore, so this histogram doesn't make sense?
_cOccupancy_depth.setLumiFlag();
_cOccupancy_depth.book(ib, _emap, _subsystem);
}

// book Number of Events vs LS histogram
ib.setCurrentFolder(_subsystem + "/RunInfo");
meNumEvents1LS = ib.book1D("NumberOfEvents", "NumberOfEvents", 1, 0, 1);
meNumEvents1LS->setLumiFlag();

// book the flag for unknown ids and the online guy as well
ib.setCurrentFolder(_subsystem + "/" + _name);
meUnknownIds1LS = ib.book1D("UnknownIds", "UnknownIds", 1, 0, 1);
_unknownIdsPresent = false;
meUnknownIds1LS->setLumiFlag();
}

/* virtual */ void DigiPhase1Task::_resetMonitors(hcaldqm::UpdateFreq uf) {
Expand Down
Loading

0 comments on commit 7bf830b

Please sign in to comment.