20 enum { NTCC = 108, NTower = 28, NStrip = 5, NXtal = 5 };
28 EcalTPGStripStatusPlot() :
cond::payloadInspector::PlotImage<
EcalTPGStripStatus>(
"ECAL TPGStripStatus - map ") {
32 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
35 int EEstat[2] = {0, 0};
40 std::cout <<
"EcalTPGStripStatus File EEMap.txt not found" << std::endl;
44 uint32_t rawEE[NTCC][NTower][NStrip][NXtal];
45 int NbrawEE[NTCC][NTower][NStrip];
46 for (
int TCC = 0; TCC < NTCC; TCC++)
47 for (
int TT = 0; TT < NTower; TT++)
48 for (
int ST = 0; ST < NStrip; ST++)
49 NbrawEE[TCC][TT][ST] = 0;
52 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
53 int tccid,
tower, pseudostrip_in_TCC, pseudostrip_in_TT;
54 f >> ix >> iy >> iz >>
CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >>
tower >>
55 pseudostrip_in_TCC >> pseudostrip_in_TT;
57 uint32_t rawId = detid.denseIndex();
58 if (tccid > NTCC ||
tower > NTower || pseudostrip_in_TT > NStrip || xtal_in_pseudostrip > NXtal)
59 std::cout <<
" tccid " << tccid <<
" tower " <<
tower <<
" pseudostrip_in_TT " << pseudostrip_in_TT
60 <<
" xtal_in_pseudostrip " << xtal_in_pseudostrip << std::endl;
62 rawEE[tccid - 1][
tower - 1][pseudostrip_in_TT - 1][xtal_in_pseudostrip - 1] = rawId;
63 NbrawEE[tccid - 1][
tower - 1][pseudostrip_in_TT - 1]++;
67 double wei[2] = {0., 0.};
69 auto iov = iovs.front();
71 unsigned int run = std::get<0>(iov);
76 for (itSt = stripMap.begin(); itSt != stripMap.end(); ++itSt) {
77 if (itSt->second > 0) {
79 int strip = itSt->first / 8;
80 int pseudostrip =
strip & 0x7;
84 int tccid =
strip & 0x7F;
85 int NbXtalInStrip = NbrawEE[tccid - 1][
tt - 1][pseudostrip - 1];
86 if (NbXtalInStrip != NXtal)
87 std::cout <<
" Strip TCC " << tccid <<
" TT " <<
tt <<
" ST " << pseudostrip <<
" Nx Xtals "
88 << NbXtalInStrip << std::endl;
91 for (
int Xtal = 0; Xtal < NbXtalInStrip; Xtal++) {
92 uint32_t rawId = rawEE[tccid - 1][
tt - 1][pseudostrip - 1][Xtal];
97 int iz = detid.
zside();
103 endc_m->Fill(
x + 0.5,
y + 0.5, wei[iz]);
106 endc_p->Fill(
x + 0.5,
y + 0.5, wei[iz]);
116 gStyle->SetPalette(1);
117 gStyle->SetOptStat(0);
118 const Int_t NRGBs = 5;
119 const Int_t NCont = 255;
121 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
122 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
123 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
124 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
125 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
126 gStyle->SetNumberContours(NCont);
136 t1.SetTextSize(0.05);
137 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGStripStatus, IOV %i",
run));
139 float xmi[2] = {0.0, 0.5};
140 float xma[2] = {0.5, 1.0};
141 TPad** pad =
new TPad*;
143 pad[
obj] =
new TPad(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
148 DrawEE(endc_m, 0., wei[0]);
149 t1.SetTextSize(0.03);
150 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEstat[0]));
152 DrawEE(endc_p, 0., wei[1]);
153 t1.DrawLatex(0.15, 0.92, Form(
"%i crystals", EEstat[1]));
156 canvas.SaveAs(ImageName.c_str());
166 EcalTPGStripStatusDiff() :
cond::payloadInspector::PlotImage<
EcalTPGStripStatus>(
"ECAL TPGStripStatus difference") {
170 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
173 int EEstat[2][2] = {{0, 0}, {0, 0}};
178 std::cout <<
"EcalTPGStripStatus File EEMap.txt not found" << std::endl;
182 uint32_t rawEE[NTCC][NTower][NStrip][NXtal];
183 int NbrawEE[NTCC][NTower][NStrip];
184 for (
int TCC = 0; TCC < NTCC; TCC++)
185 for (
int TT = 0; TT < NTower; TT++)
186 for (
int ST = 0; ST < NStrip; ST++)
187 NbrawEE[TCC][TT][ST] = 0;
190 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
191 int tccid,
tower, pseudostrip_in_TCC, pseudostrip_in_TT;
192 f >> ix >> iy >> iz >>
CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >>
tower >>
193 pseudostrip_in_TCC >> pseudostrip_in_TT;
196 if (tccid > NTCC ||
tower > NTower || pseudostrip_in_TT > NStrip || xtal_in_pseudostrip > NXtal)
197 std::cout <<
" tccid " << tccid <<
" tower " <<
tower <<
" pseudostrip_in_TT " << pseudostrip_in_TT
198 <<
" xtal_in_pseudostrip " << xtal_in_pseudostrip << std::endl;
200 rawEE[tccid - 1][
tower - 1][pseudostrip_in_TT - 1][xtal_in_pseudostrip - 1] = rawId;
201 NbrawEE[tccid - 1][
tower - 1][pseudostrip_in_TT - 1]++;
206 unsigned int run[2] = {0, 0}, irun = 0;
209 for (
auto const& iov : iovs) {
211 run[irun] = std::get<0>(iov);
216 for (itSt = stripMap.begin(); itSt != stripMap.end(); ++itSt) {
217 if (itSt->second > 0) {
218 int ID = itSt->first / 8;
219 if (irun == 0 && istat < 100) {
224 std::cout <<
" limit on number of strips reached, stop keeping others" << std::endl;
227 for (
int is = 0; is < istat; is++) {
240 int pseudostrip =
strip & 0x7;
244 int tccid =
strip & 0x7F;
245 int NbXtalInStrip = NbrawEE[tccid - 1][
tt - 1][pseudostrip - 1];
246 if (NbXtalInStrip != NXtal)
247 std::cout <<
" Strip TCC " << tccid <<
" TT " <<
tt <<
" ST " << pseudostrip <<
" Nx Xtals "
248 << NbXtalInStrip << std::endl;
249 for (
int Xtal = 0; Xtal < NbXtalInStrip; Xtal++) {
250 uint32_t rawId = rawEE[tccid - 1][
tt - 1][pseudostrip - 1][Xtal];
255 int iz = detid.
zside();
259 endc_m->Fill(
x + 0.5,
y + 0.5, 1.);
262 endc_p->Fill(
x + 0.5,
y + 0.5, 1.);
279 for (
int is = 0; is < istat; is++) {
284 int pseudostrip =
strip & 0x7;
288 int tccid =
strip & 0x7F;
289 int NbXtalInStrip = NbrawEE[tccid - 1][
tt - 1][pseudostrip - 1];
290 if (NbXtalInStrip != NXtal)
291 std::cout <<
" Strip TCC " << tccid <<
" TT " <<
tt <<
" ST " << pseudostrip <<
" Nx Xtals "
292 << NbXtalInStrip << std::endl;
293 for (
int Xtal = 0; Xtal < NbXtalInStrip; Xtal++) {
294 uint32_t rawId = rawEE[tccid - 1][
tt - 1][pseudostrip - 1][Xtal];
299 int iz = detid.
zside();
303 endc_m->Fill(
x + 0.5,
y + 0.5, -1.);
306 endc_p->Fill(
x + 0.5,
y + 0.5, -1.);
314 gStyle->SetPalette(1);
315 gStyle->SetOptStat(0);
316 const Int_t NRGBs = 5;
317 const Int_t NCont = 255;
319 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
320 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
321 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
322 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
323 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
324 gStyle->SetNumberContours(NCont);
334 t1.SetTextSize(0.05);
335 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGStripStatus, IOV %i - %i",
run[1],
run[0]));
337 float xmi[2] = {0.0, 0.5};
338 float xma[2] = {0.5, 1.0};
339 TPad** pad =
new TPad*;
341 pad[
obj] =
new TPad(Form(
"p_%i",
obj), Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[
obj], 0.94);
346 DrawEE(endc_m, -1.0, 1.0);
347 t1.SetTextSize(0.03);
348 t1.DrawLatex(0.15, 0.92, Form(
"new %i old %i", EEstat[0][0], EEstat[0][1]));
350 DrawEE(endc_p, -1.0, 1.0);
351 t1.DrawLatex(0.15, 0.92, Form(
"new %i old %i", EEstat[1][0], EEstat[1][1]));
354 canvas.SaveAs(ImageName.c_str());
364 EcalTPGStripStatusSummaryPlot()
369 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
370 auto iov = iovs.front();
371 std::shared_ptr<EcalTPGStripStatus>
payload =
373 unsigned int run = std::get<0>(iov);
382 align =
new TH2F(
"Ecal TPGStrip Status Summary",
383 "Total NumberOfMasked",
394 if ((*it).second > 0)
397 align->Fill(0.5, 0.5, stripMap.size());
398 align->Fill(1.5, 0.5, NbMaskedTT);
404 gStyle->SetPalette(1);
405 gStyle->SetOptStat(0);
406 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
410 t1.SetTextSize(0.04);
412 t1.DrawLatex(0.5, 0.96, Form(
"Endcap:Number of masked Trigger Strips, IOV %i",
run));
414 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
421 align->GetXaxis()->SetTickLength(0.);
422 align->GetXaxis()->SetLabelSize(0.);
423 align->GetYaxis()->SetTickLength(0.);
424 align->GetYaxis()->SetLabelSize(0.);
427 canvas.SaveAs(ImageName.c_str());