1 #include "../interface/SummaryClient.h" 15 towerBadFraction_(0.),
30 std::vector<std::string> sourceList(_params.
getUntrackedParameter<std::vector<std::string> >(
"activeSources"));
33 if(
std::find(sourceList.begin(), sourceList.end(),
"TriggerPrimitives") == sourceList.end())
sources_.erase(
std::string(
"TriggerPrimitives"));
42 MESet& meReportSummaryContents(
MEs_.at(
"ReportSummaryContents"));
43 MESet& meReportSummary(
MEs_.at(
"ReportSummary"));
44 MESet& meReportSummaryMap(
MEs_.at(
"ReportSummaryMap"));
46 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
48 meReportSummaryContents.fill(dccid, -1.);
51 meReportSummary.fill(-1.);
53 meReportSummaryMap.reset(-1.);
60 MESet& meReportSummaryContents(
MEs_.at(
"ReportSummaryContents"));
61 MESet& meReportSummary(
MEs_.at(
"ReportSummary"));
63 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
65 meReportSummaryContents.fill(dccid, -1.);
67 meReportSummary.fill(-1.);
69 MESet const& sIntegrityByLumi(
sources_.at(
"IntegrityByLumi"));
72 MESet const& sFEStatusErrMapByLumi(
sources_.at(
"FEStatusErrMapByLumi"));
74 double integrityByLumi[
nDCC];
75 double rawDataByLumi[
nDCC];
76 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
77 integrityByLumi[iDCC] = sIntegrityByLumi.
getBinContent(iDCC + 1);
78 rawDataByLumi[iDCC] = sDesyncByLumi.getBinContent(iDCC + 1) + sFEByLumi.getBinContent(iDCC + 1);
81 MESet& meQualitySummary(
MEs_.at(
"QualitySummary"));
82 MESet& meReportSummaryMap(
MEs_.at(
"ReportSummaryMap"));
88 MESet const* sTriggerPrimitives(
using_(
"TriggerPrimitives") ? &
sources_.at(
"TriggerPrimitives") :
nullptr);
91 float totalChannels(0.);
92 float totalGood(0.), totalGoodRaw(0);
94 double dccChannels[
nDCC];
95 std::fill_n(dccChannels, nDCC, 0.);
96 double dccGood[
nDCC], dccGoodRaw[
nDCC];
97 std::fill_n(dccGood, nDCC, 0.);
98 std::fill_n(dccGoodRaw, nDCC, 0.);
100 std::map<uint32_t, int> badChannelsCount;
106 std::vector<bool> hasMismatchDCC(nDCC,
false);
107 for (
unsigned iDCC(0); iDCC <
nDCC; ++iDCC ) {
108 if ( sBXSRP.getBinContent(iDCC + 1) > 50. || sBXTCC.getBinContent(iDCC + 1) > 50. )
109 hasMismatchDCC[iDCC] =
true;
119 unsigned iDCC(
dccId(
id) - 1);
123 int integrity(sIntegrity ? sIntegrity->getBinContent(
id) :
kUnknown);
124 int presample(sPresample ? sPresample->getBinContent(
id) :
kUnknown);
125 int hotcell(sHotCell ? sHotCell->getBinContent(
id) :
kUnknown);
126 int timing(sTiming ? sTiming->getBinContent(
id) :
kUnknown);
127 int trigprim(sTriggerPrimitives ? sTriggerPrimitives->getBinContent(
id) :
kUnknown);
128 int rawdata(sRawData.getBinContent(
id));
130 double rawdataLS(sFEStatusErrMapByLumi.getBinContent(
id));
134 if(integrity ==
kBad && integrityByLumi[iDCC] == 0. && !hasMismatchDCC[iDCC]) integrity =
kGood;
148 qItr->setBinContent(integrity);
151 qItr->setBinContent(status);
162 dccChannels[iDCC] += 1.;
167 bool isMasked(meQualitySummary.maskMatches(
id, mask,
statusManager_));
168 if( rawdataLS == 0. || isMasked ){
169 dccGoodRaw[iDCC] += 1.;
240 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
241 if(dccChannels[iDCC] < 1.)
continue;
244 float frac(dccGood[iDCC] / dccChannels[iDCC]);
245 float fracRaw(dccGoodRaw[iDCC] / dccChannels[iDCC]);
246 meReportSummaryMap.setBinContent(dccid, frac);
248 meReportSummaryContents.fill(dccid, fracLS);
253 float totalGoodLS(
onlineMode_ ? totalGood : totalGoodRaw);
254 if(totalChannels > 0.) meReportSummary.fill(totalGoodLS / totalChannels);
257 if(totalChannels > 0.)
MEs_.at(
"GlobalSummary").setBinContent(1, totalGood / totalChannels);
258 MEs_.at(
"NBadFEDs").setBinContent(1, nBad);
void setParams(edm::ParameterSet const &) override
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_ECALDQM_WORKER(TYPE)
bool using_(std::string const &_name, ProcessType _type=kJob) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const_iterator & toNextChannel()
static const int STATUS_FLAG_ERROR
uint32_t rawId() const
get the raw id
void producePlots(ProcessType) override
std::set< std::string > qualitySummaries_
virtual double getBinContent(DetId const &, int=0) const
StatusManager const * statusManager_
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
unsigned dccId(DetId const &)