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"));
38 MESet& meReportSummaryContents(
MEs_.at(
"ReportSummaryContents"));
39 MESet& meReportSummary(
MEs_.at(
"ReportSummary"));
41 MESet const& sIntegrityByLumi(
sources_.at(
"IntegrityByLumi"));
47 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
49 meReportSummaryContents.fill(dccid, 1.);
51 meReportSummary.fill(1.);
53 if(_pType ==
kLumi)
return;
55 double integrityByLumi[
nDCC];
56 double rawDataByLumi[
nDCC];
57 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
58 integrityByLumi[iDCC] = sIntegrityByLumi.getBinContent(iDCC + 1);
59 rawDataByLumi[iDCC] = sDesyncByLumi.getBinContent(iDCC + 1) + sFEByLumi.getBinContent(iDCC + 1);
62 MESet& meQualitySummary(
MEs_.at(
"QualitySummary"));
63 MESet& meReportSummaryMap(
MEs_.at(
"ReportSummaryMap"));
69 MESet const* sTriggerPrimitives(
using_(
"TriggerPrimitives") ? &
sources_.at(
"TriggerPrimitives") : 0);
72 float totalChannels(0.);
75 double dccChannels[
nDCC];
76 std::fill_n(dccChannels, nDCC, 0.);
78 std::fill_n(dccGood, nDCC, 0.);
80 std::map<uint32_t, int> badChannelsCount;
86 DetId id(qItr->getId());
87 unsigned iDCC(
dccId(
id) - 1);
91 int integrity(iItr->getBinContent());
94 qItr->setBinContent(integrity);
98 int presample(sPresample ? sPresample->getBinContent(
id) :
kUnknown);
99 int hotcell(sHotCell ? sHotCell->getBinContent(
id) :
kUnknown);
100 int timing(sTiming ? sTiming->getBinContent(
id) :
kUnknown);
101 int trigprim(sTriggerPrimitives ? sTriggerPrimitives->getBinContent(
id) :
kUnknown);
103 int rawdata(sRawData.getBinContent(
id));
105 if(integrity ==
kBad && integrityByLumi[iDCC] == 0.) integrity =
kGood;
114 qItr->setBinContent(status);
124 dccChannels[iDCC] += 1.;
130 for(
int iz(-1); iz < 2; iz += 2){
131 for(
int ieta(0); ieta < 17; ++ieta){
132 if(iz == 1 && ieta == 0)
continue;
133 for(
int iphi(1); iphi <= 72; ++iphi){
135 unsigned badTowers(0);
136 for(
int deta(0); deta < 2; ++deta){
137 int ttz(ieta == 0 && deta == 0 ? -1 : iz);
138 int tteta(ieta == 0 && deta == 0 ? 1 : ieta + deta);
139 for(
int dphi(0); dphi < 2; ++dphi){
140 int ttphi(iphi != 72 ? iphi + dphi : 1);
142 ttids[deta * 2 + dphi] = ttid;
150 for(
unsigned iD(0); iD < 4; ++iD)
151 dccGood[
dccId(ttids[iD]) - 1] = 0.;
156 for(
int iz(-1); iz <= 1; iz += 2){
157 for(
int ix(1); ix < 20; ++ix){
158 for(
int iy(1); iy < 20; ++iy){
160 unsigned badTowers(0);
161 for(
int dx(0); dx < 2; ++dx){
162 for(
int dy(0); dy < 2; ++dy){
168 scids[dx * 2 + dy] = scid;
177 for(
unsigned iD(0); iD < 4; ++iD){
179 if(scid.
null())
continue;
180 dccGood[
dccId(scid) - 1] = 0.;
189 for(
unsigned iDCC(0); iDCC <
nDCC; ++iDCC){
190 if(dccChannels[iDCC] < 1.)
continue;
193 float frac(dccGood[iDCC] / dccChannels[iDCC]);
194 meReportSummaryMap.setBinContent(dccid, frac);
195 meReportSummaryContents.fill(dccid, frac);
200 if(totalChannels > 0.) meReportSummary.fill(totalGood / totalChannels);
203 if(totalChannels > 0.)
MEs_.at(
"GlobalSummary").setBinContent(1, totalGood / totalChannels);
204 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
bool using_(std::string const &_name, ProcessType _type=kRun) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const_iterator & toNextChannel()
DEFINE_ECALDQM_WORKER(CalibrationSummaryClient)
uint32_t rawId() const
get the raw id
void producePlots(ProcessType) override
std::set< std::string > qualitySummaries_
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 &)