30 EcalDQMChannelStatusEBMap() :
cond::payloadInspector::PlotImage<
EcalDQMChannelStatus>(
"ECAL Barrel DQM channel status") {
34 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
41 auto iov = iovs.front();
43 run = std::get < 0 > (iov);
47 if (payload->barrelItems().empty())
53 if (payload->find(rawid) == payload->end())
56 Double_t
weight =(Double_t)(*payload)[rawid].getStatusCode();
57 Double_t
phi = (Double_t)(
EBDetId(rawid)).iphi() - 0.5;
58 Double_t
eta = (Double_t)(
EBDetId(rawid)).ieta();
64 ebmap->Fill(phi, eta, weight);
67 ebmap_coarse->Fill(phi, eta);
74 gStyle->SetOptStat(0);
76 gStyle->SetFillColor(10);
77 gStyle->SetFrameFillColor(10);
78 gStyle->SetCanvasColor(10);
79 gStyle->SetPadColor(10);
80 gStyle->SetTitleFillColor(0);
81 gStyle->SetStatColor(10);
83 gStyle->SetFrameBorderMode(0);
84 gStyle->SetCanvasBorderMode(0);
85 gStyle->SetPadBorderMode(0);
87 gStyle->SetPalette(1);
89 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
90 Double_t
red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
91 Double_t
green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
92 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
93 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
94 gStyle->SetNumberContours(NCont);
96 TCanvas
c1(
"c1",
"c1", 1200, 700);
103 t1.SetTextSize(0.06);
105 ebmap->SetXTitle(
"i#phi");
106 ebmap->SetYTitle(
"i#eta");
107 ebmap->GetXaxis()->SetNdivisions(-418, kFALSE);
108 ebmap->GetYaxis()->SetNdivisions(-1702, kFALSE);
109 ebmap->GetXaxis()->SetLabelSize(0.03);
110 ebmap->GetYaxis()->SetLabelSize(0.03);
111 ebmap->GetXaxis()->SetTickLength(0.01);
112 ebmap->GetYaxis()->SetTickLength(0.01);
113 ebmap->SetMaximum(15);
118 ebmap_coarse->SetMarkerSize(1.3);
119 ebmap_coarse->Draw(
"text,same");
121 t1.SetTextSize(0.05);
122 t1.DrawLatex(0.5, 0.96, Form(
"EB DQM Channel Status, IOV %i", run));
125 Double_t prop = (Double_t) ebcount /
kEBChannels * 100.;
126 sprintf(txt,
"%d/61200 (%4.3f%%)", ebcount, prop);
128 t1.SetTextSize(0.045);
129 t1.DrawLatex(0.5, 0.91, txt);
132 c1.SaveAs(ImageName.c_str());
143 EcalDQMChannelStatusEEMap():
cond::payloadInspector::PlotImage<
EcalDQMChannelStatus>(
"ECAL EndCaps DQM channel status"){
147 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
151 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2 *
IX_MAX, 1,0,
IY_MAX);
155 unsigned int run = 0;
156 auto iov = iovs.front();
157 std::shared_ptr < EcalDQMChannelStatus > payload = fetchPayload(std::get < 1 > (iov));
158 run = std::get < 0 > (iov);
162 if (payload->endcapItems().empty())
166 for (
int iz = -1; iz < 2; iz = iz + 2)
173 uint32_t rawid = myEEId.
rawId();
175 if (payload->find(rawid) == payload->end())
178 float weight =(
float) (*payload)[rawid].getStatusCode();
181 eemap->Fill(ix - 1, iy - 1, weight);
184 eemap_coarse->Fill(ix - 1, iy - 1);
188 eemap->Fill(ix +
IX_MAX - 1, iy - 1, weight);
191 eemap_coarse->Fill(ix +
IX_MAX - 1, iy - 1);
198 gStyle->SetOptStat(0);
200 gStyle->SetFillColor(10);
201 gStyle->SetFrameFillColor(10);
202 gStyle->SetCanvasColor(10);
203 gStyle->SetPadColor(10);
204 gStyle->SetTitleFillColor(0);
205 gStyle->SetStatColor(10);
207 gStyle->SetFrameBorderMode(0);
208 gStyle->SetCanvasBorderMode(0);
209 gStyle->SetPadBorderMode(0);
211 gStyle->SetPalette(1);
213 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
214 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
215 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
216 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
217 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
218 gStyle->SetNumberContours(NCont);
222 for (Int_t j = 1; j <=
IY_MAX; j++) {
226 eetemp->SetBinContent(
i, j, 2);
227 eetemp->SetBinContent(
i +
IX_MAX, j, 2);
232 eetemp->SetFillColor(920);
233 TCanvas
c1(
"c1",
"c1", 1200, 600);
240 t1.SetTextSize(0.06);
242 eetemp->GetXaxis()->SetNdivisions(40, kFALSE);
243 eetemp->GetYaxis()->SetNdivisions(20, kFALSE);
244 eetemp->GetXaxis()->SetLabelSize(0.00);
245 eetemp->GetYaxis()->SetLabelSize(0.00);
246 eetemp->GetXaxis()->SetTickLength(0.01);
247 eetemp->GetYaxis()->SetTickLength(0.01);
248 eetemp->SetMaximum(1.15);
250 eemap->GetXaxis()->SetNdivisions(40, kFALSE);
251 eemap->GetYaxis()->SetNdivisions(20, kFALSE);
252 eemap->GetXaxis()->SetLabelSize(0.00);
253 eemap->GetYaxis()->SetLabelSize(0.00);
254 eemap->GetXaxis()->SetTickLength(0.01);
255 eemap->GetYaxis()->SetTickLength(0.01);
256 eemap->SetMaximum(15);
259 eemap->Draw(
"same,colz");
261 eemap_coarse->SetMarkerSize(2);
262 eemap_coarse->Draw(
"same,text");
265 t1.SetTextSize(0.055);
266 t1.DrawLatex(0.5, 0.96, Form(
"EE DQM Channel Status, IOV %i", run));
269 Double_t prop = (Double_t) eecount /
kEEChannels * 100.;
270 sprintf(txt,
"%d/14648 (%4.3f%%)", eecount, prop);
272 t1.SetTextSize(0.045);
273 t1.DrawLatex(0.5, 0.91, txt);
275 t1.SetTextSize(0.05);
276 t1.DrawLatex(0.14, 0.84,
"EE-");
277 t1.DrawLatex(0.86, 0.84,
"EE+");
280 c1.SaveAs(ImageName.c_str());
294 EcalDQMChannelStatusEBDiff() :
cond::payloadInspector::PlotImage<
EcalDQMChannelStatus>(
"ECAL Barrel DQM channel status difference") {
297 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
303 for (
auto const & iov: iovs) {
305 std::shared_ptr<EcalDQMChannelStatus> payload = fetchPayload( std::get<1>(iov) );
308 if (payload->barrelItems().empty())
311 run[irun] = std::get<0>(iov);
317 if (payload->find(rawid) == payload->end())
321 status[cellid] = (*payload)[rawid].getStatusCode();
324 unsigned int new_status = (*payload)[rawid].getStatusCode();
325 if(new_status !=
status[cellid]) {
328 if (new_status >
status[cellid])
333 Double_t phi = (Double_t)(
EBDetId(rawid)).iphi() - 0.5;
334 Double_t eta = (Double_t)(
EBDetId(rawid)).ieta();
340 ebmap->Fill(phi, eta, 0.05 + 0.95 * (tmp3>0));
342 ebmap_coarse->Fill(phi, eta, tmp3);
352 gStyle->SetOptStat(0);
354 gStyle->SetFillColor(10);
355 gStyle->SetFrameFillColor(10);
356 gStyle->SetCanvasColor(10);
357 gStyle->SetPadColor(10);
358 gStyle->SetTitleFillColor(0);
359 gStyle->SetStatColor(10);
361 gStyle->SetFrameBorderMode(0);
362 gStyle->SetCanvasBorderMode(0);
363 gStyle->SetPadBorderMode(0);
365 gStyle->SetPalette(1);
367 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
368 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
369 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
370 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
371 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
372 gStyle->SetNumberContours(NCont);
374 TCanvas
c1(
"c1",
"c1", 1200, 700);
381 t1.SetTextSize(0.06);
383 ebmap->SetXTitle(
"i#phi");
384 ebmap->SetYTitle(
"i#eta");
385 ebmap->GetXaxis()->SetNdivisions(-418,kFALSE);
386 ebmap->GetYaxis()->SetNdivisions(-1702,kFALSE);
387 ebmap->GetXaxis()->SetLabelSize(0.03);
388 ebmap->GetYaxis()->SetLabelSize(0.03);
389 ebmap->GetXaxis()->SetTickLength(0.01);
390 ebmap->GetYaxis()->SetTickLength(0.01);
391 ebmap->SetMaximum(1.15);
396 ebmap_coarse->SetMarkerSize(1.3);
397 ebmap_coarse->Draw(
"text,same");
399 t1.SetTextSize(0.05);
400 t1.DrawLatex(0.5, 0.96, Form(
"EB DQM Channel Status (Diff), IOV: %i vs %i", run[0], run[1]));
403 sprintf(txt,
"Net difference: %d channel(s)",ebcount);
405 t1.SetTextSize(0.045);
406 t1.DrawLatex(0.5, 0.91, txt);
409 c1.SaveAs(ImageName.c_str());
421 EcalDQMChannelStatusEEDiff() :
cond::payloadInspector::PlotImage<
EcalDQMChannelStatus>(
"ECAL Endcaps DQM channel status difference") {
422 setSingleIov(
true );
425 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
428 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2*
IX_MAX, 1, 0,
IY_MAX);
432 for (
auto const & iov: iovs) {
433 std::shared_ptr<EcalDQMChannelStatus> payload = fetchPayload( std::get<1>(iov) );
434 run[irun] = std::get<0>(iov);
436 if (payload->endcapItems().empty())
440 for(
int iz = -1; iz < 2; iz = iz + 2)
445 uint32_t rawid = myEEId.
rawId();
448 if (payload->find(rawid) == payload->end())
452 status[channel] = (*payload)[rawid].getStatusCode();
454 unsigned int new_status = (*payload)[rawid].getStatusCode();
455 if(new_status !=
status[channel]) {
457 if (new_status >
status[channel])
463 eemap->Fill(ix -1, iy -1, 0.05 + 0.95 * (tmp3>0));
465 eemap_coarse->Fill(ix -1, iy -1, tmp3);
467 eemap->Fill(ix +
IX_MAX -1, iy -1, 0.05 + 0.95 * (tmp3>0));
469 eemap_coarse->Fill(ix +
IX_MAX -1, iy -1, tmp3);
478 gStyle->SetOptStat(0);
480 gStyle->SetFillColor(10);
481 gStyle->SetFrameFillColor(10);
482 gStyle->SetCanvasColor(10);
483 gStyle->SetPadColor(10);
484 gStyle->SetTitleFillColor(0);
485 gStyle->SetStatColor(10);
487 gStyle->SetFrameBorderMode(0);
488 gStyle->SetCanvasBorderMode(0);
489 gStyle->SetPadBorderMode(0);
491 gStyle->SetPalette(1);
493 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
494 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
495 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
496 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
497 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
498 gStyle->SetNumberContours(NCont);
502 for (Int_t j = 1; j <=
IY_MAX; j++) {
504 eetemp->SetBinContent(
i, j, 2);
505 eetemp->SetBinContent(
i +
IX_MAX, j, 2);
510 eetemp->SetFillColor(920);
511 TCanvas
c1(
"c1",
"c1", 1200, 600);
518 t1.SetTextSize(0.06);
520 eetemp->GetXaxis()->SetNdivisions(40,kFALSE);
521 eetemp->GetYaxis()->SetNdivisions(20,kFALSE);
522 eetemp->GetXaxis()->SetLabelSize(0.00);
523 eetemp->GetYaxis()->SetLabelSize(0.00);
524 eetemp->GetXaxis()->SetTickLength(0.01);
525 eetemp->GetYaxis()->SetTickLength(0.01);
526 eetemp->SetMaximum(1.15);
528 eemap->GetXaxis()->SetNdivisions(40,kFALSE);
529 eemap->GetYaxis()->SetNdivisions(20,kFALSE);
530 eemap->GetXaxis()->SetLabelSize(0.00);
531 eemap->GetYaxis()->SetLabelSize(0.00);
532 eemap->GetXaxis()->SetTickLength(0.01);
533 eemap->GetYaxis()->SetTickLength(0.01);
534 eemap->SetMaximum(1.15);
537 eemap->Draw(
"same,colz");
539 eemap_coarse->SetMarkerSize(2);
540 eemap_coarse->Draw(
"same,text");
543 t1.SetTextSize(0.055);
544 t1.DrawLatex(0.5, 0.96, Form(
"EE DQM Channel Status (Diff), IOV %i vs %i", run[0], run[1]));
547 sprintf(txt,
"Net difference: %d channel(s)",eecount);
549 t1.SetTextSize(0.045);
550 t1.DrawLatex(0.5, 0.91, txt);
552 t1.SetTextSize(0.05);
553 t1.DrawLatex(0.14, 0.84,
"EE-");
554 t1.DrawLatex(0.86, 0.84,
"EE+");
557 c1.SaveAs(ImageName.c_str());
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
constexpr uint32_t rawId() const
get the raw id
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
static const int MIN_HASH
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
void setSingleIov(bool flag)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays