Skip to content

Commit

Permalink
Merge pull request #28247 from schneiml/dqm-remove-more-dqmstore-feat…
Browse files Browse the repository at this point in the history
…ures

DQM: Remove more DQMStore features
  • Loading branch information
cmsbuild committed Nov 24, 2019
2 parents 86ad301 + fe8e852 commit 96fbb47
Show file tree
Hide file tree
Showing 77 changed files with 32 additions and 1,525 deletions.
Expand Up @@ -477,24 +477,6 @@ void TrackerOfflineValidationSummary::fillTree(TTree& tree,
treeMem.histNameNormY = h->GetName();
}

// Delete module level hists if set in cfg
const bool removeModuleLevelHists(parSet_.getParameter<bool>("removeModuleLevelHists"));
if (removeModuleLevelHists) {
dbe_->setCurrentFolder("");
if (it->second.ResHisto)
dbe_->removeElement(histDir + "/" + it->second.ResHisto->GetName());
if (it->second.NormResHisto)
dbe_->removeElement(histDir + "/" + it->second.NormResHisto->GetName());
if (it->second.ResXprimeHisto)
dbe_->removeElement(histDir + "/" + it->second.ResXprimeHisto->GetName());
if (it->second.NormResXprimeHisto)
dbe_->removeElement(histDir + "/" + it->second.NormResXprimeHisto->GetName());
if (it->second.ResYprimeHisto)
dbe_->removeElement(histDir + "/" + it->second.ResYprimeHisto->GetName());
if (it->second.NormResYprimeHisto)
dbe_->removeElement(histDir + "/" + it->second.NormResYprimeHisto->GetName());
}

