32 #include "TPaveStats.h" 38 class L1TUtmTriggerMenuDisplayAlgos :
public PlotImage<L1TUtmTriggerMenu, SINGLE_IOV> {
42 bool fill()
override {
43 auto tag = PlotBase::getTag<0>();
44 auto iov =
tag.iovs.front();
47 std::shared_ptr<L1TUtmTriggerMenu>
payload = fetchPayload(std::get<1>(iov));
50 const auto& theMap =
payload->getAlgorithmMap();
52 unsigned int mapsize = theMap.size();
53 float pitch = 1. / (mapsize);
56 std::vector<float> y_x1, y_x2, y_line;
57 std::vector<std::string> s_x1, s_x2, s_x3;
67 s_x1.push_back(
"#scale[1.2]{Algo Name}");
69 s_x2.push_back(
"#scale[1.2]{tag: " +
tag.name +
" in IOV: " + IOVsince +
"}");
74 for (
const auto& [
name,
algo] : theMap) {
80 s_x2.push_back(
"#color[2]{" +
name +
"}");
81 y_line.push_back(y - (pitch / 2.));
84 TCanvas
canvas(
"L1TriggerAlgos",
"L1TriggerAlgos", 2000, mapsize * 40);
88 l.SetTextSize(pitch * 10);
90 for (
unsigned int i = 0;
i < y_x1.size();
i++) {
91 l.DrawLatexNDC(x1, 1 - (1 - y_x1[
i]), s_x1[
i].c_str());
94 for (
unsigned int i = 0;
i < y_x2.size();
i++) {
95 l.DrawLatexNDC(x2, 1 - (1 - y_x2[
i]), s_x2[
i].c_str());
101 TLine
lines[y_line.size()];
103 for (
const auto&
line : y_line) {
104 lines[iL] = TLine(gPad->GetUxmin(), 1 - (1 -
line), gPad->GetUxmax(), 1 - (1 -
line));
105 lines[iL].SetLineWidth(1);
106 lines[iL].SetLineStyle(9);
107 lines[iL].SetLineColor(2);
108 lines[iL].Draw(
"same");
119 template <IOVMultiplicity nIOVs,
int ntags>
120 class L1TUtmTriggerMenu_CompareAlgosBase :
public PlotImage<L1TUtmTriggerMenu, nIOVs, ntags> {
122 L1TUtmTriggerMenu_CompareAlgosBase()
125 bool fill()
override {
127 auto theIOVs = PlotBase::getTag<0>().iovs;
128 auto f_tagname = PlotBase::getTag<0>().
name;
130 auto firstiov = theIOVs.front();
131 std::tuple<cond::Time_t, cond::Hash> lastiov;
134 assert(this->m_plotAnnotations.ntags < 3);
136 if (this->m_plotAnnotations.ntags == 2) {
137 auto tag2iovs = PlotBase::getTag<1>().iovs;
138 l_tagname = PlotBase::getTag<1>().
name;
139 lastiov = tag2iovs.front();
141 lastiov = theIOVs.back();
144 std::shared_ptr<L1TUtmTriggerMenu> last_payload = this->fetchPayload(std::get<1>(lastiov));
145 std::shared_ptr<L1TUtmTriggerMenu> first_payload = this->fetchPayload(std::get<1>(firstiov));
152 if (tmpTagName.empty())
153 tmpTagName = f_tagname;
157 thePlot.plotDiffWithOtherMenu(first_payload.get(), f_tagname, firstIOVsince);
163 using L1TUtmTriggerMenu_CompareAlgos = L1TUtmTriggerMenu_CompareAlgosBase<MULTI_IOV, 1>;
164 using L1TUtmTriggerMenu_CompareAlgosTwoTags = L1TUtmTriggerMenu_CompareAlgosBase<SINGLE_IOV, 2>;
static std::string to_string(const XMLCh *ch)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)