1366 label_ =
"SiPixelGainCalibrationOffline_PayloadInspector";
1369 label_ =
"SiPixelGainCalibrationForHLT_PayloadInspector";
1372 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash>>& iovs)
override {
1373 gStyle->SetPaintTextFormat(
".3f");
1375 std::vector<std::tuple<cond::Time_t, cond::Hash>> sorted_iovs = iovs;
1378 std::sort(
begin(sorted_iovs),
end(sorted_iovs), [](
auto const&
t1,
auto const&
t2) {
1379 return std::get<0>(
t1) < std::get<0>(
t2);
1382 auto firstiov = sorted_iovs.front();
1383 auto lastiov = sorted_iovs.back();
1385 std::shared_ptr<PayloadType> last_payload = this->
fetchPayload(std::get<1>(lastiov));
1386 std::shared_ptr<PayloadType> first_payload = this->
fetchPayload(std::get<1>(firstiov));
1388 std::map<uint32_t, float> f_GainsMap_;
1391 std::map<uint32_t, float> l_GainsMap_;
1394 std::string lastIOVsince = std::to_string(std::get<0>(lastiov));
1395 std::string firstIOVsince = std::to_string(std::get<0>(firstiov));
1397 TCanvas
canvas(
"Comparison",
"Comparison", 1600, 800);
1399 std::map<SiPixelPI::regions, std::shared_ptr<TH1F>> FirstGains_spectraByRegion;
1400 std::map<SiPixelPI::regions, std::shared_ptr<TH1F>> LastGains_spectraByRegion;
1401 std::shared_ptr<TH1F> summaryFirst;
1402 std::shared_ptr<TH1F> summaryLast;
1404 float minimum(9999.);
1405 float maximum(-9999.);
1409 maximum =
std::max(last_payload->getGainHigh(), first_payload->getGainHigh());
1410 minimum =
std::min(last_payload->getGainLow(), first_payload->getGainLow());
1413 maximum =
std::max(last_payload->getPedHigh(), first_payload->getPedHigh());
1414 minimum =
std::min(last_payload->getPedLow(), first_payload->getPedLow());
1426 FirstGains_spectraByRegion[
part] =
1427 std::make_shared<TH1F>(Form(
"hfirstGains_%s", s_part.c_str()),
1428 Form(
";%s #LT %s #GT;n. of modules", s_part.c_str(),
TypeName[myType]),
1433 LastGains_spectraByRegion[
part] =
1434 std::make_shared<TH1F>(Form(
"hlastGains_%s", s_part.c_str()),
1435 Form(
";%s #LT %s #GT;n. of modules", s_part.c_str(),
TypeName[myType]),
1441 summaryFirst = std::make_shared<TH1F>(
"first Summary",
1442 Form(
"Summary of #LT per %s %s #GT;;average %s",
1446 FirstGains_spectraByRegion.size(),
1448 FirstGains_spectraByRegion.size());
1450 summaryLast = std::make_shared<TH1F>(
"last Summary",
1451 Form(
"Summary of #LT per %s %s #GT;;average %s",
1455 LastGains_spectraByRegion.size(),
1457 LastGains_spectraByRegion.size());
1460 ?
"Geometry/TrackerCommonData/data/trackerParameters.xml"
1461 :
"Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml";
1465 bool isPhase0(
false);
1473 for (
const auto& it : f_GainsMap_) {
1480 t_info_fromXML.
init();
1481 DetId detid(it.first);
1485 FirstGains_spectraByRegion[thePart]->Fill(it.second);
1489 ?
"Geometry/TrackerCommonData/data/trackerParameters.xml"
1490 :
"Geometry/TrackerCommonData/data/PhaseI/trackerParameters.xml";
1501 for (
const auto& it : l_GainsMap_) {
1508 t_info_fromXML.
init();
1509 DetId detid(it.first);
1513 LastGains_spectraByRegion[thePart]->Fill(it.second);
1524 FirstGains_spectraByRegion[
part]->GetMean() > 10.e-6 ? FirstGains_spectraByRegion[
part]->GetMean() : 0.;
1525 summaryFirst->SetBinContent(
bin, f_mean);
1531 LastGains_spectraByRegion[
part]->GetMean() > 10.e-6 ? LastGains_spectraByRegion[
part]->GetMean() : 0.;
1532 summaryLast->SetBinContent(
bin, l_mean);
1538 summaryFirst->SetMarkerColor(kRed);
1539 summaryFirst->GetXaxis()->LabelsOption(
"v");
1540 summaryFirst->GetXaxis()->SetLabelSize(0.05);
1541 summaryFirst->GetYaxis()->SetTitleOffset(0.9);
1544 summaryLast->SetMarkerColor(kBlue);
1545 summaryLast->GetYaxis()->SetTitleOffset(0.9);
1546 summaryLast->GetXaxis()->LabelsOption(
"v");
1547 summaryLast->GetXaxis()->SetLabelSize(0.05);
1554 summaryFirst->SetFillColor(kRed);
1555 summaryLast->SetFillColor(kBlue);
1557 summaryFirst->SetBarWidth(0.45);
1558 summaryFirst->SetBarOffset(0.1);
1560 summaryLast->SetBarWidth(0.4);
1561 summaryLast->SetBarOffset(0.55);
1563 summaryLast->SetMarkerSize(1.2);
1564 summaryFirst->SetMarkerSize(1.2);
1566 float max = (summaryFirst->GetMaximum() > summaryLast->GetMaximum()) ? summaryFirst->GetMaximum()
1567 : summaryLast->GetMaximum();
1569 summaryFirst->GetYaxis()->SetRangeUser(0.,
std::max(0.,
max * 1.40));
1571 summaryFirst->Draw(
"b text0");
1572 summaryLast->Draw(
"b text0 same");
1574 TLegend
legend = TLegend(0.52, 0.80, 0.98, 0.9);
1575 legend.SetHeader(Form(
"#LT %s #GT value comparison",
TypeName[myType]),
1579 (
"IOV: #scale[1.2]{" + std::to_string(std::get<0>(lastiov)) +
"} | #color[4]{" + std::get<1>(lastiov) +
"}")
1584 (
"IOV: #scale[1.2]{" + std::to_string(std::get<0>(firstiov)) +
"} | #color[2]{" + std::get<1>(firstiov) +
"}")