945 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash>>& iovs)
override {
946 gStyle->SetOptStat(
"emr");
947 TGaxis::SetExponentOffset(-0.1, 0.01,
"y");
948 TH1F::SetDefaultSumw2(
true);
950 std::vector<std::tuple<cond::Time_t, cond::Hash>> sorted_iovs = iovs;
952 std::sort(
begin(sorted_iovs),
end(sorted_iovs), [](
auto const&
t1,
auto const&
t2) {
953 return std::get<0>(
t1) < std::get<0>(
t2);
955 auto firstiov = sorted_iovs.front();
956 auto lastiov = sorted_iovs.back();
958 std::shared_ptr<PayloadType> last_payload = this->
fetchPayload(std::get<1>(lastiov));
959 std::shared_ptr<PayloadType> first_payload = this->
fetchPayload(std::get<1>(firstiov));
961 std::string lastIOVsince = std::to_string(std::get<0>(lastiov));
962 std::string firstIOVsince = std::to_string(std::get<0>(firstiov));
964 float minimum(9999.);
965 float maximum(-9999.);
969 maximum =
std::max(last_payload->getGainHigh(), first_payload->getGainHigh());
970 minimum =
std::min(last_payload->getGainLow(), first_payload->getGainLow());
973 maximum =
std::max(last_payload->getPedHigh(), first_payload->getPedHigh());
974 minimum =
std::min(last_payload->getPedLow(), first_payload->getPedLow());
981 TCanvas
canvas(
"Canv",
"Canv", 1200, 1000);
983 auto hfirst = std::make_shared<TH1F>(Form(
"First, IOV %s", firstIOVsince.c_str()),
984 Form(
"SiPixel Gain Calibration %s - %s;per %s %s;# %ss",
994 auto hlast = std::make_shared<TH1F>(Form(
"Last, IOV %s", lastIOVsince.c_str()),
995 Form(
"SiPixel Gain Calibration %s - %s;per %s %s;# %ss",
1014 hfirst->GetYaxis()->SetRangeUser(1., extrema.second * 10);
1016 hfirst->SetTitle(
"");
1017 hfirst->SetLineColor(kRed);
1018 hfirst->SetBarWidth(0.95);
1019 hfirst->Draw(
"hist");
1021 hlast->SetTitle(
"");
1022 hlast->SetFillColorAlpha(kBlue, 0.20);
1023 hlast->SetBarWidth(0.95);
1024 hlast->Draw(
"histsames");
1027 hfirst->SetStats(
true);
1029 hlast->SetStats(
true);
1033 TLegend
legend = TLegend(0.45, 0.86, 0.74, 0.94);
1037 legend.AddEntry(hfirst.get(), (
"payload: #color[2]{" + std::get<1>(firstiov) +
"}").c_str(),
"F");
1038 legend.AddEntry(hlast.get(), (
"payload: #color[4]{" + std::get<1>(lastiov) +
"}").c_str(),
"F");
1039 legend.SetTextSize(0.022);
1043 TPaveStats* st1 = (TPaveStats*)hfirst->FindObject(
"stats");
1044 st1->SetTextSize(0.022);
1045 st1->SetLineColor(kRed);
1046 st1->SetTextColor(kRed);
1049 TPaveStats* st2 = (TPaveStats*)hlast->FindObject(
"stats");
1050 st2->SetTextSize(0.022);
1051 st2->SetLineColor(kBlue);
1052 st2->SetTextColor(kBlue);
1055 auto ltx = TLatex();
1056 ltx.SetTextFont(62);
1058 ltx.SetTextSize(0.047);
1059 ltx.SetTextAlign(11);
1060 ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1061 1 - gPad->GetTopMargin() + 0.01,
1062 (
"SiPixel Gain Calibration IOV:#color[2]{" + std::to_string(std::get<0>(firstiov)) +
1063 "} vs IOV:#color[4]{" + std::to_string(std::get<0>(lastiov)) +
"}")