304 const auto zAxisTitle = fmt::sprintf(
"%s",
h->GetZaxis()->GetTitle());
308 canv->cd(lay)->SetTopMargin(0.05);
309 canv->cd(lay)->SetBottomMargin(0.07);
310 canv->cd(lay)->SetLeftMargin(0.1);
311 if (!zAxisTitle.empty()) {
312 h->GetZaxis()->SetTitleOffset(1.3);
313 h->GetZaxis()->CenterTitle(
true);
314 canv->cd(lay)->SetRightMargin(0.14);
316 canv->cd(lay)->SetRightMargin(0.11);
321 canv->cd(
ring)->SetTopMargin(0.05);
322 canv->cd(
ring)->SetBottomMargin(0.07);
323 canv->cd(
ring)->SetLeftMargin(0.1);
324 if (!zAxisTitle.empty()) {
325 h->GetZaxis()->SetTitleOffset(1.3);
326 h->GetZaxis()->CenterTitle(
true);
327 canv->cd(
ring)->SetRightMargin(0.14);
329 canv->cd(
ring)->SetRightMargin(0.11);
337 if (standard_palette) {
338 gStyle->SetPalette(1);
353 double max =
h->GetMaximum();
354 double min =
h->GetMinimum();
355 double val_white = 0.;
356 double per_white = (
max !=
min) ? ((val_white -
min) / (
max -
min)) : 0.5;
359 double Red[
Number] = {0., 1., 1.};
360 double Green[
Number] = {0., 1., 0.};
361 double Blue[
Number] = {1., 1., 0.};
362 double Stops[
Number] = {0., per_white, 1.};
365 TColor::CreateGradientColorTable(
Number, Stops, Red, Green, Blue, nb);
368 h->GetZaxis()->SetRangeUser(-1., 1.);
371 h->SetMarkerSize(0.7);
377 ltx.SetTextSize(0.06);
378 ltx.SetTextAlign(31);
379 ltx.DrawLatexNDC(1 - gPad->GetRightMargin(), 1 - gPad->GetTopMargin() + 0.01, (s_title).c_str());
383 std::vector<std::vector<int>> nladder = {{10, 16, 22}, {6, 14, 22, 32}};
384 int nlad = nladder[
phase][lay - 1];
385 for (
int xsign = -1; xsign <= 1; xsign += 2)
386 for (
int ysign = -1; ysign <= 1; ysign += 2) {
387 float xlow = xsign * (half_shift * 0.5);
388 float xhigh = xsign * (half_shift * 0.5 + 4);
389 float ylow = ysign * (half_shift * 0.5 + (
phase == 0) * 0.5);
390 float yhigh = ysign * (half_shift * 0.5 - (
phase == 0) * 0.5 + nlad);
397 for (
int lad = 1; lad < nlad; ++lad) {
398 float y = ysign * (lad + half_shift * 0.5);
401 for (
int lad = 1; lad <= nlad; ++lad)
402 if (!(
phase == 0 && (lad == 1 || lad == nlad))) {
403 float y = ysign * (lad + half_shift * 0.5 - 0.5);
408 float x = xsign * (
mod + half_shift * 0.5);
416 for (
int lad = 1; lad <= nlad; ++lad) {
417 bool flipped = ysign == 1 ? lad % 2 == 0 : lad % 2 == 1;
420 int roc0_orientation = flipped ? -1 : 1;
422 roc0_orientation *= -1;
424 roc0_orientation *= -1;
425 float x1 = xsign * (
mod + half_shift * 0.5);
426 float x2 = xsign * (
mod + half_shift * 0.5 - 1. / 8);
427 float y1 = ysign * (lad + half_shift * 0.5 - 0.5);
428 float y2 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation * 1. / 2);
429 if (!(
phase == 0 && (lad == 1 || lad == nlad) && xsign == -1)) {
430 if (lay == 1 && xsign <= -1) {
431 float x1 = xsign * ((
mod - 1) + half_shift * 0.5);
432 float x2 = xsign * ((
mod - 1) + half_shift * 0.5 + 1. / 8);
433 float y1 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation);
434 float y2 = ysign * (lad + half_shift * 0.5 - 0.5 + roc0_orientation * 3. / 2);
449 for (
int dsk = 1, ndsk = 2 + (
phase == 1); dsk <= ndsk; ++dsk) {
450 for (
int xsign = -1; xsign <= 1; xsign += 2)
451 for (
int ysign = -1; ysign <= 1; ysign += 2) {
453 int first_roc = 3, nbin = 16;
454 for (
int bld = 1, nbld = 12; bld <= nbld; ++bld) {
456 for (
int plq = 1, nplq = 7; plq <= nplq; ++plq) {
458 xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1)) / (
float)nbin);
460 xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * (plq + 1) - (plq == 7)) / (
float)nbin);
461 float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + plq / 2) * 0.1);
462 float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + plq / 2) * 0.1);
467 for (
int plq = 1, nplq = 7 + 1; plq <= nplq; ++plq) {
468 float x = xsign * (half_shift * 0.5 + dsk - 1 +
469 (first_roc - 3 + 2 * plq + (plq == 1) - (plq == 8)) / (
float)nbin);
470 float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + (plq - (plq == 8)) / 2) * 0.1);
471 float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + (plq - (plq == 8)) / 2) * 0.1);
475 for (
int plq = 2, nplq = 6; plq <= nplq; ++plq)
477 float x = xsign * (half_shift * 0.5 + dsk - 1 +
478 (first_roc - 3 + 2 * plq + (plq == 1) - (plq == 8) + 1) / (
float)nbin);
479 float ylow = ysign * (half_shift * 0.5 + (bld - 0.5) - (2 + (plq - (plq == 8)) / 2) * 0.1);
480 float yhigh = ysign * (half_shift * 0.5 + (bld - 0.5) + (2 + (plq - (plq == 8)) / 2) * 0.1);
484 for (
int plq = 1, nplq = 7; plq <= nplq; ++plq) {
485 float x1 = xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1)) / (
float)nbin);
487 xsign * (half_shift * 0.5 + dsk - 1 + (first_roc - 3 + 2 * plq + (plq == 1) + 1) / (
float)nbin);
488 int sign = xsign * ysign * ((plq % 2) ? 1 : -1);
489 float y1 = ysign * (half_shift * 0.5 + (bld - 0.5) +
sign * (2 + plq / 2) * 0.1);
490 float y2 = ysign * (half_shift * 0.5 + (bld - 0.5) +
sign * (plq / 2) * 0.1);
497 }
else if (
phase == 1) {
500 for (
int bld = 1, nbld = 5 +
ring * 6; bld <= nbld; ++bld) {
502 Color_t p1_color = 1, p2_color = 1;
505 float x1 = xsign * (half_shift * 0.5 + dsk - 1 + (
ring - 1) * 0.5);
506 float x2 = xsign * (half_shift * 0.5 + dsk - 1 +
ring * 0.5);
508 float y1 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld +
sign * 0.5);
510 float y2 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld);
511 float yp2_mid = ysign * (half_shift * 0.5 - 0.5 +
scale * bld -
sign * 0.25);
512 float y3 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld -
sign * 0.5);
519 float x = xsign * (half_shift * 0.5 + dsk - 1 + (
ring - 1) * 0.5);
524 x = xsign * (half_shift * 0.5 + dsk);
529 x1 = xsign * (half_shift * 0.5 + dsk - 1 +
ring * 0.5 - 1 / 16.);
530 x2 = xsign * (half_shift * 0.5 + dsk - 1 +
ring * 0.5);
531 float y1_p1 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld +
sign * 0.25);
532 float y2_p1 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld +
sign * 0.25 + xsign * ysign * 0.25);
537 float y1_p2 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld -
sign * 0.25);
538 float y2_p2 = ysign * (half_shift * 0.5 - 0.5 +
scale * bld -
sign * 0.25 - xsign * ysign * 0.25);
545 for (
int bld = 1, nbld = 5 +
ring * 6; bld <= nbld; ++bld) {
546 Color_t p1_color = 1, p2_color = 1;
549 float x1 = xsign * (half_shift * 0.5 + dsk - 1);
550 float x2 = xsign * (half_shift * 0.5 + dsk);
552 float y1 = ysign * (half_shift * 0.5 - 0.5 + bld +
sign * 0.5);
554 float y2 = ysign * (half_shift * 0.5 - 0.5 + bld);
555 float yp2_mid = ysign * (half_shift * 0.5 - 0.5 + bld -
sign * 0.25);
556 float y3 = ysign * (half_shift * 0.5 - 0.5 + bld -
sign * 0.5);
563 float x = xsign * (half_shift * 0.5 + dsk - 1);
568 x = xsign * (half_shift * 0.5 + dsk);
573 x1 = xsign * (half_shift * 0.5 + dsk - 1 / 8.);
574 x2 = xsign * (half_shift * 0.5 + dsk);
575 float y1_p1 = ysign * (half_shift * 0.5 - 0.5 + bld +
sign * 0.25);
576 float y2_p1 = ysign * (half_shift * 0.5 - 0.5 + bld +
sign * 0.25 + xsign * ysign * 0.25);
581 float y1_p2 = ysign * (half_shift * 0.5 - 0.5 + bld -
sign * 0.25);
582 float y2_p2 = ysign * (half_shift * 0.5 - 0.5 + bld -
sign * 0.25 - xsign * ysign * 0.25);
598 if (
phase == 0 &&
h->GetNbinsY() == 250 &&
h->GetNbinsX() == 80) {
599 int nentries =
h->GetEntries();
600 for (
int binx = 1; binx <= 80; ++binx) {
602 for (
int biny = 1; biny <= 250; ++biny) {
603 bool odd_nrocy = (binx - 1 < 40) != (((binx - 1) / 4) % 2);
604 if (biny % 2 == odd_nrocy)
605 sum +=
h->GetBinContent(binx, biny);
607 sum +=
h->GetBinContent(binx, biny);
609 h->SetBinContent(binx, biny, sum);
610 h->SetBinContent(binx, biny - 1, sum);
616 h->SetEntries(nentries);
std::string to_string(const V &value)
void draw_line(double x1, double x2, double y1, double y2, int width, int style, int color)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
T mod(const T &a, const T &b)