Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Enable concurrent lumisection processing in ECAL #30187

Closed
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions DQM/EcalCommon/interface/DQWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ namespace ecaldqm {
virtual void beginRun(edm::Run const &, edm::EventSetup const &) {}
virtual void endRun(edm::Run const &, edm::EventSetup const &) {}

virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) {}
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) {}

virtual void bookMEs(DQMStore::IBooker &);
virtual void releaseMEs();

Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalCommon/interface/EcalDQMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ namespace ecaldqm {
void ecaldqmGetSetupObjects(edm::EventSetup const &);
void ecaldqmBeginRun(edm::Run const &, edm::EventSetup const &);
void ecaldqmEndRun(edm::Run const &, edm::EventSetup const &);
void ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &);
void ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &);

template <typename FuncOnWorker>
void executeOnWorkers_(FuncOnWorker,
Expand Down
27 changes: 0 additions & 27 deletions DQM/EcalCommon/src/EcalDQMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,4 @@ namespace ecaldqm {
edm::LogInfo("EcalDQM") << moduleName_ << "::ecaldqmEndRun";
}

void EcalDQMonitor::ecaldqmBeginLuminosityBlock(edm::LuminosityBlock const &_lumi, edm::EventSetup const &_es) {
executeOnWorkers_(
[&_lumi, &_es](DQWorker *worker) {
if (worker->onlineMode())
worker->setTime(time(nullptr));
worker->setLumiNumber(_lumi.luminosityBlock());
worker->beginLuminosityBlock(_lumi, _es);
},
"beginLumi");

if (verbosity_ > 1)
edm::LogInfo("EcalDQM") << moduleName_ << "::ecaldqmBeginLuminosityBlock";
}

void EcalDQMonitor::ecaldqmEndLuminosityBlock(edm::LuminosityBlock const &_lumi, edm::EventSetup const &_es) {
executeOnWorkers_(
[&_lumi, &_es](DQWorker *worker) {
if (worker->onlineMode())
worker->setTime(time(nullptr));
worker->setLumiNumber(_lumi.luminosityBlock());
worker->endLuminosityBlock(_lumi, _es);
},
"endLumi");

if (verbosity_ > 2)
edm::LogInfo("EcalDQM") << moduleName_ << "::ecaldqmEndLuminosityBlock";
}
} // namespace ecaldqm
1 change: 0 additions & 1 deletion DQM/EcalMonitorClient/interface/DQWorkerClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace ecaldqm {

static void fillDescriptions(edm::ParameterSetDescription&);

void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
void resetPerLumi();

void bookMEs(DQMStore::IBooker&) override;
Expand Down
4 changes: 0 additions & 4 deletions DQM/EcalMonitorClient/interface/EcalDQMonitorClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class EcalDQMonitorClient : public DQMEDHarvester, public ecaldqm::EcalDQMonitor
private:
void beginRun(edm::Run const&, edm::EventSetup const&) override;
void endRun(edm::Run const&, edm::EventSetup const&) override;
void dqmEndLuminosityBlock(DQMStore::IBooker&,
DQMStore::IGetter&,
edm::LuminosityBlock const&,
edm::EventSetup const&) override;
void dqmEndJob(DQMStore::IBooker&, DQMStore::IGetter&) override;

void runWorkers(DQMStore::IGetter&, ecaldqm::DQWorkerClient::ProcessType);
Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalMonitorClient/interface/IntegrityClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ namespace ecaldqm {
~IntegrityClient() override {}

void producePlots(ProcessType) override;
void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;

private:
void setParams(edm::ParameterSet const&) override;
edm::ESHandle<EcalChannelStatus> chStatus;

float errFractionThreshold_;
};
Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalMonitorClient/interface/TowerStatusTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ namespace ecaldqm {
TowerStatusTask();
~TowerStatusTask() override {}

void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;

void producePlots(ProcessType) override;

private:
Expand Down
27 changes: 0 additions & 27 deletions DQM/EcalMonitorClient/plugins/EcalDQMonitorClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,6 @@ void EcalDQMonitorClient::beginRun(edm::Run const& _run, edm::EventSetup const&

void EcalDQMonitorClient::endRun(edm::Run const& _run, edm::EventSetup const& _es) { ecaldqmEndRun(_run, _es); }

void EcalDQMonitorClient::dqmEndLuminosityBlock(DQMStore::IBooker& _ibooker,
DQMStore::IGetter& _igetter,
edm::LuminosityBlock const& _lumi,
edm::EventSetup const& _es) {
executeOnWorkers_(
[&_ibooker](ecaldqm::DQWorker* worker) {
ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
if (!client->onlineMode() && !client->runsOn(ecaldqm::DQWorkerClient::kLumi))
return;
client->bookMEs(_ibooker);
},
"bookMEs",
"Booking MEs");

ecaldqmEndLuminosityBlock(_lumi, _es);

runWorkers(_igetter, ecaldqm::DQWorkerClient::kLumi);

executeOnWorkers_(
[](ecaldqm::DQWorker* worker) {
ecaldqm::DQWorkerClient* client(static_cast<ecaldqm::DQWorkerClient*>(worker));
client->resetPerLumi();
},
"dqmEndLuminosityBlock",
"Reset per-lumi MEs");
}

void EcalDQMonitorClient::dqmEndJob(DQMStore::IBooker& _ibooker, DQMStore::IGetter& _igetter) {
executeOnWorkers_(
[&_ibooker](ecaldqm::DQWorker* worker) {
Expand Down
7 changes: 0 additions & 7 deletions DQM/EcalMonitorClient/python/IntegrityClient_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@
otype = cms.untracked.string('SM'),
btype = cms.untracked.string('Crystal'),
description = cms.untracked.string('Summary of the data integrity. A channel is red if more than ' + str(errFractionThreshold) + ' of its entries have integrity errors.')
),
ChStatus = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sIntegrityClient/%(prefix)sIT%(suffix)s channel status map'),
kind = cms.untracked.string('TH2F'),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('Crystal'),
description = cms.untracked.string('Map of channel status as given by the Ecal Channel Status Record. LEGEND:<br/>0: Channel ok,<br/>1: DAC settings problem, pedestal not in the design range,<br/>2: Channel with no laser, ok elsewhere,<br/>3: Noisy,<br/>4: Very noisy,<br/>5-7: Reserved for more categories of noisy channels,<br/>8: Channel at fixed gain 6 (or 6 and 1),<br/>9: Channel at fixed gain 1,<br/>10: Channel at fixed gain 0 (dead of type this),<br/>11: Non-responding isolated channel (dead of type other),<br/>12: Channel and one or more neigbors not responding (e.g.: in a dead VFE 5x1 channel),<br/>13: Channel in TT with no data link, TP data ok,<br/>14: Channel in TT with no data link and no TP data.')
)
)
)
14 changes: 1 addition & 13 deletions DQM/EcalMonitorClient/python/PresampleClient_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
toleranceRMSFwd = cms.untracked.double(toleranceRMSFwd)
),
sources = cms.untracked.PSet(
Pedestal = ecalPresampleTask.MEs.Pedestal,
PedestalByLS = ecalPresampleTask.MEs.PedestalByLS,
ChStatus = ecalIntegrityClient.MEs.ChStatus
Pedestal = ecalPresampleTask.MEs.Pedestal
),
MEs = cms.untracked.PSet(
RMS = cms.untracked.PSet(
Expand Down Expand Up @@ -64,16 +62,6 @@
btype = cms.untracked.string('SuperCrystal'),
description = cms.untracked.string('2D distribution of the presample RMS. Channels with entries less than ' + str(minChannelEntries) + ' are not considered.')
),
RMSMapAllByLumi = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sSummaryClient/%(prefix)sPOT%(suffix)s pedestal G12 RMS map by lumi'),
kind = cms.untracked.string('TH2F'),
zaxis = cms.untracked.PSet(
title = cms.untracked.string('RMS')
),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('Crystal'),
description = cms.untracked.string('2D distribution of the presample RMS in this lumisection. Channels with entries less than ' + str(minChannelEntries) + ' are not considered.')
),
TrendMean = cms.untracked.PSet(
path = cms.untracked.string('Ecal/Trends/PresampleClient %(prefix)s pedestal mean max - min'),
kind = cms.untracked.string('TProfile'),
Expand Down
4 changes: 0 additions & 4 deletions DQM/EcalMonitorClient/python/SummaryClient_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@
),
sources = cms.untracked.PSet(
Integrity = ecalIntegrityClient.MEs.QualitySummary,
IntegrityByLumi = ecalIntegrityTask.MEs.ByLumi,
Presample = ecalPresampleClient.MEs.QualitySummary,
Timing = ecalTimingClient.MEs.QualitySummary,
RawData = ecalRawDataClient.MEs.QualitySummary,
DesyncByLumi = ecalRawDataTask.MEs.DesyncByLumi,
FEByLumi = ecalRawDataTask.MEs.FEByLumi,
FEStatusErrMapByLumi = ecalRawDataTask.MEs.FEStatusErrMapByLumi,
TriggerPrimitives = ecalTrigPrimClient.MEs.EmulQualitySummary,
HotCell = ecalOccupancyClient.MEs.QualitySummary,
BXSRP = ecalRawDataTask.MEs.BXSRP,
Expand Down
2 changes: 0 additions & 2 deletions DQM/EcalMonitorClient/python/TimingClient_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
sources = cms.untracked.PSet(
TimeAllMap = ecalTimingTask.MEs.TimeAllMap,
TimeMap = ecalTimingTask.MEs.TimeMap,
TimeMapByLS = ecalTimingTask.MEs.TimeMapByLS,
ChStatus = ecalIntegrityClient.MEs.ChStatus
),
MEs = cms.untracked.PSet(
RMSAll = cms.untracked.PSet(
Expand Down
9 changes: 0 additions & 9 deletions DQM/EcalMonitorClient/python/TrigPrimClient_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
EtEmulError = ecalTrigPrimTask.MEs.EtEmulError,
MatchedIndex = ecalTrigPrimTask.MEs.MatchedIndex,
TTFlags4 = ecalTrigPrimTask.MEs.TTFlags4,
TTFlags4ByLumi = ecalTrigPrimTask.MEs.TTFlags4ByLumi,
TTMaskMapAll = ecalTrigPrimTask.MEs.TTMaskMapAll,
TTFMismatch = ecalTrigPrimTask.MEs.TTFMismatch,
LHCStatusByLumi = ecalTrigPrimTask.MEs.LHCStatusByLumi,
TPDigiThrAll = ecalOccupancyTask.MEs.TPDigiThrAll
),
MEs = cms.untracked.PSet(
Expand Down Expand Up @@ -59,13 +57,6 @@
btype = cms.untracked.string('TriggerTower'),
description = cms.untracked.string('Summarizes whether a TT was masked in the TPGRecords, or had an instance of TT Flag=4.<br/>GRAY: Masked, no TTF4,<br/>BLACK: Masked, with TTF4,<br/>BLUE: Not Masked, with TTF4.')
),
TTF4vMaskByLumi = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sTriggerTowerTask/%(prefix)sTTT TTF4 vs Masking Status%(suffix)s by lumi'),
kind = cms.untracked.string('TH2F'),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('TriggerTower'),
description = cms.untracked.string('Summarizes whether a TT was masked in this lumisection in the TPGRecords, or had an instance of TT Flag=4.<br/>GRAY: Masked, no TTF4,<br/>BLACK: Masked, with TTF4,<br/>BLUE: Not Masked, with TTF4.')
),
TrendTTF4Flags = cms.untracked.PSet(
path = cms.untracked.string('Ecal/Trends/TrigPrimClient %(prefix)s number of TTs with TTF4 set'),
kind = cms.untracked.string('TProfile'),
Expand Down
11 changes: 0 additions & 11 deletions DQM/EcalMonitorClient/src/DQWorkerClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,6 @@ namespace ecaldqm {
}
}

void DQWorkerClient::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) {
// MESetChannel class removed until concurrency issue is finalized
#if 0
for(MESetCollection::iterator sItr(sources_.begin()); sItr != sources_.end(); ++sItr){
if(!sItr->second->getLumiFlag()) continue;
MESetChannel const* channel(dynamic_cast<MESetChannel const*>(sItr->second));
if(channel) channel->checkDirectory();
}
#endif
}

void DQWorkerClient::bookMEs(DQMStore::IBooker& _ibooker) {
DQWorker::bookMEs(_ibooker);
resetMEs();
Expand Down
32 changes: 0 additions & 32 deletions DQM/EcalMonitorClient/src/IntegrityClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,13 @@ namespace ecaldqm {
errFractionThreshold_ = _params.getUntrackedParameter<double>("errFractionThreshold");
}

// Check Channel Status Record at every endLumi
// Used to fill Channel Status Map MEs
void IntegrityClient::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const& _es) {
_es.get<EcalChannelStatusRcd>().get(chStatus);
}

void IntegrityClient::producePlots(ProcessType) {
uint32_t mask(1 << EcalDQMStatusHelper::CH_ID_ERROR | 1 << EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR |
1 << EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR | 1 << EcalDQMStatusHelper::TT_ID_ERROR |
1 << EcalDQMStatusHelper::TT_SIZE_ERROR);

MESet& meQuality(MEs_.at("Quality"));
MESet& meQualitySummary(MEs_.at("QualitySummary"));
MESet& meChStatus(MEs_.at("ChStatus"));

MESet const& sOccupancy(sources_.at("Occupancy"));
MESet const& sGain(sources_.at("Gain"));
Expand All @@ -42,31 +35,6 @@ namespace ecaldqm {
MESet const& sTowerId(sources_.at("TowerId"));
MESet const& sBlockSize(sources_.at("BlockSize"));

// Fill Channel Status Map MEs
// Record is checked for updates at every endLumi and filled here
MESet::iterator chSEnd(meChStatus.end());
for (MESet::iterator chSItr(meChStatus.beginChannel()); chSItr != chSEnd; chSItr.toNextChannel()) {
DetId id(chSItr->getId());

EcalChannelStatusMap::const_iterator chIt(nullptr);

// Set appropriate channel map (EB or EE)
if (id.subdetId() == EcalBarrel) {
EBDetId ebid(id);
chIt = chStatus->find(ebid);
} else {
EEDetId eeid(id);
chIt = chStatus->find(eeid);
}

// Get status code and fill ME
if (chIt != chStatus->end()) {
uint16_t code(chIt->getEncodedStatusCode());
chSItr->setBinContent(code);
}

} // Channel Status Map

MESet::iterator qEnd(meQuality.end());
MESet::const_iterator occItr(sOccupancy);
for (MESet::iterator qItr(meQuality.beginChannel()); qItr != qEnd; qItr.toNextChannel()) {
Expand Down
35 changes: 0 additions & 35 deletions DQM/EcalMonitorClient/src/PresampleClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,19 @@ namespace ecaldqm {
MESet& meRMS(MEs_.at("RMS"));
MESet& meRMSMap(MEs_.at("RMSMap"));
MESet& meRMSMapAll(MEs_.at("RMSMapAll"));
MESet& meRMSMapAllByLumi(MEs_.at("RMSMapAllByLumi"));

MESet const& sPedestal(sources_.at("Pedestal"));
MESet const& sPedestalByLS(sources_.at("PedestalByLS"));
MESet const& sChStatus(sources_.at("ChStatus"));

uint32_t mask(1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_MEAN_ERROR |
1 << EcalDQMStatusHelper::PEDESTAL_ONLINE_HIGH_GAIN_RMS_ERROR);

MESet::iterator qEnd(meQuality.end());

MESet::const_iterator pItr(sPedestal);
MESet::const_iterator pLSItr(sPedestalByLS);
double maxEB(0.), minEB(0.), maxEE(0.), minEE(0.);
double rmsMaxEB(0.), rmsMaxEE(0.);
for (MESet::iterator qItr(meQuality.beginChannel()); qItr != qEnd; qItr.toNextChannel()) {
pItr = qItr;
pLSItr = qItr;

DetId id(qItr->getId());

Expand All @@ -68,7 +63,6 @@ namespace ecaldqm {
rmsThresh = toleranceRMSFwd_;

double entries(pItr->getBinEntries());
double entriesLS(pLSItr->getBinEntries());

if (entries < minChannelEntries_) {
qItr->setBinContent(doMask ? kMUnknown : kUnknown);
Expand All @@ -78,16 +72,13 @@ namespace ecaldqm {
}

double mean(pItr->getBinContent());
double meanLS(pLSItr->getBinContent());
double rms(pItr->getBinError() * std::sqrt(entries));
double rmsLS(pLSItr->getBinError() * std::sqrt(entriesLS));

int dccid(dccId(id));

meMean.fill(dccid, mean);
meRMS.fill(dccid, rms);
meRMSMap.setBinContent(id, rms);
meRMSMapAllByLumi.setBinContent(id, rmsLS);

if (((mean > expectedMean_ + toleranceHigh_) || (mean < expectedMean_ - toleranceLow_)) || rms > rmsThresh) {
qItr->setBinContent(doMask ? kMBad : kBad);
Expand All @@ -99,32 +90,6 @@ namespace ecaldqm {
meQualitySummary.setBinContent(id, doMask ? kMGood : kGood);
}

// Fill Presample Trend plots:
// Use PedestalByLS which only contains digis from "current" LS
float chStatus(sChStatus.getBinContent(id));
if (entriesLS < minChannelEntries_)
continue;
if (chStatus != EcalChannelStatusCode::kOk)
continue; // exclude problematic channels

// Get max/min
// Min is effectively just 0
if (id.subdetId() == EcalBarrel) {
if (meanLS > maxEB)
maxEB = meanLS;
if (meanLS < minEB)
minEB = meanLS;
if (rmsLS > rmsMaxEB)
rmsMaxEB = rmsLS;
} else {
if (meanLS > maxEE)
maxEE = meanLS;
if (meanLS < minEE)
minEE = meanLS;
if (rmsLS > rmsMaxEE)
rmsMaxEE = rmsLS;
}

} // qItr

towerAverage_(meRMSMapAll, meRMSMap, -1.);
Expand Down
Loading