1 #ifndef CondCore_L1TPlugins_L1TUtmTriggerMenuPayloadInspectorHelper_H 2 #define CondCore_L1TPlugins_L1TUtmTriggerMenuPayloadInspectorHelper_H 32 std::vector<std::string>
output;
35 std::back_inserter(
output),
36 [](
const std::pair<std::string, L1TUtmAlgorithm>& pair) {
44 std::vector<std::string>
output;
47 std::back_inserter(
output),
48 [](
const std::pair<std::string, L1TUtmCondition>& pair) {
57 const auto& otherMap = getOtherMap<T>(
other);
58 const auto& thisMap = getThisMap<T>();
60 std::vector<std::string> commonKeys;
63 std::for_each(thisMap.begin(), thisMap.end(), [&commonKeys, &otherMap](
const std::pair<std::string, T>& pair) {
67 if (otherMap.find(
key) != otherMap.end()) {
68 commonKeys.push_back(
key);
77 const auto& otherMap = getOtherMap<T>(
other);
78 const auto& thisMap = getThisMap<T>();
80 std::vector<std::string> stringsOnlyInFirstMap;
84 thisMap.begin(), thisMap.end(), [&stringsOnlyInFirstMap, &otherMap](
const std::pair<std::string, T>& pair) {
87 if (otherMap.find(
key) == otherMap.end()) {
88 stringsOnlyInFirstMap.push_back(
key);
92 return stringsOnlyInFirstMap;
98 const auto& otherMap = getOtherMap<T>(
other);
99 const auto& thisMap = getThisMap<T>();
101 std::vector<std::string> stringsOnlyInSecondMap;
105 otherMap.begin(), otherMap.end(), [thisMap, &stringsOnlyInSecondMap](
const std::pair<std::string, T>& pair) {
109 if (thisMap.find(
key) == thisMap.end()) {
110 stringsOnlyInSecondMap.push_back(
key);
114 return stringsOnlyInSecondMap;
122 template <
typename T>
125 return other->getConditionMap();
127 return other->getAlgorithmMap();
132 template <
typename T>
142 template <
typename T>
159 const auto& vec_only_in_this =
m_info.template onlyInThis<T>(
other);
160 const auto& vec_only_in_other =
m_info.template onlyInOther<T>(
other);
163 unsigned int mapsize = vec_only_in_this.size() + vec_only_in_other.size();
166 float canvasHeight =
std::max(800.0
f, mapsize * 30.0
f);
167 float pitch = 1.0 / (mapsize + 3.0);
170 float x1 = 0.02, x2 = x1 + 0.37;
171 std::vector<float> y_x1, y_x2, y_line;
172 std::vector<std::string> s_x1, s_x2;
185 s_x2.push_back(
"#scale[1.1]{Refer tag / IOV: #color[4]{" + theRefTag +
"} / " + theRefIOV +
"}");
191 for (
const auto& ref : vec_only_in_other) {
194 s_x1.push_back(
"#scale[0.7]{" + ref +
"}");
196 s_x2.push_back(
"#color[4]{#bf{Only in reference, not in target.}}");
197 y_line.push_back(y - (pitch / 2.0));
201 for (
const auto& tar : vec_only_in_this) {
204 s_x1.push_back(
"#scale[0.7]{" + tar +
"}");
206 s_x2.push_back(
"#color[2]{#bf{Only in target, not in reference.}}");
207 y_line.push_back(y - (pitch / 2.0));
211 TCanvas
canvas(
"L1TUtmMenuData",
"L1TUtmMenuData", 2000, static_cast<int>(canvasHeight));
216 float textSize = std::clamp(pitch, 0.015
f, 0.035
f);
220 for (
unsigned int i = 0;
i < y_x1.size();
i++) {
221 l.DrawLatexNDC(x1, y_x1[
i], s_x1[
i].c_str());
223 for (
unsigned int i = 0;
i < y_x2.size();
i++) {
224 l.DrawLatexNDC(x2, y_x2[
i], s_x2[
i].c_str());
228 TLine
lines[y_line.size()];
229 for (
unsigned int i = 0;
i < y_line.size();
i++) {
230 lines[
i] = TLine(gPad->GetUxmin(), y_line[
i], gPad->GetUxmax(), y_line[
i]);
255 return "#scale[1.1]{Condition Name}";
260 return "#scale[1.1]{Algo Name}";
key
prepare the HTCondor submission files and eventually submit them