Skip to content

Commit

Permalink
improve Tracker Alignment Payload Inspector legends
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Apr 7, 2022
1 parent 483d578 commit 82449e4
Showing 1 changed file with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ namespace {

canvas.cd();

canvas.SetTopMargin(0.06);
canvas.SetLeftMargin(0.17);
canvas.SetRightMargin(0.05);
canvas.SetBottomMargin(0.15);
Expand Down Expand Up @@ -254,22 +255,29 @@ namespace {
tSubdet.DrawLatex(theX_, 0.20, Form("%s", (AlignmentPI::getStringFromPart(thePart)).c_str()));
}

TLegend legend = TLegend(0.58, 0.82, 0.95, 0.9);
legend.SetTextSize(0.03);
legend.SetHeader("Alignment comparison", "C"); // option "C" allows to center the header
legend.AddEntry(
compare.get(),
("IOV:" + std::to_string(std::get<0>(lastiov)) + "-" + std::to_string(std::get<0>(firstiov))).c_str(),
"PL");
TLegend legend = TLegend(0.17, 0.86, 0.95, 0.94);
if (this->m_plotAnnotations.ntags == 2) {
legend.SetHeader("#bf{Two Tags Comparison}", "C"); // option "C" allows to center the header
legend.AddEntry(
compare.get(),
("#splitline{" + tagname1 + " : " + firstIOVsince + "}{" + tagname2 + " : " + lastIOVsince + "}").c_str(),
"PL");
} else {
legend.SetHeader(("tag: #bf{" + tagname1 + "}").c_str(), "C"); // option "C" allows to center the header
legend.AddEntry(compare.get(),
("#splitline{IOV since: " + firstIOVsince + "}{IOV since: " + lastIOVsince + "}").c_str(),
"PL");
}
legend.SetTextSize(0.020);
legend.Draw("same");

TLatex t1;
t1.SetNDC();
t1.SetTextAlign(21);
t1.SetTextSize(0.05);
t1.DrawLatex(0.2, 0.93, Form("%s", s_coord.c_str()));
t1.SetTextColor(kBlue);
t1.DrawLatex(0.6, 0.93, Form("IOV %s - %s ", lastIOVsince.c_str(), firstIOVsince.c_str()));
auto ltx = TLatex();
ltx.SetTextFont(62);
ltx.SetTextSize(0.042);
ltx.SetTextAlign(11);
ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1 - gPad->GetTopMargin() + 0.01,
("Tracker Alignment Comparison:#color[4]{" + s_coord + "}").c_str());

std::string fileName(this->m_imageFileName);
canvas.SaveAs(fileName.c_str());
Expand Down

0 comments on commit 82449e4

Please sign in to comment.