1616 label_ =
"SiPixelGainCalibrationOffline_PayloadInspector";
1619 label_ =
"SiPixelGainCalibrationForHLT_PayloadInspector";
1623 bool fill()
override {
1624 gStyle->SetPaintTextFormat(
".3f");
1627 auto theIOVs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
1628 auto f_tagname = cond::payloadInspector::PlotBase::getTag<0>().name;
1630 auto firstiov = theIOVs.front();
1631 std::tuple<cond::Time_t, cond::Hash> lastiov;
1637 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
1638 l_tagname = cond::payloadInspector::PlotBase::getTag<1>().name;
1639 lastiov = tag2iovs.front();
1641 lastiov = theIOVs.back();
1644 std::shared_ptr<PayloadType> last_payload = this->
fetchPayload(std::get<1>(lastiov));
1645 std::shared_ptr<PayloadType> first_payload = this->
fetchPayload(std::get<1>(firstiov));
1647 std::map<uint32_t, float> f_GainsMap_;
1650 std::map<uint32_t, float> l_GainsMap_;
1653 std::string lastIOVsince = std::to_string(std::get<0>(lastiov));
1654 std::string firstIOVsince = std::to_string(std::get<0>(firstiov));
1656 TCanvas
canvas(
"Comparison",
"Comparison", 1600, 800);
1661 std::map<SiPixelPI::regions, std::shared_ptr<TH1F>> FirstGains_spectraByRegion;
1662 std::map<SiPixelPI::regions, std::shared_ptr<TH1F>> LastGains_spectraByRegion;
1663 std::shared_ptr<TH1F> summaryFirst;
1664 std::shared_ptr<TH1F> summaryLast;
1666 float minimum(9999.);
1667 float maximum(-9999.);
1671 maximum =
std::max(last_payload->getGainHigh(), first_payload->getGainHigh());
1672 minimum =
std::min(last_payload->getGainLow(), first_payload->getGainLow());
1675 maximum =
std::max(last_payload->getPedHigh(), first_payload->getPedHigh());
1676 minimum =
std::min(last_payload->getPedLow(), first_payload->getPedLow());
1688 FirstGains_spectraByRegion[
part] =
1689 std::make_shared<TH1F>(Form(
"hfirstGains_%s", s_part.c_str()),
1690 Form(
";%s #LT %s #GT;n. of modules", s_part.c_str(),
TypeName[myType]),
1695 LastGains_spectraByRegion[
part] =
1696 std::make_shared<TH1F>(Form(
"hlastGains_%s", s_part.c_str()),
1697 Form(
";%s #LT %s #GT;n. of modules", s_part.c_str(),
TypeName[myType]),
1703 summaryFirst = std::make_shared<TH1F>(
"first Summary",
1704 Form(
"Summary of #LT per %s %s #GT;;average %s",
1708 FirstGains_spectraByRegion.size(),
1710 FirstGains_spectraByRegion.size());
1712 summaryLast = std::make_shared<TH1F>(
"last Summary",
1713 Form(
"Summary of #LT per %s %s #GT;;average %s",
1717 LastGains_spectraByRegion.size(),
1719 LastGains_spectraByRegion.size());
1722 const char* path_toTopologyXML = f_phaseInfo.pathToTopoXML();
1730 for (
const auto& it : f_GainsMap_) {
1737 t_info_fromXML.
init();
1738 DetId detid(it.first);
1742 FirstGains_spectraByRegion[thePart]->Fill(it.second);
1746 path_toTopologyXML = l_phaseInfo.pathToTopoXML();
1754 for (
const auto& it : l_GainsMap_) {
1761 t_info_fromXML.
init();
1762 DetId detid(it.first);
1766 LastGains_spectraByRegion[thePart]->Fill(it.second);
1777 FirstGains_spectraByRegion[
part]->GetMean() > 10.e-6 ? FirstGains_spectraByRegion[
part]->GetMean() : 0.;
1778 summaryFirst->SetBinContent(
bin, f_mean);
1784 LastGains_spectraByRegion[
part]->GetMean() > 10.e-6 ? LastGains_spectraByRegion[
part]->GetMean() : 0.;
1785 summaryLast->SetBinContent(
bin, l_mean);
1791 summaryFirst->SetMarkerColor(kRed);
1792 summaryFirst->GetXaxis()->LabelsOption(
"v");
1793 summaryFirst->GetXaxis()->SetLabelSize(0.05);
1794 summaryFirst->GetYaxis()->SetTitleOffset(0.9);
1797 summaryLast->SetMarkerColor(kBlue);
1798 summaryLast->GetYaxis()->SetTitleOffset(0.9);
1799 summaryLast->GetXaxis()->LabelsOption(
"v");
1800 summaryLast->GetXaxis()->SetLabelSize(0.05);
1807 summaryFirst->SetFillColor(kRed);
1808 summaryLast->SetFillColor(kBlue);
1810 summaryFirst->SetBarWidth(0.45);
1811 summaryFirst->SetBarOffset(0.1);
1813 summaryLast->SetBarWidth(0.4);
1814 summaryLast->SetBarOffset(0.55);
1816 summaryLast->SetMarkerSize(1.2);
1817 summaryFirst->SetMarkerSize(1.2);
1819 float max = (summaryFirst->GetMaximum() > summaryLast->GetMaximum()) ? summaryFirst->GetMaximum()
1820 : summaryLast->GetMaximum();
1822 summaryFirst->GetYaxis()->SetRangeUser(0.,
std::max(0.,
max * 1.40));
1824 summaryFirst->Draw(
"b text0");
1825 summaryLast->Draw(
"b text0 same");
1827 TLegend
legend = TLegend(0.52, 0.80, 0.98, 0.9);
1828 legend.SetHeader(Form(
"#LT %s #GT value comparison",
TypeName[myType]),
1831 legend.SetHeader(
"#mu_{H} value comparison",
"C");
1834 l_tagOrHash = l_tagname;
1835 f_tagOrHash = f_tagname;
1837 l_tagOrHash = std::get<1>(lastiov);
1838 f_tagOrHash = std::get<1>(firstiov);
1843 (
"IOV: #scale[1.2]{" + std::to_string(std::get<0>(lastiov)) +
"} | #color[4]{" + l_tagOrHash +
"}").c_str(),
1847 (
"IOV: #scale[1.2]{" + std::to_string(std::get<0>(firstiov)) +
"} | #color[2]{" + f_tagOrHash +
"}").c_str(),