22 enum {MIN_IETA = 1, MIN_IPHI = 1, MAX_IETA = 85, MAX_IPHI = 360};
23 enum {IX_MIN = 1, IY_MIN = 1, IX_MAX = 100, IY_MAX = 100};
32 EcalChannelStatusEBMap() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Barrel channel status") {
35 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
37 TH2F *ebmap =
new TH2F(
"ebmap",
"",MAX_IPHI, 0, MAX_IPHI, 2*MAX_IETA, -MAX_IETA, MAX_IETA);
38 TH2F *ebmap_coarse =
new TH2F(
"ebmap_coarse",
"",MAX_IPHI/20, 0, MAX_IPHI, 2,-MAX_IETA, MAX_IETA);
42 auto iov = iovs.front();
44 run = std::get<0>(iov);
47 if (payload->barrelItems().empty())
return false;
53 if (payload->find(rawid) == payload->end())
continue;
55 Double_t
weight = (Double_t)(*payload)[rawid].getEncodedStatusCode();
56 Double_t
phi = (Double_t)(
EBDetId(rawid)).iphi() - 0.5;
57 Double_t
eta = (Double_t)(
EBDetId(rawid)).ieta();
58 if(eta > 0.) eta = eta - 0.5;
60 ebmap->Fill(phi, eta, weight);
63 ebmap_coarse->Fill(phi, eta);
69 gStyle->SetOptStat(0);
71 gStyle->SetFillColor(10);
72 gStyle->SetFrameFillColor(10);
73 gStyle->SetCanvasColor(10);
74 gStyle->SetPadColor(10);
75 gStyle->SetTitleFillColor(0);
76 gStyle->SetStatColor(10);
78 gStyle->SetFrameBorderMode(0);
79 gStyle->SetCanvasBorderMode(0);
80 gStyle->SetPadBorderMode(0);
82 gStyle->SetPalette(1);
84 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
85 Double_t
red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
86 Double_t
green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
87 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
88 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
89 gStyle->SetNumberContours(NCont);
91 TCanvas
c1(
"c1",
"c1", 1200, 700);
100 ebmap->SetXTitle(
"i#phi");
101 ebmap->SetYTitle(
"i#eta");
102 ebmap->GetXaxis()->SetNdivisions(-418,kFALSE);
103 ebmap->GetYaxis()->SetNdivisions(-1702,kFALSE);
104 ebmap->GetXaxis()->SetLabelSize(0.03);
105 ebmap->GetYaxis()->SetLabelSize(0.03);
106 ebmap->GetXaxis()->SetTickLength(0.01);
107 ebmap->GetYaxis()->SetTickLength(0.01);
108 ebmap->SetMaximum(15);
113 ebmap_coarse->SetMarkerSize(1.3);
114 ebmap_coarse->Draw(
"text,same");
116 t1.SetTextSize(0.05);
117 t1.DrawLatex(0.5, 0.96, Form(
"EB Channel Status Masks, IOV %i", run));
120 Double_t prop = (Double_t)ebcount/
kEBChannels*100.;
121 sprintf(txt,
"%d/61200 (%4.3f%%)",ebcount, prop);
123 t1.SetTextSize(0.045);
124 t1.DrawLatex(0.5, 0.91, txt);
127 c1.SaveAs(ImageName.c_str());
138 EcalChannelStatusEEMap() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Barrel channel status") {
139 setSingleIov(
true );
141 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
144 TH2F *eemap =
new TH2F(
"eemap",
"", 2*IX_MAX, 0, 2*IX_MAX, IY_MAX, 0, IY_MAX);
145 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2*IX_MAX, 1, 0, IY_MAX);
146 TH2F *eetemp =
new TH2F(
"eetemp",
"", 2*IX_MAX, 0, 2*IX_MAX, IY_MAX, 0, IY_MAX);
148 unsigned int run = 0;
149 auto iov = iovs.front();
150 std::shared_ptr<EcalChannelStatus> payload = fetchPayload( std::get<1>(iov) );
151 run = std::get<0>(iov);
153 if (payload->endcapItems().empty())
return false;
156 for(
int iz = -1; iz < 2; iz = iz + 2)
157 for(
int iy = IY_MIN; iy < IY_MAX+IY_MIN; iy++)
158 for(
int ix = IX_MIN; ix < IX_MAX+IX_MIN; ix++)
161 uint32_t rawid = myEEId.
rawId();
163 if (payload->find(rawid) == payload->end())
continue;
165 float weight = (
float)(*payload)[rawid].getEncodedStatusCode();
168 eemap->Fill(ix -1, iy -1, weight);
171 eemap_coarse->Fill(ix -1, iy -1);
176 eemap->Fill(ix + IX_MAX -1, iy -1, weight);
179 eemap_coarse->Fill(ix + IX_MAX -1, iy -1);
185 gStyle->SetOptStat(0);
187 gStyle->SetFillColor(10);
188 gStyle->SetFrameFillColor(10);
189 gStyle->SetCanvasColor(10);
190 gStyle->SetPadColor(10);
191 gStyle->SetTitleFillColor(0);
192 gStyle->SetStatColor(10);
194 gStyle->SetFrameBorderMode(0);
195 gStyle->SetCanvasBorderMode(0);
196 gStyle->SetPadBorderMode(0);
198 gStyle->SetPalette(1);
200 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
201 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
202 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
203 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
204 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
205 gStyle->SetNumberContours(NCont);
208 for (Int_t
i = 1;
i <= IX_MAX;
i++) {
209 for (Int_t j = 1; j <= IY_MAX; j++) {
213 eetemp->SetBinContent(
i, j, 2);
214 eetemp->SetBinContent(
i + IX_MAX, j, 2);
219 eetemp->SetFillColor(920);
220 TCanvas
c1(
"c1",
"c1", 1200, 600);
227 t1.SetTextSize(0.06);
229 eetemp->GetXaxis()->SetNdivisions(40,kFALSE);
230 eetemp->GetYaxis()->SetNdivisions(20,kFALSE);
231 eetemp->GetXaxis()->SetLabelSize(0.00);
232 eetemp->GetYaxis()->SetLabelSize(0.00);
233 eetemp->GetXaxis()->SetTickLength(0.01);
234 eetemp->GetYaxis()->SetTickLength(0.01);
235 eetemp->SetMaximum(1.15);
237 eemap->GetXaxis()->SetNdivisions(40,kFALSE);
238 eemap->GetYaxis()->SetNdivisions(20,kFALSE);
239 eemap->GetXaxis()->SetLabelSize(0.00);
240 eemap->GetYaxis()->SetLabelSize(0.00);
241 eemap->GetXaxis()->SetTickLength(0.01);
242 eemap->GetYaxis()->SetTickLength(0.01);
243 eemap->SetMaximum(15);
246 eemap->Draw(
"same,colz");
248 eemap_coarse->SetMarkerSize(2);
249 eemap_coarse->Draw(
"same,text");
252 t1.SetTextSize(0.055);
253 t1.DrawLatex(0.5, 0.96, Form(
"EE Channel Status Masks, IOV %i", run));
256 Double_t prop = (Double_t)eecount/
kEEChannels*100.;
257 sprintf(txt,
"%d/14648 (%4.3f%%)",eecount, prop);
259 t1.SetTextSize(0.045);
260 t1.DrawLatex(0.5, 0.91, txt);
262 t1.SetTextSize(0.05);
263 t1.DrawLatex(0.14, 0.84,
"EE-");
264 t1.DrawLatex(0.86, 0.84,
"EE+");
267 c1.SaveAs(ImageName.c_str());
278 EcalChannelStatusEBDiff() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Barrel channel status difference") {
281 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
283 TH2F *ebmap =
new TH2F(
"ebmap",
"",MAX_IPHI, 0, MAX_IPHI, 2*MAX_IETA, -MAX_IETA, MAX_IETA);
284 TH2F *ebmap_coarse =
new TH2F(
"ebmap_coarse",
"",MAX_IPHI/20, 0, MAX_IPHI, 2,-MAX_IETA, MAX_IETA);
287 for (
auto const & iov: iovs) {
288 std::shared_ptr<EcalChannelStatus> payload = fetchPayload( std::get<1>(iov) );
291 if (payload->barrelItems().empty())
return false;
292 run[irun] = std::get<0>(iov);
298 if (payload->find(rawid) == payload->end())
continue;
301 status[cellid] = (*payload)[rawid].getEncodedStatusCode();
304 unsigned int new_status = (*payload)[rawid].getEncodedStatusCode();
305 if(new_status !=
status[cellid]) {
307 if (new_status >
status[cellid]) tmp3 = 1;
309 Double_t phi = (Double_t)(
EBDetId(rawid)).iphi() - 0.5;
310 Double_t eta = (Double_t)(
EBDetId(rawid)).ieta();
311 if(eta > 0.) eta = eta - 0.5;
312 else eta = eta + 0.5;
313 ebmap->Fill(phi, eta, 0.05 + 0.95 * (tmp3>0));
315 ebmap_coarse->Fill(phi, eta, tmp3);
324 gStyle->SetOptStat(0);
326 gStyle->SetFillColor(10);
327 gStyle->SetFrameFillColor(10);
328 gStyle->SetCanvasColor(10);
329 gStyle->SetPadColor(10);
330 gStyle->SetTitleFillColor(0);
331 gStyle->SetStatColor(10);
333 gStyle->SetFrameBorderMode(0);
334 gStyle->SetCanvasBorderMode(0);
335 gStyle->SetPadBorderMode(0);
337 gStyle->SetPalette(1);
339 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
340 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
341 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
342 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
343 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
344 gStyle->SetNumberContours(NCont);
346 TCanvas
c1(
"c1",
"c1", 1200, 700);
353 t1.SetTextSize(0.06);
355 ebmap->SetXTitle(
"i#phi");
356 ebmap->SetYTitle(
"i#eta");
357 ebmap->GetXaxis()->SetNdivisions(-418,kFALSE);
358 ebmap->GetYaxis()->SetNdivisions(-1702,kFALSE);
359 ebmap->GetXaxis()->SetLabelSize(0.03);
360 ebmap->GetYaxis()->SetLabelSize(0.03);
361 ebmap->GetXaxis()->SetTickLength(0.01);
362 ebmap->GetYaxis()->SetTickLength(0.01);
363 ebmap->SetMaximum(1.15);
368 ebmap_coarse->SetMarkerSize(1.3);
369 ebmap_coarse->Draw(
"text,same");
371 t1.SetTextSize(0.05);
372 t1.DrawLatex(0.5, 0.96, Form(
"EB Channel Status Masks (Diff), IOV: %i vs %i", run[0], run[1]));
375 sprintf(txt,
"Net difference: %d channel(s)",ebcount);
377 t1.SetTextSize(0.045);
378 t1.DrawLatex(0.5, 0.91, txt);
381 c1.SaveAs(ImageName.c_str());
392 EcalChannelStatusEEDiff() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Endcaps channel status difference") {
393 setSingleIov(
true );
395 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
397 TH2F *eemap =
new TH2F(
"eemap",
"", 2*IX_MAX, 0, 2*IX_MAX, IY_MAX, 0, IY_MAX);
398 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2*IX_MAX, 1, 0, IY_MAX);
399 TH2F *eetemp =
new TH2F(
"eetemp",
"", 2*IX_MAX, 0, 2*IX_MAX, IY_MAX, 0, IY_MAX);
402 for (
auto const & iov: iovs) {
403 std::shared_ptr<EcalChannelStatus> payload = fetchPayload( std::get<1>(iov) );
404 run[irun] = std::get<0>(iov);
406 if (payload->endcapItems().empty())
return false;
409 for(
int iz = -1; iz < 2; iz = iz + 2)
410 for(
int iy = IY_MIN; iy < IY_MAX+IY_MIN; iy++)
411 for(
int ix = IX_MIN; ix < IX_MAX+IX_MIN; ix++)
414 uint32_t rawid = myEEId.
rawId();
417 if (payload->find(rawid) == payload->end())
continue;
419 status[channel] = (*payload)[rawid].getEncodedStatusCode();
422 unsigned int new_status = (*payload)[rawid].getEncodedStatusCode();
423 if(new_status !=
status[channel]) {
425 if (new_status >
status[channel]) tmp3 = 1;
428 eemap->Fill(ix -1, iy -1, 0.05 + 0.95 * (tmp3>0));
430 eemap_coarse->Fill(ix -1, iy -1, tmp3);
433 eemap->Fill(ix + IX_MAX -1, iy -1, 0.05 + 0.95 * (tmp3>0));
435 eemap_coarse->Fill(ix + IX_MAX -1, iy -1, tmp3);
444 gStyle->SetOptStat(0);
446 gStyle->SetFillColor(10);
447 gStyle->SetFrameFillColor(10);
448 gStyle->SetCanvasColor(10);
449 gStyle->SetPadColor(10);
450 gStyle->SetTitleFillColor(0);
451 gStyle->SetStatColor(10);
453 gStyle->SetFrameBorderMode(0);
454 gStyle->SetCanvasBorderMode(0);
455 gStyle->SetPadBorderMode(0);
457 gStyle->SetPalette(1);
459 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
460 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
461 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
462 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
463 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
464 gStyle->SetNumberContours(NCont);
467 for (Int_t
i = 1;
i <= IX_MAX;
i++) {
468 for (Int_t j = 1; j <= IY_MAX; j++) {
470 eetemp->SetBinContent(
i, j, 2);
471 eetemp->SetBinContent(
i + IX_MAX, j, 2);
476 eetemp->SetFillColor(920);
477 TCanvas
c1(
"c1",
"c1", 1200, 600);
484 t1.SetTextSize(0.06);
486 eetemp->GetXaxis()->SetNdivisions(40,kFALSE);
487 eetemp->GetYaxis()->SetNdivisions(20,kFALSE);
488 eetemp->GetXaxis()->SetLabelSize(0.00);
489 eetemp->GetYaxis()->SetLabelSize(0.00);
490 eetemp->GetXaxis()->SetTickLength(0.01);
491 eetemp->GetYaxis()->SetTickLength(0.01);
492 eetemp->SetMaximum(1.15);
494 eemap->GetXaxis()->SetNdivisions(40,kFALSE);
495 eemap->GetYaxis()->SetNdivisions(20,kFALSE);
496 eemap->GetXaxis()->SetLabelSize(0.00);
497 eemap->GetYaxis()->SetLabelSize(0.00);
498 eemap->GetXaxis()->SetTickLength(0.01);
499 eemap->GetYaxis()->SetTickLength(0.01);
500 eemap->SetMaximum(1.15);
503 eemap->Draw(
"same,colz");
505 eemap_coarse->SetMarkerSize(2);
506 eemap_coarse->Draw(
"same,text");
509 t1.SetTextSize(0.055);
510 t1.DrawLatex(0.5, 0.96, Form(
"EE Channel Status Masks (Diff), IOV %i vs %i", run[0], run[1]));
513 sprintf(txt,
"Net difference: %d channel(s)",eecount);
515 t1.SetTextSize(0.045);
516 t1.DrawLatex(0.5, 0.91, txt);
518 t1.SetTextSize(0.05);
519 t1.DrawLatex(0.14, 0.84,
"EE-");
520 t1.DrawLatex(0.86, 0.84,
"EE+");
523 c1.SaveAs(ImageName.c_str());
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
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