30 EcalTPGCrystalStatusPlot()
39 int EBstat = 0, EEstat[2] = {0, 0};
41 auto iov =
iovs.front();
43 unsigned int run = std::get<0>(iov);
46 Double_t
eta = (Double_t)ieta;
53 for (
int iphi = 1; iphi <=
MAX_IPHI; iphi++) {
54 Double_t
phi = (Double_t)iphi - 0.5;
56 double val = (*payload)[
id.rawId()].getStatusCode();
57 barrel->Fill(phi, eta, val);
64 int thesign =
sign == 1 ? 1 : -1;
65 for (
int ix = 1; ix <=
IX_MAX; ix++) {
66 for (
int iy = 1; iy <=
IY_MAX; iy++) {
70 double val = (*payload)[
id.rawId()].getStatusCode();
72 endc_p->Fill(ix, iy, val);
76 endc_m->Fill(ix, iy, val);
85 gStyle->SetPalette(1);
86 gStyle->SetOptStat(0);
90 TCanvas
canvas(
"c",
"c", w, h);
97 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGCrystalStatus, IOV %i", run));
101 float xmi[3] = {0.0, 0.0, 0.5};
102 float xma[3] = {1.0, 0.5, 1.0};
103 float ymi[3] = {0.47, 0.0, 0.0};
104 float yma[3] = {0.94, 0.47, 0.47};
105 std::array<std::unique_ptr<TPad>, 3> pad;
107 pad[
obj] = std::make_unique<TPad>(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], ymi[
obj], xma[
obj], yma[
obj]);
113 t1.DrawLatex(0.2, 0.94, Form(
"%i crystals", EBstat));
116 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEstat[0]));
119 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEstat[1]));
122 canvas.SaveAs(ImageName.c_str());
130 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
133 EcalTPGCrystalStatusDiffBase()
134 : cond::payloadInspector::PlotImage<
EcalTPGCrystalStatus, nIOVs, ntags>(
"ECAL TPGCrystalStatus difference") {}
136 bool fill()
override {
140 int EBstat = 0, EEstat[2] = {0, 0};
142 unsigned int run[2] = {0, 0};
145 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().
iovs;
146 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
147 auto firstiov =
iovs.front();
148 run[0] = std::get<0>(firstiov);
149 std::tuple<cond::Time_t, cond::Hash> lastiov;
151 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().
iovs;
152 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
153 lastiov = tag2iovs.front();
155 lastiov =
iovs.back();
156 l_tagname[1] = l_tagname[0];
158 run[1] = std::get<0>(lastiov);
159 for (
int irun = 0; irun < nIOVs; irun++) {
160 std::shared_ptr<EcalTPGCrystalStatus>
payload;
168 Double_t eta = (Double_t)ieta;
175 for (
int iphi = 1; iphi <=
MAX_IPHI; iphi++) {
176 Double_t phi = (Double_t)iphi - 0.5;
178 int channel =
id.hashedIndex();
179 double val = (*payload)[
id.rawId()].getStatusCode();
183 double diff = val - vEB[channel];
184 barrel->Fill(phi, eta, diff);
193 int thesign =
sign == 1 ? 1 : -1;
194 for (
int ix = 1; ix <=
IX_MAX; ix++) {
195 for (
int iy = 1; iy <=
IY_MAX; iy++) {
199 int channel =
id.hashedIndex();
200 double val = (*payload)[
id.rawId()].getStatusCode();
204 double diff = val - vEE[channel];
206 endc_p->Fill(ix, iy, diff);
210 endc_m->Fill(ix, iy, diff);
223 gStyle->SetPalette(1);
224 gStyle->SetOptStat(0);
227 TCanvas
canvas(
"c",
"c", w, h);
233 int len = l_tagname[0].length() + l_tagname[1].length();
236 t1.SetTextSize(0.03);
237 t1.DrawLatex(0.5, 0.96, Form(
"%s %i - %s %i", l_tagname[1].c_str(), run[1], l_tagname[0].c_str(), run[0]));
239 t1.SetTextSize(0.05);
240 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGCrystalStatus, IOV %i - %i", run[1], run[0]));
243 t1.SetTextSize(0.03);
244 t1.DrawLatex(0.5, 0.96, Form(
"%s, IOV %i - %i", l_tagname[0].c_str(), run[1], run[0]));
249 float xmi[3] = {0.0, 0.0, 0.5};
250 float xma[3] = {1.0, 0.5, 1.0};
251 float ymi[3] = {0.47, 0.0, 0.0};
252 float yma[3] = {0.94, 0.47, 0.47};
253 std::vector<std::unique_ptr<TPad>> pad;
255 pad.emplace_back(
new TPad(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], ymi[obj], xma[obj], yma[obj]));
261 t1.DrawLatex(0.2, 0.94, Form(
"%i differences", EBstat));
264 t1.DrawLatex(0.15, 0.92, Form(
"%i differences", EEstat[0]));
267 t1.DrawLatex(0.15, 0.92, Form(
"%i differences", EEstat[1]));
270 canvas.SaveAs(ImageName.c_str());
274 using EcalTPGCrystalStatusDiffOneTag = EcalTPGCrystalStatusDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
275 using EcalTPGCrystalStatusDiffTwoTags = EcalTPGCrystalStatusDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
282 EcalTPGCrystalStatusSummaryPlot()
283 : cond::payloadInspector::PlotImage<
EcalTPGCrystalStatus>(
"Ecal TPGCrystal Status Error Summary - map ") {
288 auto iov =
iovs.front();
289 std::shared_ptr<EcalTPGCrystalStatus> payload =
291 unsigned int run = std::get<0>(iov);
299 align =
new TH2F(
"Ecal TPGCrystal Status Error Summary",
300 "EB/EE-/EE+ ErrorCount Total Number",
308 long unsigned int ebErrorCount = 0;
309 long unsigned int ee1ErrorCount = 0;
310 long unsigned int ee2ErrorCount = 0;
312 long unsigned int ebTotal = (payload->barrelItems()).
size();
313 long unsigned int ee1Total = 0;
314 long unsigned int ee2Total = 0;
316 getBarrelErrorSummary<EcalTPGCrystalStatusCode>(payload->barrelItems(), ebErrorCount);
317 getEndCapErrorSummary<EcalTPGCrystalStatusCode>(
318 payload->endcapItems(), ee1ErrorCount, ee2ErrorCount, ee1Total, ee2Total);
320 double row = NbRows - 0.5;
323 align->Fill(0.5, row, 1);
324 align->Fill(1.5, row, ebErrorCount);
325 align->Fill(2.5, row, ebTotal);
329 align->Fill(0.5, row, 2);
330 align->Fill(1.5, row, ee1ErrorCount);
331 align->Fill(2.5, row, ee1Total);
336 align->Fill(0.5, row, 3);
337 align->Fill(1.5, row, ee2ErrorCount);
338 align->Fill(2.5, row, ee2Total);
344 gStyle->SetPalette(1);
345 gStyle->SetOptStat(0);
346 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
350 t1.SetTextSize(0.04);
352 t1.DrawLatex(0.5, 0.96, Form(
"EcalTPGCrystalStatus Error Summary, IOV %i", run));
354 TPad pad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
361 align->GetXaxis()->SetTickLength(0.);
362 align->GetXaxis()->SetLabelSize(0.);
363 align->GetYaxis()->SetTickLength(0.);
364 align->GetYaxis()->SetLabelSize(0.);
367 canvas.SaveAs(ImageName.c_str());
uint16_t *__restrict__ id
void DrawEE(TH2F *endc, float min, float max)
void DrawEB(TH2F *ebmap, float min, float max)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
tuple size
Write out results.
void drawTable(int nbRows, int nbColumns)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)