Skip to content

Commit

Permalink
Merge pull request #16305 from mbandrews/FixFELumi81X
Browse files Browse the repository at this point in the history
Revert FEStatus to run based. Get LS reports from FEMap instead.
  • Loading branch information
cmsbuild committed Oct 25, 2016
2 parents b0f0014 + 37e9e77 commit 6f1691a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
1 change: 0 additions & 1 deletion DQM/EcalMonitorClient/python/RawDataClient_cfi.py
Expand Up @@ -20,7 +20,6 @@
kind = cms.untracked.string('TH2F'),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('SuperCrystal'),
perLumi = cms.untracked.bool(True),
description = cms.untracked.string('Summary of the raw data (DCC and front-end) quality. A channel is red if it has nonzero events with FE status that is different from any of ENABLED, DISABLED, SUPPRESSED, FIFOFULL, FIFOFULL_L1ADESYNC, and FORCEDZS. A FED can also go red if its number of L1A desynchronization errors is greater than ' + str(synchErrThresholdFactor) + ' * log10(total entries).')
),
ErrorsSummary = cms.untracked.PSet(
Expand Down
1 change: 1 addition & 0 deletions DQM/EcalMonitorClient/python/SummaryClient_cfi.py
Expand Up @@ -27,6 +27,7 @@
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
26 changes: 18 additions & 8 deletions DQM/EcalMonitorClient/src/SummaryClient.cc
Expand Up @@ -2,6 +2,8 @@

#include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"

#include "CondFormats/EcalObjects/interface/EcalDQMStatusHelper.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include <algorithm>
Expand Down Expand Up @@ -66,7 +68,8 @@ namespace ecaldqm

MESet const& sIntegrityByLumi(sources_.at("IntegrityByLumi"));
MESet const& sDesyncByLumi(sources_.at("DesyncByLumi"));
MESet const& sFEByLumi(sources_.at("FEByLumi"));
MESet const& sFEByLumi(sources_.at("FEByLumi")); // Does NOT include FE=Disabled
MESet const& sFEStatusErrMapByLumi(sources_.at("FEStatusErrMapByLumi")); // Includes FE=Disabled

double integrityByLumi[nDCC];
double rawDataByLumi[nDCC];
Expand Down Expand Up @@ -96,16 +99,19 @@ namespace ecaldqm

std::map<uint32_t, int> badChannelsCount;

// Override IntegrityByLumi check if Desync errors present
// Override IntegrityByLumi check if any Desync errors present
// Used to set an entire FED to BAD
MESet const& sBXSRP(sources_.at("BXSRP"));
MESet const& sBXTCC(sources_.at("BXTCC"));
std::vector<bool> hasMismatchDCC(nDCC,false);
for ( unsigned iDCC(0); iDCC < nDCC; ++iDCC ) {
if ( sBXSRP.getBinContent(iDCC + 1) > 50. || sBXTCC.getBinContent(iDCC + 1) > 50. ) // "any" => 50
if ( sBXSRP.getBinContent(iDCC + 1) > 50. || sBXTCC.getBinContent(iDCC + 1) > 50. ) // "any" = 50
hasMismatchDCC[iDCC] = true;
}

// Get RawData mask
uint32_t mask(1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR);

MESet::iterator qEnd(meQualitySummary.end());
for(MESet::iterator qItr(meQualitySummary.beginChannel()); qItr != qEnd; qItr.toNextChannel()){

Expand All @@ -120,11 +126,14 @@ namespace ecaldqm
int timing(sTiming ? sTiming->getBinContent(id) : kUnknown);
int trigprim(sTriggerPrimitives ? sTriggerPrimitives->getBinContent(id) : kUnknown);
int rawdata(sRawData.getBinContent(id));

double rawdataLS(sFEStatusErrMapByLumi.getBinContent(id)); // Includes FE=Disabled

// If there are no RawData or Integrity errors in this LS, set them back to GOOD
//if(integrity == kBad && integrityByLumi[iDCC] == 0.) integrity = kGood;
if(integrity == kBad && integrityByLumi[iDCC] == 0. && !hasMismatchDCC[iDCC]) integrity = kGood;
if(rawdata == kBad && rawDataByLumi[iDCC] == 0.) rawdata = kGood;
//if(rawdata == kBad && rawDataByLumi[iDCC] == 0.) rawdata = kGood;
if(rawdata == kBad && rawDataByLumi[iDCC] == 0. && rawdataLS == 0.) rawdata = kGood;

// Fill Global Quality Summary
int status(kGood);
Expand All @@ -141,7 +150,7 @@ namespace ecaldqm
}
qItr->setBinContent(status);

// Keep running count of good/bad channels/towers
// Keep running count of good/bad channels/towers: Uses cumulative stats.
if(status == kBad){
if(id.subdetId() == EcalBarrel) badChannelsCount[EBDetId(id).tower().rawId()] += 1;
if(id.subdetId() == EcalEndcap) badChannelsCount[EEDetId(id).sc().rawId()] += 1;
Expand All @@ -153,9 +162,10 @@ namespace ecaldqm
dccChannels[iDCC] += 1.;
totalChannels += 1.;

// Keep running count of good channels in RawData only:
// Only RawData used in by LS reporting to save memory
if(rawdata != kBad){
// Keep running count of good channels in RawData only: Uses LS stats only.
// LS-based reports only use RawData as input to save on having to run other workers
bool isMasked(meQualitySummary.maskMatches(id, mask, statusManager_));
if( rawdataLS == 0. || isMasked ){ // channel != kBad in rawdata
dccGoodRaw[iDCC] += 1.;
totalGoodRaw += 1.;
}
Expand Down
2 changes: 1 addition & 1 deletion DQM/EcalMonitorTasks/python/RawDataTask_cfi.py
Expand Up @@ -276,14 +276,14 @@
),
otype = cms.untracked.string('SM'),
btype = cms.untracked.string('SuperCrystal'),
perLumi = cms.untracked.bool(True),
description = cms.untracked.string('FE status counter.')
),
FEStatusErrMapByLumi = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sStatusFlagsTask/FEStatus/%(prefix)sSFT%(suffix)s front-end status error map by lumi'),
kind = cms.untracked.string('TH2F'),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('SuperCrystal'),
perLumi = cms.untracked.bool(True),
description = cms.untracked.string('FE status error occupancy map for this lumisection. Nominal FE status flags such as ENABLED, SUPPRESSED, FIFOFILL, FIFOFULLL1ADESYNC, and FORCEDZS are NOT included.')
)
)
Expand Down

0 comments on commit 6f1691a

Please sign in to comment.