1506 label_ =
"SiPixelGainCalibrationForHLT_PayloadInspector";
1510 bool fill()
override {
1511 gStyle->SetPaintTextFormat(
".3f");
1514 auto theIOVs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
1515 auto f_tagname = cond::payloadInspector::PlotBase::getTag<0>().name;
1517 auto firstiov = theIOVs.front();
1518 std::tuple<cond::Time_t, cond::Hash> lastiov;
1524 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
1525 l_tagname = cond::payloadInspector::PlotBase::getTag<1>().name;
1526 lastiov = tag2iovs.front();
1528 lastiov = theIOVs.back();
1531 std::shared_ptr<PayloadType> last_payload = this->
fetchPayload(std::get<1>(lastiov));
1532 std::shared_ptr<PayloadType> first_payload = this->
fetchPayload(std::get<1>(firstiov));
1534 std::map<uint32_t, float> f_GainsMap_;
1537 std::map<uint32_t, float> l_GainsMap_;
1540 std::string lastIOVsince = std::to_string(std::get<0>(lastiov));
1541 std::string firstIOVsince = std::to_string(std::get<0>(firstiov));
1543 TCanvas
canvas(
"Comparison",
"Comparison", 1600, 800);
1548 std::map<SiPixelPI::regions, std::shared_ptr<TH1F>> FirstGains_spectraByRegion;
1549 std::map<SiPixelPI::regions, std::shared_ptr<TH1F>> LastGains_spectraByRegion;
1550 std::shared_ptr<TH1F> summaryFirst;
1551 std::shared_ptr<TH1F> summaryLast;
1553 float minimum(9999.);
1554 float maximum(-9999.);
1558 maximum =
std::max(last_payload->getGainHigh(), first_payload->getGainHigh());
1559 minimum =
std::min(last_payload->getGainLow(), first_payload->getGainLow());
1562 maximum =
std::max(last_payload->getPedHigh(), first_payload->getPedHigh());
1563 minimum =
std::min(last_payload->getPedLow(), first_payload->getPedLow());
1575 FirstGains_spectraByRegion[
part] =
1576 std::make_shared<TH1F>(Form(
"hfirstGains_%s", s_part.c_str()),
1577 Form(
";%s #LT %s #GT;n. of modules", s_part.c_str(),
TypeName[myType]),
1582 LastGains_spectraByRegion[
part] =
1583 std::make_shared<TH1F>(Form(
"hlastGains_%s", s_part.c_str()),
1584 Form(
";%s #LT %s #GT;n. of modules", s_part.c_str(),
TypeName[myType]),
1590 summaryFirst = std::make_shared<TH1F>(
"first Summary",
1591 Form(
"Summary of #LT per %s %s #GT;;average %s",
1595 FirstGains_spectraByRegion.size(),
1597 FirstGains_spectraByRegion.size());
1599 summaryLast = std::make_shared<TH1F>(
"last Summary",
1600 Form(
"Summary of #LT per %s %s #GT;;average %s",
1604 LastGains_spectraByRegion.size(),
1606 LastGains_spectraByRegion.size());
1609 const char* path_toTopologyXML = f_phaseInfo.pathToTopoXML();
1617 for (
const auto& it : f_GainsMap_) {
1624 t_info_fromXML.
init();
1625 DetId detid(it.first);
1629 FirstGains_spectraByRegion[thePart]->Fill(it.second);
1633 path_toTopologyXML = l_phaseInfo.pathToTopoXML();
1641 for (
const auto& it : l_GainsMap_) {
1648 t_info_fromXML.
init();
1649 DetId detid(it.first);
1653 LastGains_spectraByRegion[thePart]->Fill(it.second);
1664 FirstGains_spectraByRegion[
part]->GetMean() > 10.e-6 ? FirstGains_spectraByRegion[
part]->GetMean() : 0.;
1665 summaryFirst->SetBinContent(
bin, f_mean);
1671 LastGains_spectraByRegion[
part]->GetMean() > 10.e-6 ? LastGains_spectraByRegion[
part]->GetMean() : 0.;
1672 summaryLast->SetBinContent(
bin, l_mean);
1678 summaryFirst->SetMarkerColor(kRed);
1679 summaryFirst->GetXaxis()->LabelsOption(
"v");
1680 summaryFirst->GetXaxis()->SetLabelSize(0.05);
1681 summaryFirst->GetYaxis()->SetTitleOffset(0.9);
1684 summaryLast->SetMarkerColor(kBlue);
1685 summaryLast->GetYaxis()->SetTitleOffset(0.9);
1686 summaryLast->GetXaxis()->LabelsOption(
"v");
1687 summaryLast->GetXaxis()->SetLabelSize(0.05);
1694 summaryFirst->SetFillColor(kRed);
1695 summaryLast->SetFillColor(kBlue);
1697 summaryFirst->SetBarWidth(0.45);
1698 summaryFirst->SetBarOffset(0.1);
1700 summaryLast->SetBarWidth(0.4);
1701 summaryLast->SetBarOffset(0.55);
1703 summaryLast->SetMarkerSize(1.2);
1704 summaryFirst->SetMarkerSize(1.2);
1706 float max = (summaryFirst->GetMaximum() > summaryLast->GetMaximum()) ? summaryFirst->GetMaximum()
1707 : summaryLast->GetMaximum();
1709 summaryFirst->GetYaxis()->SetRangeUser(0.,
std::max(0.,
max * 1.40));
1711 summaryFirst->Draw(
"b text0");
1712 summaryLast->Draw(
"b text0 same");
1714 TLegend
legend = TLegend(0.52, 0.80, 0.98, 0.9);
1715 legend.SetHeader(Form(
"#LT %s #GT value comparison",
TypeName[myType]),
1718 legend.SetHeader(
"#mu_{H} value comparison",
"C");
1721 l_tagOrHash = l_tagname;
1722 f_tagOrHash = f_tagname;
1724 l_tagOrHash = std::get<1>(lastiov);
1725 f_tagOrHash = std::get<1>(firstiov);
1730 (
"IOV: #scale[1.2]{" + std::to_string(std::get<0>(lastiov)) +
"} | #color[4]{" + l_tagOrHash +
"}").c_str(),
1734 (
"IOV: #scale[1.2]{" + std::to_string(std::get<0>(firstiov)) +
"} | #color[2]{" + f_tagOrHash +
"}").c_str(),