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.);
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"));
73 double integrityByLumi[
nDCC];
74 double rawDataByLumi[
nDCC];
75 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
76 integrityByLumi[iDCC] = sIntegrityByLumi.
getBinContent(iDCC + 1);
77 rawDataByLumi[iDCC] = sDesyncByLumi.getBinContent(iDCC + 1) + sFEByLumi.getBinContent(iDCC + 1);
80 MESet& meQualitySummary(
MEs_.at(
"QualitySummary"));
81 MESet& meReportSummaryMap(
MEs_.at(
"ReportSummaryMap"));
87 MESet const* sTriggerPrimitives(
using_(
"TriggerPrimitives") ? &
sources_.at(
"TriggerPrimitives") : 0);
90 float totalChannels(0.);
93 double dccChannels[
nDCC];
94 std::fill_n(dccChannels, nDCC, 0.);
96 std::fill_n(dccGood, nDCC, 0.);
98 std::map<uint32_t, int> badChannelsCount;
104 DetId id(qItr->getId());
105 unsigned iDCC(
dccId(
id) - 1);
109 int integrity(iItr->getBinContent());
112 qItr->setBinContent(integrity);
116 int presample(sPresample ? sPresample->getBinContent(
id) :
kUnknown);
117 int hotcell(sHotCell ? sHotCell->getBinContent(
id) :
kUnknown);
118 int timing(sTiming ? sTiming->getBinContent(
id) :
kUnknown);
119 int trigprim(sTriggerPrimitives ? sTriggerPrimitives->getBinContent(
id) :
kUnknown);
121 int rawdata(sRawData.getBinContent(
id));
123 if(integrity ==
kBad && integrityByLumi[iDCC] == 0.) integrity =
kGood;
132 qItr->setBinContent(status);
142 dccChannels[iDCC] += 1.;
148 for(
int iz(-1); iz < 2; iz += 2){
149 for(
int ieta(0); ieta < 17; ++ieta){
150 if(iz == 1 && ieta == 0)
continue;
151 for(
int iphi(1); iphi <= 72; ++iphi){
153 unsigned badTowers(0);
154 for(
int deta(0); deta < 2; ++deta){
155 int ttz(ieta == 0 && deta == 0 ? -1 : iz);
156 int tteta(ieta == 0 && deta == 0 ? 1 : ieta + deta);
157 for(
int dphi(0); dphi < 2; ++dphi){
158 int ttphi(iphi != 72 ? iphi + dphi : 1);
160 ttids[deta * 2 + dphi] = ttid;
168 for(
unsigned iD(0); iD < 4; ++iD)
169 dccGood[
dccId(ttids[iD]) - 1] = 0.;
174 for(
int iz(-1); iz <= 1; iz += 2){
175 for(
int ix(1); ix < 20; ++ix){
176 for(
int iy(1); iy < 20; ++iy){
178 unsigned badTowers(0);
179 for(
int dx(0); dx < 2; ++dx){
180 for(
int dy(0); dy < 2; ++dy){
186 scids[dx * 2 + dy] = scid;
195 for(
unsigned iD(0); iD < 4; ++iD){
197 if(scid.
null())
continue;
198 dccGood[
dccId(scid) - 1] = 0.;
207 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
208 if(dccChannels[iDCC] < 1.)
continue;
211 float frac(dccGood[iDCC] / dccChannels[iDCC]);
212 meReportSummaryMap.setBinContent(dccid, frac);
213 meReportSummaryContents.fill(dccid, frac);
218 if(totalChannels > 0.) meReportSummary.fill(totalGood / totalChannels);
221 if(totalChannels > 0.)
MEs_.at(
"GlobalSummary").setBinContent(1, totalGood / totalChannels);
222 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 &)