1568 label_ =
"SiPixelGainCalibrationOffline_PayloadInspector";
1571 label_ =
"SiPixelGainCalibrationForHLT_PayloadInspector";
1575 bool fill()
override {
1576 gStyle->SetPaintTextFormat(
".3f");
1579 auto theIOVs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
1580 auto f_tagname = cond::payloadInspector::PlotBase::getTag<0>().name;
1582 auto firstiov = theIOVs.front();
1583 std::tuple<cond::Time_t, cond::Hash> lastiov;
1589 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
1590 l_tagname = cond::payloadInspector::PlotBase::getTag<1>().name;
1591 lastiov = tag2iovs.front();
1593 lastiov = theIOVs.back();
1596 std::shared_ptr<PayloadType> last_payload = this->
fetchPayload(std::get<1>(lastiov));
1597 std::shared_ptr<PayloadType> first_payload = this->
fetchPayload(std::get<1>(firstiov));
1599 std::map<uint32_t, float> f_GainsMap_;
1602 std::map<uint32_t, float> l_GainsMap_;
1605 std::string lastIOVsince = std::to_string(std::get<0>(lastiov));
1606 std::string firstIOVsince = std::to_string(std::get<0>(firstiov));
1608 TCanvas
canvas(
"Comparison",
"Comparison", 1600, 800);
1613 std::map<SiPixelPI::regions, std::shared_ptr<TH1F>> FirstGains_spectraByRegion;
1614 std::map<SiPixelPI::regions, std::shared_ptr<TH1F>> LastGains_spectraByRegion;
1615 std::shared_ptr<TH1F> summaryFirst;
1616 std::shared_ptr<TH1F> summaryLast;
1618 float minimum(9999.);
1619 float maximum(-9999.);
1623 maximum =
std::max(last_payload->getGainHigh(), first_payload->getGainHigh());
1624 minimum =
std::min(last_payload->getGainLow(), first_payload->getGainLow());
1627 maximum =
std::max(last_payload->getPedHigh(), first_payload->getPedHigh());
1628 minimum =
std::min(last_payload->getPedLow(), first_payload->getPedLow());
1640 FirstGains_spectraByRegion[
part] =
1641 std::make_shared<TH1F>(Form(
"hfirstGains_%s", s_part.c_str()),
1642 Form(
";%s #LT %s #GT;n. of modules", s_part.c_str(),
TypeName[myType]),
1647 LastGains_spectraByRegion[
part] =
1648 std::make_shared<TH1F>(Form(
"hlastGains_%s", s_part.c_str()),
1649 Form(
";%s #LT %s #GT;n. of modules", s_part.c_str(),
TypeName[myType]),
1655 summaryFirst = std::make_shared<TH1F>(
"first Summary",
1656 Form(
"Summary of #LT per %s %s #GT;;average %s",
1660 FirstGains_spectraByRegion.size(),
1662 FirstGains_spectraByRegion.size());
1664 summaryLast = std::make_shared<TH1F>(
"last Summary",
1665 Form(
"Summary of #LT per %s %s #GT;;average %s",
1669 LastGains_spectraByRegion.size(),
1671 LastGains_spectraByRegion.size());
1674 const char* path_toTopologyXML = f_phaseInfo.pathToTopoXML();
1682 for (
const auto& it : f_GainsMap_) {
1689 t_info_fromXML.
init();
1690 DetId detid(it.first);
1694 FirstGains_spectraByRegion[thePart]->Fill(it.second);
1698 path_toTopologyXML = l_phaseInfo.pathToTopoXML();
1706 for (
const auto& it : l_GainsMap_) {
1713 t_info_fromXML.
init();
1714 DetId detid(it.first);
1718 LastGains_spectraByRegion[thePart]->Fill(it.second);
1729 FirstGains_spectraByRegion[
part]->GetMean() > 10.e-6 ? FirstGains_spectraByRegion[
part]->GetMean() : 0.;
1730 summaryFirst->SetBinContent(
bin, f_mean);
1736 LastGains_spectraByRegion[
part]->GetMean() > 10.e-6 ? LastGains_spectraByRegion[
part]->GetMean() : 0.;
1737 summaryLast->SetBinContent(
bin, l_mean);
1743 summaryFirst->SetMarkerColor(kRed);
1744 summaryFirst->GetXaxis()->LabelsOption(
"v");
1745 summaryFirst->GetXaxis()->SetLabelSize(0.05);
1746 summaryFirst->GetYaxis()->SetTitleOffset(0.9);
1749 summaryLast->SetMarkerColor(kBlue);
1750 summaryLast->GetYaxis()->SetTitleOffset(0.9);
1751 summaryLast->GetXaxis()->LabelsOption(
"v");
1752 summaryLast->GetXaxis()->SetLabelSize(0.05);
1759 summaryFirst->SetFillColor(kRed);
1760 summaryLast->SetFillColor(kBlue);
1762 summaryFirst->SetBarWidth(0.45);
1763 summaryFirst->SetBarOffset(0.1);
1765 summaryLast->SetBarWidth(0.4);
1766 summaryLast->SetBarOffset(0.55);
1768 summaryLast->SetMarkerSize(1.2);
1769 summaryFirst->SetMarkerSize(1.2);
1771 float max = (summaryFirst->GetMaximum() > summaryLast->GetMaximum()) ? summaryFirst->GetMaximum()
1772 : summaryLast->GetMaximum();
1774 summaryFirst->GetYaxis()->SetRangeUser(0.,
std::max(0.,
max * 1.40));
1776 summaryFirst->Draw(
"b text0");
1777 summaryLast->Draw(
"b text0 same");
1779 TLegend
legend = TLegend(0.52, 0.80, 0.98, 0.9);
1780 legend.SetHeader(Form(
"#LT %s #GT value comparison",
TypeName[myType]),
1783 legend.SetHeader(
"#mu_{H} value comparison",
"C");
1786 l_tagOrHash = l_tagname;
1787 f_tagOrHash = f_tagname;
1789 l_tagOrHash = std::get<1>(lastiov);
1790 f_tagOrHash = std::get<1>(firstiov);
1795 (
"IOV: #scale[1.2]{" + std::to_string(std::get<0>(lastiov)) +
"} | #color[4]{" + l_tagOrHash +
"}").c_str(),
1799 (
"IOV: #scale[1.2]{" + std::to_string(std::get<0>(firstiov)) +
"} | #color[2]{" + f_tagOrHash +
"}").c_str(),