1029 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash>>& iovs)
override {
1030 gStyle->SetOptStat(
"emr");
1031 TGaxis::SetExponentOffset(-0.1, 0.01,
"y");
1032 TH1F::SetDefaultSumw2(
true);
1034 std::vector<std::tuple<cond::Time_t, cond::Hash>> sorted_iovs = iovs;
1036 std::sort(begin(sorted_iovs),
end(sorted_iovs), [](
auto const&
t1,
auto const&
t2) {
1037 return std::get<0>(
t1) < std::get<0>(
t2);
1039 auto firstiov = sorted_iovs.front();
1040 auto lastiov = sorted_iovs.back();
1042 std::shared_ptr<PayloadType> last_payload = this->
fetchPayload(std::get<1>(lastiov));
1043 std::shared_ptr<PayloadType> first_payload = this->
fetchPayload(std::get<1>(firstiov));
1045 std::string lastIOVsince = std::to_string(std::get<0>(lastiov));
1046 std::string firstIOVsince = std::to_string(std::get<0>(firstiov));
1048 float minimum(9999.);
1049 float maximum(-9999.);
1053 maximum =
std::max(last_payload->getGainHigh(), first_payload->getGainHigh());
1054 minimum =
std::min(last_payload->getGainLow(), first_payload->getGainLow());
1057 maximum =
std::max(last_payload->getPedHigh(), first_payload->getPedHigh());
1058 minimum =
std::min(last_payload->getPedLow(), first_payload->getPedLow());
1065 TCanvas
canvas(
"Canv",
"Canv", 1200, 1000);
1067 auto hfirst = std::make_shared<TH1F>(Form(
"First, IOV %s", firstIOVsince.c_str()),
1068 Form(
"SiPixel Gain Calibration %s - %s;per %s %s;# %ss",
1078 auto hlast = std::make_shared<TH1F>(Form(
"Last, IOV %s", lastIOVsince.c_str()),
1079 Form(
"SiPixel Gain Calibration %s - %s;per %s %s;# %ss",
1098 hfirst->GetYaxis()->SetRangeUser(1., extrema.second * 10);
1100 hfirst->SetTitle(
"");
1101 hfirst->SetLineColor(kRed);
1102 hfirst->SetBarWidth(0.95);
1103 hfirst->Draw(
"hist");
1105 hlast->SetTitle(
"");
1106 hlast->SetFillColorAlpha(kBlue, 0.20);
1107 hlast->SetBarWidth(0.95);
1108 hlast->Draw(
"histsames");
1111 hfirst->SetStats(
true);
1113 hlast->SetStats(
true);
1117 TLegend
legend = TLegend(0.45, 0.86, 0.74, 0.94);
1121 legend.AddEntry(hfirst.get(), (
"payload: #color[2]{" + std::get<1>(firstiov) +
"}").c_str(),
"F");
1122 legend.AddEntry(hlast.get(), (
"payload: #color[4]{" + std::get<1>(lastiov) +
"}").c_str(),
"F");
1123 legend.SetTextSize(0.022);
1127 TPaveStats* st1 = (TPaveStats*)hfirst->FindObject(
"stats");
1128 st1->SetTextSize(0.021);
1129 st1->SetLineColor(kRed);
1130 st1->SetTextColor(kRed);
1133 TPaveStats* st2 = (TPaveStats*)hlast->FindObject(
"stats");
1134 st2->SetTextSize(0.021);
1135 st2->SetLineColor(kBlue);
1136 st2->SetTextColor(kBlue);
1139 auto ltx = TLatex();
1140 ltx.SetTextFont(62);
1142 ltx.SetTextSize(0.047);
1143 ltx.SetTextAlign(11);
1144 ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1145 1 - gPad->GetTopMargin() + 0.01,
1146 (
"SiPixel Gain Calibration IOV:#color[2]{" + std::to_string(std::get<0>(firstiov)) +
1147 "} vs IOV:#color[4]{" + std::to_string(std::get<0>(lastiov)) +
"}")