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.);
91 double dccChannels[
nDCC];
92 std::fill_n(dccChannels, nDCC, 0.);
94 std::fill_n(dccGood, nDCC, 0.);
96 std::map<uint32_t, int> badChannelsCount;
101 DetId id(qItr->getId());
102 unsigned iDCC(
dccId(
id) - 1);
104 int integrity(sIntegrity ? sIntegrity->getBinContent(
id) :
kUnknown);
107 qItr->setBinContent(integrity);
111 int presample(sPresample ? sPresample->getBinContent(
id) :
kUnknown);
112 int hotcell(sHotCell ? sHotCell->getBinContent(
id) :
kUnknown);
113 int timing(sTiming ? sTiming->getBinContent(
id) :
kUnknown);
114 int trigprim(sTriggerPrimitives ? sTriggerPrimitives->getBinContent(
id) :
kUnknown);
116 int rawdata(sRawData.getBinContent(
id));
118 if(integrity ==
kBad && integrityByLumi[iDCC] == 0.) integrity =
kGood;
128 qItr->setBinContent(status);
138 dccChannels[iDCC] += 1.;
144 for(
int iz(-1); iz < 2; iz += 2){
145 for(
int ieta(0); ieta < 17; ++ieta){
146 if(iz == 1 && ieta == 0)
continue;
147 for(
int iphi(1); iphi <= 72; ++iphi){
149 unsigned badTowers(0);
150 for(
int deta(0); deta < 2; ++deta){
151 int ttz(ieta == 0 && deta == 0 ? -1 : iz);
152 int tteta(ieta == 0 && deta == 0 ? 1 : ieta + deta);
153 for(
int dphi(0); dphi < 2; ++dphi){
154 int ttphi(iphi != 72 ? iphi + dphi : 1);
156 ttids[deta * 2 + dphi] = ttid;
164 for(
unsigned iD(0); iD < 4; ++iD)
165 dccGood[
dccId(ttids[iD]) - 1] = 0.;
170 for(
int iz(-1); iz <= 1; iz += 2){
171 for(
int ix(1); ix < 20; ++ix){
172 for(
int iy(1); iy < 20; ++iy){
174 unsigned badTowers(0);
175 for(
int dx(0); dx < 2; ++dx){
176 for(
int dy(0); dy < 2; ++dy){
182 scids[dx * 2 + dy] = scid;
191 for(
unsigned iD(0); iD < 4; ++iD){
193 if(scid.
null())
continue;
194 dccGood[
dccId(scid) - 1] = 0.;
203 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
204 if(dccChannels[iDCC] < 1.)
continue;
207 float frac(dccGood[iDCC] / dccChannels[iDCC]);
208 meReportSummaryMap.setBinContent(dccid, frac);
209 meReportSummaryContents.fill(dccid, frac);
214 if(totalChannels > 0.) meReportSummary.fill(totalGood / totalChannels);
217 if(totalChannels > 0.)
MEs_.at(
"GlobalSummary").setBinContent(1, totalGood / totalChannels);
218 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 &)