1 #include "../interface/SummaryClient.h"
13 towerBadFraction_(0.),
28 std::vector<std::string> sourceList(_params.
getUntrackedParameter<std::vector<std::string> >(
"activeSources"));
31 if(
std::find(sourceList.begin(), sourceList.end(),
"TriggerPrimitives") == sourceList.end())
sources_.erase(
std::string(
"TriggerPrimitives"));
40 MESet& meReportSummaryContents(
MEs_.at(
"ReportSummaryContents"));
41 MESet& meReportSummary(
MEs_.at(
"ReportSummary"));
42 MESet& meReportSummaryMap(
MEs_.at(
"ReportSummaryMap"));
44 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
46 meReportSummaryContents.fill(dccid, -1.);
49 meReportSummary.fill(-1.);
51 meReportSummaryMap.reset(-1.);
58 MESet& meReportSummaryContents(
MEs_.at(
"ReportSummaryContents"));
59 MESet& meReportSummary(
MEs_.at(
"ReportSummary"));
61 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
63 meReportSummaryContents.fill(dccid, -1.);
65 meReportSummary.fill(-1.);
67 MESet const& sIntegrityByLumi(
sources_.at(
"IntegrityByLumi"));
71 double integrityByLumi[
nDCC];
72 double rawDataByLumi[
nDCC];
73 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
74 integrityByLumi[iDCC] = sIntegrityByLumi.
getBinContent(iDCC + 1);
75 rawDataByLumi[iDCC] = sDesyncByLumi.getBinContent(iDCC + 1) + sFEByLumi.getBinContent(iDCC + 1);
78 MESet& meQualitySummary(
MEs_.at(
"QualitySummary"));
79 MESet& meReportSummaryMap(
MEs_.at(
"ReportSummaryMap"));
85 MESet const* sTriggerPrimitives(
using_(
"TriggerPrimitives") ? &
sources_.at(
"TriggerPrimitives") : 0);
88 float totalChannels(0.);
89 float totalGood(0.), totalGoodRaw(0);
91 double dccChannels[
nDCC];
92 std::fill_n(dccChannels, nDCC, 0.);
93 double dccGood[
nDCC], dccGoodRaw[
nDCC];
94 std::fill_n(dccGood, nDCC, 0.);
95 std::fill_n(dccGoodRaw, nDCC, 0.);
97 std::map<uint32_t, int> badChannelsCount;
103 std::vector<bool> hasMismatchDCC(nDCC,
false);
104 for (
unsigned iDCC(0); iDCC <
nDCC; ++iDCC ) {
105 if ( sBXSRP.getBinContent(iDCC + 1) > 50. || sBXTCC.getBinContent(iDCC + 1) > 50. )
106 hasMismatchDCC[iDCC] =
true;
112 DetId id(qItr->getId());
113 unsigned iDCC(
dccId(
id) - 1);
117 int integrity(sIntegrity ? sIntegrity->getBinContent(
id) :
kUnknown);
119 qItr->setBinContent(integrity);
122 int presample(sPresample ? sPresample->getBinContent(
id) :
kUnknown);
123 int hotcell(sHotCell ? sHotCell->getBinContent(
id) :
kUnknown);
124 int timing(sTiming ? sTiming->getBinContent(
id) :
kUnknown);
125 int trigprim(sTriggerPrimitives ? sTriggerPrimitives->getBinContent(
id) :
kUnknown);
126 int rawdata(sRawData.getBinContent(
id));
130 if(integrity ==
kBad && integrityByLumi[iDCC] == 0. && !hasMismatchDCC[iDCC]) integrity =
kGood;
139 qItr->setBinContent(status);
150 dccChannels[iDCC] += 1.;
156 dccGoodRaw[iDCC] += 1.;
166 for(
int iz(-1); iz < 2; iz += 2){
167 for(
int ieta(0); ieta < 17; ++ieta){
168 if(iz == 1 && ieta == 0)
continue;
169 for(
int iphi(1); iphi <= 72; ++iphi){
171 unsigned badTowers(0);
172 for(
int deta(0); deta < 2; ++deta){
173 int ttz(ieta == 0 && deta == 0 ? -1 : iz);
174 int tteta(ieta == 0 && deta == 0 ? 1 : ieta + deta);
175 for(
int dphi(0); dphi < 2; ++dphi){
176 int ttphi(iphi != 72 ? iphi + dphi : 1);
178 ttids[deta * 2 + dphi] = ttid;
185 for(
unsigned iD(0); iD < 4; ++iD)
186 dccGood[
dccId(ttids[iD]) - 1] = 0.;
193 for(
int iz(-1); iz <= 1; iz += 2){
194 for(
int ix(1); ix < 20; ++ix){
195 for(
int iy(1); iy < 20; ++iy){
197 unsigned badTowers(0);
198 for(
int dx(0); dx < 2; ++dx){
199 for(
int dy(0); dy < 2; ++dy){
205 scids[dx * 2 + dy] = scid;
213 for(
unsigned iD(0); iD < 4; ++iD){
215 if(scid.
null())
continue;
216 dccGood[
dccId(scid) - 1] = 0.;
227 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
228 if(dccChannels[iDCC] < 1.)
continue;
231 float frac(dccGood[iDCC] / dccChannels[iDCC]);
232 float fracRaw(dccGoodRaw[iDCC] / dccChannels[iDCC]);
233 meReportSummaryMap.setBinContent(dccid, frac);
235 meReportSummaryContents.fill(dccid, fracLS);
240 float totalGoodLS(
onlineMode_ ? totalGood : totalGoodRaw);
241 if(totalChannels > 0.) meReportSummary.fill(totalGoodLS / totalChannels);
244 if(totalChannels > 0.)
MEs_.at(
"GlobalSummary").setBinContent(1, totalGood / totalChannels);
245 MEs_.at(
"NBadFEDs").setBinContent(1, nBad);
static bool validDetId(int ix, int iy, int iz)
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()
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
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
bool null() const
is this a null id ?
std::vector< DetId > scConstituents(EcalScDetId const &)
unsigned dccId(DetId const &)