1028 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash>>& iovs)
override {
1029 gStyle->SetOptStat(
"emr");
1030 TGaxis::SetExponentOffset(-0.1, 0.01,
"y");
1031 TH1F::SetDefaultSumw2(
true);
1033 std::vector<std::tuple<cond::Time_t, cond::Hash>> sorted_iovs = iovs;
1035 std::sort(begin(sorted_iovs),
end(sorted_iovs), [](
auto const&
t1,
auto const&
t2) {
1036 return std::get<0>(
t1) < std::get<0>(
t2);
1038 auto firstiov = sorted_iovs.front();
1039 auto lastiov = sorted_iovs.back();
1041 std::shared_ptr<PayloadType> last_payload = this->
fetchPayload(std::get<1>(lastiov));
1042 std::shared_ptr<PayloadType> first_payload = this->
fetchPayload(std::get<1>(firstiov));
1044 std::string lastIOVsince = std::to_string(std::get<0>(lastiov));
1045 std::string firstIOVsince = std::to_string(std::get<0>(firstiov));
1047 float minimum(9999.);
1048 float maximum(-9999.);
1052 maximum =
std::max(last_payload->getGainHigh(), first_payload->getGainHigh());
1053 minimum =
std::min(last_payload->getGainLow(), first_payload->getGainLow());
1056 maximum =
std::max(last_payload->getPedHigh(), first_payload->getPedHigh());
1057 minimum =
std::min(last_payload->getPedLow(), first_payload->getPedLow());
1064 TCanvas
canvas(
"Canv",
"Canv", 1200, 1000);
1066 auto hfirst = std::make_shared<TH1F>(Form(
"First, IOV %s", firstIOVsince.c_str()),
1067 Form(
"SiPixel Gain Calibration %s - %s;per %s %s;# %ss",
1077 auto hlast = std::make_shared<TH1F>(Form(
"Last, IOV %s", lastIOVsince.c_str()),
1078 Form(
"SiPixel Gain Calibration %s - %s;per %s %s;# %ss",
1097 hfirst->GetYaxis()->SetRangeUser(1., extrema.second * 10);
1099 hfirst->SetTitle(
"");
1100 hfirst->SetLineColor(kRed);
1101 hfirst->SetBarWidth(0.95);
1102 hfirst->Draw(
"hist");
1104 hlast->SetTitle(
"");
1105 hlast->SetFillColorAlpha(kBlue, 0.20);
1106 hlast->SetBarWidth(0.95);
1107 hlast->Draw(
"histsames");
1110 hfirst->SetStats(
true);
1112 hlast->SetStats(
true);
1116 TLegend
legend = TLegend(0.45, 0.86, 0.74, 0.94);
1120 legend.AddEntry(hfirst.get(), (
"payload: #color[2]{" + std::get<1>(firstiov) +
"}").c_str(),
"F");
1121 legend.AddEntry(hlast.get(), (
"payload: #color[4]{" + std::get<1>(lastiov) +
"}").c_str(),
"F");
1122 legend.SetTextSize(0.022);
1126 TPaveStats* st1 = (TPaveStats*)hfirst->FindObject(
"stats");
1127 st1->SetTextSize(0.021);
1128 st1->SetLineColor(kRed);
1129 st1->SetTextColor(kRed);
1132 TPaveStats* st2 = (TPaveStats*)hlast->FindObject(
"stats");
1133 st2->SetTextSize(0.021);
1134 st2->SetLineColor(kBlue);
1135 st2->SetTextColor(kBlue);
1138 auto ltx = TLatex();
1139 ltx.SetTextFont(62);
1141 ltx.SetTextSize(0.047);
1142 ltx.SetTextAlign(11);
1143 ltx.DrawLatexNDC(gPad->GetLeftMargin(),
1144 1 - gPad->GetTopMargin() + 0.01,
1145 (
"SiPixel Gain Calibration IOV:#color[2]{" + std::to_string(std::get<0>(firstiov)) +
1146 "} vs IOV:#color[4]{" + std::to_string(std::get<0>(lastiov)) +
"}")