307 s_title =
"Barrel Pixel Layer " + std::to_string(lay);
313 s_title =
"Forward Pixel Ring " + std::to_string(
ring);
316 gStyle->SetPadRightMargin(0.125);
318 if (standard_palette) {
319 gStyle->SetPalette(1);
322 const Int_t NRGBs = 5;
323 const Int_t NCont = 255;
325 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
326 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
327 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
328 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
329 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
330 gStyle->SetNumberContours(NCont);
333 h->SetMarkerSize(0.7);
339 ltx.SetTextSize(0.06);
340 ltx.SetTextAlign(31);
341 ltx.DrawLatexNDC(1 - gPad->GetRightMargin(), 1 - gPad->GetTopMargin() + 0.01, (s_title).c_str());
345 std::vector<std::vector<int>> nladder = {{10, 16, 22}, {6, 14, 22, 32}};
346 int nlad = nladder[
phase][lay - 1];
347 for (
int xsign = -1; xsign <= 1; xsign += 2)
348 for (
int ysign = -1; ysign <= 1; ysign += 2) {
349 float xlow = xsign * (half_shift * 0.5);
350 float xhigh = xsign * (half_shift * 0.5 + 4);
351 float ylow = ysign * (half_shift * 0.5 + (
phase == 0) * 0.5);
352 float yhigh = ysign * (half_shift * 0.5 - (
phase == 0) * 0.5 + nlad);
359 for (
int lad = 1; lad < nlad; ++lad) {
360 float y = ysign * (lad + half_shift * 0.5);
363 for (
int lad = 1; lad <= nlad; ++lad)
364 if (!(
phase == 0 && (lad == 1 || lad == nlad))) {
365 float y = ysign * (lad + half_shift * 0.5 - 0.5);
370 float x = xsign * (
mod + half_shift * 0.5);
378 for (
int lad = 1; lad <= nlad; ++lad) {
379 bool flipped = ysign == 1 ? lad % 2 == 0 : lad % 2 == 1;
382 int roc0_orientation = flipped ? -1 : 1;
384 roc0_orientation *= -1;
386 roc0_orientation *= -1;
387 float x1 = xsign * (
mod + half_shift * 0.5);
388 float x2 = xsign * (
mod + half_shift * 0.5 - 1. / 8);
389 float y1 = ysign * (lad + half_shift * 0.5 - 0.5);
390 float y2 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation * 1. / 2);
391 if (!(
phase == 0 && (lad == 1 || lad == nlad) && xsign == -1)) {
392 if (lay == 1 && xsign <= -1) {
393 float x1 = xsign * ((
mod - 1) + half_shift * 0.5);
394 float x2 = xsign * ((
mod - 1) + half_shift * 0.5 + 1. / 8);
395 float y1 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation);
396 float y2 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation * 3. / 2);
411 for (
int dsk = 1, ndsk = 2 + (
phase == 1); dsk <= ndsk; ++dsk) {
412 for (
int xsign = -1; xsign <= 1; xsign += 2)
413 for (
int ysign = -1; ysign <= 1; ysign += 2) {
415 int first_roc = 3, nbin = 16;
416 for (
int bld = 1, nbld = 12; bld <= nbld; ++bld) {
418 for (
int plq = 1, nplq = 7; plq <= nplq; ++plq) {
420 xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1)) / (
float)nbin);
422 xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * (plq + 1) - (plq == 7)) / (
float)nbin);
423 float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + plq / 2) * 0.1);
424 float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + plq / 2) * 0.1);
429 for (
int plq = 1, nplq = 7 + 1; plq <= nplq; ++plq) {
430 float x = xsign * (half_shift * 0.5 + dsk - 1 +
431 (first_roc - 3 + 2 * plq + (plq == 1) - (plq == 8)) / (
float)nbin);
432 float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + (plq - (plq == 8)) / 2) * 0.1);
433 float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + (plq - (plq == 8)) / 2) * 0.1);
437 for (
int plq = 2, nplq = 6; plq <= nplq; ++plq)
439 float x = xsign * (half_shift * 0.5 + dsk - 1 +
440 (first_roc - 3 + 2 * plq + (plq == 1) - (plq == 8) + 1) / (
float)nbin);
441 float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + (plq - (plq == 8)) / 2) * 0.1);
442 float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + (plq - (plq == 8)) / 2) * 0.1);
446 for (
int plq = 1, nplq = 7; plq <= nplq; ++plq) {
447 float x1 = xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1)) / (
float)nbin);
449 xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1) + 1) / (
float)nbin);
450 int sign = xsign * ysign * ((plq % 2) ? 1 : -1);
451 float y1 = ysign * (half_shift * 0.5 + (bld - 0.5) +
sign * (2 + plq / 2) * 0.1);
452 float y2 = ysign * (half_shift * 0.5 + (bld - 0.5) +
sign * (plq / 2) * 0.1);
459 }
else if (
phase == 1) {
462 for (
int bld = 1, nbld = 5 +
ring * 6; bld <= nbld; ++bld) {
464 Color_t p1_color = 1, p2_color = 1;
467 float x1 = xsign * (half_shift * 0.5 + dsk - 1 + (
ring - 1) * 0.5);
468 float x2 = xsign * (half_shift * 0.5 + dsk - 1 +
ring * 0.5);
470 float y1 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld +
sign * 0.5);
472 float y2 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld);
473 float yp2_mid = ysign * (half_shift * 0.5 - 0.5 +
scale * bld -
sign * 0.25);
474 float y3 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld -
sign * 0.5);
481 float x = xsign * (half_shift * 0.5 + dsk - 1 + (
ring - 1) * 0.5);
486 x = xsign * (half_shift * 0.5 + dsk);
491 x1 = xsign * (half_shift * 0.5 + dsk - 1 +
ring * 0.5 - 1 / 16.);
492 x2 = xsign * (half_shift * 0.5 + dsk - 1 +
ring * 0.5);
493 float y1_p1 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld +
sign * 0.25);
494 float y2_p1 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld +
sign * 0.25 + xsign * ysign * 0.25);
499 float y1_p2 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld -
sign * 0.25);
500 float y2_p2 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld -
sign * 0.25 - xsign * ysign * 0.25);
507 for (
int bld = 1, nbld = 5 +
ring * 6; bld <= nbld; ++bld) {
508 Color_t p1_color = 1, p2_color = 1;
511 float x1 = xsign * (half_shift * 0.5 + dsk - 1);
512 float x2 = xsign * (half_shift * 0.5 + dsk);
514 float y1 = ysign * (half_shift * 0.5 - 0.5 + bld +
sign * 0.5);
516 float y2 = ysign * (half_shift * 0.5 - 0.5 + bld);
517 float yp2_mid = ysign * (half_shift * 0.5 - 0.5 + bld -
sign * 0.25);
518 float y3 = ysign * (half_shift * 0.5 - 0.5 + bld -
sign * 0.5);
525 float x = xsign * (half_shift * 0.5 + dsk - 1);
530 x = xsign * (half_shift * 0.5 + dsk);
535 x1 = xsign * (half_shift * 0.5 + dsk - 1 / 8.);
536 x2 = xsign * (half_shift * 0.5 + dsk);
537 float y1_p1 = ysign * (half_shift * 0.5 - 0.5 + bld +
sign * 0.25);
538 float y2_p1 = ysign * (half_shift * 0.5 - 0.5 + bld +
sign * 0.25 + xsign * ysign * 0.25);
543 float y1_p2 = ysign * (half_shift * 0.5 - 0.5 + bld -
sign * 0.25);
544 float y2_p2 = ysign * (half_shift * 0.5 - 0.5 + bld -
sign * 0.25 - xsign * ysign * 0.25);
560 if (
phase == 0 &&
h->GetNbinsY() == 250 &&
h->GetNbinsX() == 80) {
561 int nentries =
h->GetEntries();
562 for (
int binx = 1; binx <= 80; ++binx) {
564 for (
int biny = 1; biny <= 250; ++biny) {
565 bool odd_nrocy = (binx - 1 < 40) != (((binx - 1) / 4) % 2);
566 if (biny % 2 == odd_nrocy)
567 sum +=
h->GetBinContent(binx, biny);
569 sum +=
h->GetBinContent(binx, biny);
571 h->SetBinContent(binx, biny, sum);
572 h->SetBinContent(binx, biny - 1, sum);
578 h->SetEntries(nentries);