tree.Fill();
}
}
Expand Down
Expand Up @@ -64,7 +64,6 @@
######################################################################
######################################################################
offlineDqmFileOutputTemplate = """
process.TrackerOfflineValidationSummary.oO[offlineValidationMode]Oo..removeModuleLevelHists = .oO[offlineModuleLevelHistsTransient]Oo.
process.DqmSaverTkAl.workflow = '.oO[workflow]Oo.'
process.DqmSaverTkAl.dirName = '.oO[workdir]Oo./.'
process.DqmSaverTkAl.forceRunNumber = .oO[firstRunNumber]Oo.
Expand Down
Expand Up @@ -4,7 +4,6 @@
moduleDirectoryInOutput = cms.string("Alignment/Tracker"), # has to be the same as in TrackerOfflineValidation_Dqm_cff
useFit = cms.bool(False),
stripYDmrs = cms.bool(False), # should be the same as for stripYResiduals in TrackerOfflineValidation_Dqm_cff
removeModuleLevelHists = cms.bool(False), # Remove module level hists after extracting the necessary information
minEntriesPerModuleForDmr = cms.uint32(100),

# DMR (distribution of median of residuals per module) of X coordinate (Strip)
Expand Down
Expand Up @@ -32,14 +32,13 @@
TrackerOfflineValidationDqm = TrackerOfflineValidationBinned.clone(
useInDqmMode = True,
moduleDirectoryInOutput = "Alignment/Tracker",
Tracks = 'TrackRefitterForOfflineValidation',
Tracks = 'TrackRefitterForOfflineValidation'
)

##
## TrackerOfflineValidationSummary
##
TrackerOfflineValidationSummaryDqm = TrackerOfflineValidationSummaryBinned.clone(
removeModuleLevelHists = True,
minEntriesPerModuleForDmr = 100
)

Expand Down
Expand Up @@ -175,7 +175,6 @@
#process.TrackerOfflineValidationDqm.Tracks = 'TrackRefitterP5'
#process.TrackerOfflineValidationDqm.trajectoryInput = 'TrackRefitterP5'
# Harvesting
#process.TrackerOfflineValidationSummaryDqm.removeModuleLevelHists = False
process.TrackerOfflineValidationSummaryDqm.minEntriesPerModuleForDmr = 1 # to allow tests with few statistics
# Output File
process.DqmSaverTkAl.workflow = "/Cosmics/TkAl09-335patch1_CRAFT09_R_V4_TestFile_CRAFT09reprocessing_WithoutCuts_R000109011_R000109624_ValSkim-v1/ALCARECO"
Expand Down
Expand Up @@ -27,7 +27,6 @@
# 2 provide more detailed output
Frequency=cms.untracked.int32(50),
MEPathToSave=cms.untracked.string('AlCaReco/EcalPedestalsPCL'),
deleteAfterCopy=cms.untracked.bool(True)
)

ALCALRECOEcalTCDSDigis = cms.EDProducer('TcdsRawToDigi')
Expand Down
Expand Up @@ -98,7 +98,6 @@
# 2 provide more detailed output
Frequency = cms.untracked.int32(50),
MEPathToSave = cms.untracked.string('AlCaReco/SiStripGainsAAG'),
deleteAfterCopy = cms.untracked.bool(True)
)

# The actual sequence
Expand Down
Expand Up @@ -99,7 +99,6 @@
# 2 provide more detailed output
Frequency = cms.untracked.int32(50),
MEPathToSave = cms.untracked.string('AlCaReco/SiStripGains'),
deleteAfterCopy = cms.untracked.bool(True)
)

# The actual sequence
Expand Down
Expand Up @@ -9,7 +9,6 @@
# 2 provide more detailed output
Frequency = cms.untracked.int32(50),
MEPathToSave = cms.untracked.string('AlCaReco/SiStrip'),
deleteAfterCopy = cms.untracked.bool(False)
)

seqALCARECOSiStripPCLHistos = cms.Sequence(MEtoEDMConvertSiStrip)
Expand Up @@ -46,7 +46,6 @@
)

process.MEtoEDMConvertSiStrip = cms.EDProducer("MEtoEDMConverter",
deleteAfterCopy = cms.untracked.bool(False),
Verbosity = cms.untracked.int32(0),
Frequency = cms.untracked.int32(50),
Name = cms.untracked.string('MEtoEDMConverter'),
Expand Down
24 changes: 1 addition & 23 deletions DQM/BeamMonitor/plugins/AlcaBeamMonitorClient.cc
Expand Up @@ -63,29 +63,7 @@ AlcaBeamMonitorClient::~AlcaBeamMonitorClient() {}
void AlcaBeamMonitorClient::beginJob() {}

//----------------------------------------------------------------------------------------------------------------------
void AlcaBeamMonitorClient::beginRun(const edm::Run& r, const EventSetup& context) {
for (HistosContainer::iterator itM = histosMap_.begin(); itM != histosMap_.end(); itM++) {
for (map<string, map<string, MonitorElement*> >::iterator itMM = itM->second.begin(); itMM != itM->second.end();
itMM++) {
if (itMM->first != "run") {
for (map<string, MonitorElement*>::iterator itMMM = itMM->second.begin(); itMMM != itMM->second.end();
itMMM++) {
if (itMMM->second != nullptr) {
if (itMM->first == "lumi") {
dbe_->removeElement(monitorName_ + "Debug", itMMM->second->getName());
} else if (itMM->first == "validation") {
dbe_->removeElement(monitorName_ + "Validation", itMMM->second->getName());
} else {
LogInfo("AlcaBeamMonitorClient") << "Unrecognized category " << itMM->first;
// assert(0);
}
itMMM->second = nullptr;
}
}
}
}
}
}
void AlcaBeamMonitorClient::beginRun(const edm::Run& r, const EventSetup& context) {}

//----------------------------------------------------------------------------------------------------------------------

Expand Down
4 changes: 0 additions & 4 deletions DQM/BeamMonitor/plugins/BeamMonitorBx.cc
Expand Up @@ -197,10 +197,6 @@ void BeamMonitorBx::BookTables(int nBx, map<string, string>& vMap, string suffix
tmpName += "_";
tmpName += suffix_;
}
if (dbe_->get(monitorName_ + "FitBx/" + tmpName)) {
edm::LogInfo("BX|BeamMonitorBx") << "Rebinning " << tmpName << endl;
dbe_->removeElement(tmpName);
}

hs[tmpName] = dbe_->book2D(tmpName, varName->second, 3, 0, 3, nBx, 0, nBx);
hs[tmpName]->setBinLabel(1, "bx", 1);
Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalCommon/interface/MESet.h
Expand Up @@ -97,8 +97,6 @@ namespace ecaldqm {
virtual bool isVariableBinning() const { return false; }
virtual MonitorElement const *getME(unsigned _iME) const { return (_iME < mes_.size() ? mes_[_iME] : nullptr); }
virtual MonitorElement *getME(unsigned _iME) { return (_iME < mes_.size() ? mes_[_iME] : nullptr); }
virtual void softReset();
virtual void recoverStats();

std::string formPath(PathReplacements const &) const;

Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalCommon/interface/MESetDet2D.h
Expand Up @@ -62,8 +62,6 @@ namespace ecaldqm {

void reset(double = 0., double = 0., double = 0.) override;

void softReset() override;

protected:
void fill_(unsigned, int, double) override;
void fill_(unsigned, int, double, double) override;
Expand Down
20 changes: 0 additions & 20 deletions DQM/EcalCommon/src/MESet.cc
Expand Up @@ -243,26 +243,6 @@ namespace ecaldqm {
return false;
}

void MESet::softReset() {
if (!active_)
return;

DQMStore &store(*edm::Service<DQMStore>());

for (unsigned iME(0); iME < mes_.size(); ++iME)
store.softReset(mes_[iME]);
}

void MESet::recoverStats() {
if (!active_)
return;

DQMStore &store(*edm::Service<DQMStore>());

for (unsigned iME(0); iME < mes_.size(); ++iME)
store.disableSoftReset(mes_[iME]);
}

void MESet::fill_(unsigned _iME, int _bin, double _w) {
if (kind_ == MonitorElement::Kind::REAL)
return;
Expand Down
6 changes: 0 additions & 6 deletions DQM/EcalCommon/src/MESetDet2D.cc
Expand Up @@ -518,12 +518,6 @@ namespace ecaldqm {
}
}

void MESetDet2D::softReset() {
MESet::softReset();
if (!batchMode_ && kind_ == MonitorElement::Kind::TPROFILE2D)
resetAll(0., 0., -1.);
}

void MESetDet2D::fill_(unsigned _iME, int _bin, double _w) {
if (kind_ == MonitorElement::Kind::TPROFILE2D) {
MonitorElement *me(mes_.at(_iME));
Expand Down
8 changes: 1 addition & 7 deletions DQM/EcalMonitorDbModule/src/MonitorElementsDb.cc
Expand Up @@ -99,13 +99,7 @@ MonitorElementsDb::~MonitorElementsDb() { delete parser_; }

void MonitorElementsDb::beginJob(void) { ievt_ = 0; }

void MonitorElementsDb::endJob(void) {
std::cout << "MonitorElementsDb: analyzed " << ievt_ << " events" << std::endl;
for (unsigned int i = 0; i < MEs_.size(); i++) {
if (MEs_[i] != nullptr)
dqmStore_->removeElement(MEs_[i]->getName());
}
}
void MonitorElementsDb::endJob(void) { std::cout << "MonitorElementsDb: analyzed " << ievt_ << " events" << std::endl; }

void MonitorElementsDb::analyze(const edm::Event &e, const edm::EventSetup &c, coral::ISessionProxy *session) {
ievt_++;
Expand Down
5 changes: 0 additions & 5 deletions DQM/EcalMonitorTasks/interface/DQWorkerTask.h
Expand Up @@ -91,13 +91,8 @@ namespace ecaldqm {
// Returns true if the module runs on the collection
virtual bool analyze(void const*, Collections) { return false; }

void softReset();
void recoverStats();

protected:
void setME(edm::ParameterSet const&) final;

std::set<std::string> resettable_;
};
} // namespace ecaldqm
#endif
8 changes: 1 addition & 7 deletions DQM/EcalMonitorTasks/plugins/EcalDQMonitorTask.cc
Expand Up @@ -114,10 +114,6 @@ void EcalDQMonitorTask::dqmBeginRun(edm::Run const& _run, edm::EventSetup const&
}

void EcalDQMonitorTask::dqmEndRun(edm::Run const& _run, edm::EventSetup const& _es) {
if (lastResetTime_ != 0)
executeOnWorkers_([](ecaldqm::DQWorker* worker) { static_cast<ecaldqm::DQWorkerTask*>(worker)->recoverStats(); },
"recoverStats");

ecaldqmEndRun(_run, _es);

executeOnWorkers_([](ecaldqm::DQWorker* worker) { worker->releaseMEs(); }, "releaseMEs", "releasing histograms");
Expand All @@ -133,9 +129,7 @@ void EcalDQMonitorTask::dqmEndLuminosityBlock(edm::LuminosityBlock const& _lumi,
if (lastResetTime_ != 0 && (time(nullptr) - lastResetTime_) / 3600. > resetInterval_) {
if (verbosity_ > 0)
edm::LogInfo("EcalDQM") << moduleName_ << ": Soft-resetting the histograms";
executeOnWorkers_([](ecaldqm::DQWorker* worker) { static_cast<ecaldqm::DQWorkerTask*>(worker)->softReset(); },
"softReset");

// TODO: soft-reset is no longer supported.
lastResetTime_ = time(nullptr);
}
}
Expand Down
20 changes: 1 addition & 19 deletions DQM/EcalMonitorTasks/src/DQWorkerTask.cc
Expand Up @@ -5,7 +5,7 @@
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

namespace ecaldqm {
DQWorkerTask::DQWorkerTask() : DQWorker(), resettable_() {}
DQWorkerTask::DQWorkerTask() : DQWorker() {}

/*static*/
void DQWorkerTask::fillDescriptions(edm::ParameterSetDescription& _desc) { DQWorker::fillDescriptions(_desc); }
Expand All @@ -16,27 +16,9 @@ namespace ecaldqm {
for (MESetCollection::iterator mItr(MEs_.begin()); mItr != MEs_.end(); ++mItr) {
if (willConvertToEDM_)
mItr->second->setBatchMode();

// TEMPORARY MEASURE - softReset does not accept variable bin size as of September 2012
// isVariableBinning is true for 1. MESetEcal or MESetNonObject with any custom binning or 2. MESetTrend
// In principle it is sufficient to protect the MESetTrends from being reset
if (mItr->second->getBinType() != ecaldqm::binning::kTrend && !mItr->second->isVariableBinning() &&
mItr->second->getKind() != MonitorElement::Kind::REAL)
resettable_.insert(mItr->first);
}
}

void DQWorkerTask::softReset() {
std::for_each(
resettable_.begin(), resettable_.end(), [this](std::string const& name) { this->MEs_.at(name).softReset(); });
}

void DQWorkerTask::recoverStats() {
std::for_each(resettable_.begin(), resettable_.end(), [this](std::string const& name) {
this->MEs_.at(name).recoverStats();
});
}

void DependencySet::formSequenceFragment_(Dependency const& _d,
std::vector<Collections>& _sequence,
std::vector<Collections>::iterator _maxPos) const {
Expand Down
Expand Up @@ -3,7 +3,6 @@

ecalPreshowerLocalMonitorClient = DQMEDHarvester('EcalPreshowerMonitorClient',
LookupTable = cms.untracked.FileInPath('EventFilter/ESDigiToRaw/data/ES_lookup_table.dat'),
enableCleanup = cms.untracked.bool(False),
enabledClients = cms.untracked.vstring('Pedestal'),
prefixME = cms.untracked.string('EcalPreshower'),
prescaleFactor = cms.untracked.int32(1),
Expand Down
5 changes: 0 additions & 5 deletions DQM/EcalPreshowerMonitorModule/interface/ESDaqInfoTask.h
Expand Up @@ -35,16 +35,11 @@ class ESDaqInfoTask : public edm::EDAnalyzer {
/// Reset
void reset(void);

/// Cleanup
void cleanup(void);

private:
DQMStore* dqmStore_;

std::string prefixME_;

bool enableCleanup_;

bool mergeRuns_;

MonitorElement* meESDaqFraction_;
Expand Down
Expand Up @@ -20,15 +20,12 @@ class ESDataCertificationTask : public edm::EDAnalyzer {
void endJob(void) override;
void beginLuminosityBlock(const edm::LuminosityBlock& lumiBlock, const edm::EventSetup& iSetup) override;
void reset(void);
void cleanup(void);

private:
DQMStore* dqmStore_;

std::string prefixME_;

bool enableCleanup_;

bool mergeRuns_;

MonitorElement* meESDataCertificationSummary_;
Expand Down
5 changes: 0 additions & 5 deletions DQM/EcalPreshowerMonitorModule/interface/ESDcsInfoTask.h
Expand Up @@ -35,16 +35,11 @@ class ESDcsInfoTask : public edm::EDAnalyzer {
/// Reset
void reset(void);

/// Cleanup
void cleanup(void);

private:
DQMStore* dqmStore_;

std::string prefixME_;

bool enableCleanup_;

bool mergeRuns_;

edm::EDGetTokenT<DcsStatusCollection> dcsStatustoken_;
Expand Down
1 change: 0 additions & 1 deletion DQM/EcalPreshowerMonitorModule/python/ESDaqInfoTask_cfi.py
Expand Up @@ -3,7 +3,6 @@
ecalPreshowerDaqInfoTask = cms.EDAnalyzer("ESDaqInfoTask",
esMapping = cms.PSet(LookupTable = cms.FileInPath("EventFilter/ESDigiToRaw/data/ES_lookup_table.dat")),
prefixME = cms.untracked.string('EcalPreshower'),
enableCleanup = cms.untracked.bool(False),
mergeRuns = cms.untracked.bool(False),
ESFedRangeMin = cms.untracked.int32(520),
ESFedRangeMax = cms.untracked.int32(575)
Expand Down
Expand Up @@ -2,6 +2,5 @@

ecalPreshowerDataCertificationTask = cms.EDAnalyzer("ESDataCertificationTask",
prefixME = cms.untracked.string('EcalPreshower'),
enableCleanup = cms.untracked.bool(False),
mergeRuns = cms.untracked.bool(False)
)
1 change: 0 additions & 1 deletion DQM/EcalPreshowerMonitorModule/python/ESDcsInfoTask_cfi.py
Expand Up @@ -2,7 +2,6 @@

ecalPreshowerDcsInfoTask = cms.EDAnalyzer("ESDcsInfoTask",
prefixME = cms.untracked.string('EcalPreshower'),
enableCleanup = cms.untracked.bool(False),
mergeRuns = cms.untracked.bool(False),
DcsStatusLabel = cms.InputTag("scalersRawToDigi")
)

0 comments on commit 96fbb47

Please sign in to comment.