608 double par_Pt = 100.;
612 auto ip = paramValues.find(
"Jet_Pt");
613 if (ip != paramValues.end()) {
614 par_Pt = std::stod(ip->second);
616 ip = paramValues.find(
"Jet_Eta");
617 if (ip != paramValues.end()) {
618 par_Eta = std::stod(ip->second);
628 TLegend* leg_eta =
new TLegend(0.26, 0.73, 0.935, 0.90);
629 TLegend* leg_pt =
new TLegend(0.26, 0.73, 0.935, 0.90);
631 leg_eta->SetBorderSize(0);
632 leg_eta->SetLineStyle(0);
633 leg_eta->SetFillStyle(0);
635 leg_eta->SetTextFont(42);
636 leg_pt->SetBorderSize(0);
637 leg_pt->SetLineStyle(0);
638 leg_pt->SetFillStyle(0);
640 auto tag = PlotBase::getTag<0>();
641 auto iov =
tag.iovs.front();
643 unsigned int run = std::get<0>(iov);
645 std::stringstream ss_tagname(
tag.name);
652 getline(ss_tagname, stmp,
'_');
653 getline(ss_tagname, stmp,
'_');
655 getline(ss_tagname, stmp,
'_');
656 tag_ver +=
'_' + stmp;
657 getline(ss_tagname, stmp,
'_');
658 tag_ver +=
'_' + stmp;
659 getline(ss_tagname, stmp,
'_');
660 tag_ver +=
'_' + stmp;
661 getline(ss_tagname, stmp,
'_');
663 getline(ss_tagname, stmp,
'_');
666 bool is_2bin =
false;
669 if (!
payload->getRecords().empty() &&
670 payload->getDefinition().getFormulaString().compare(
"") != 0)
677 JetParameters j_param;
678 j_param.setJetPt(par_Pt);
679 j_param.setJetEta(x_axis);
681 if (
payload->getRecord(j_param) ==
nullptr) {
686 if (
record.getBinsRange().size() > 1)
689 if (
record.getParametersValues().size() == 3) {
690 sf_eta_norm->SetBinContent(
idx + 1,
record.getParametersValues()[0]);
691 sf_eta_down->SetBinContent(
idx + 1,
record.getParametersValues()[1]);
692 sf_eta_up->SetBinContent(
idx + 1,
record.getParametersValues()[2]);
699 JetParameters j_param;
700 j_param.setJetEta(par_Eta);
701 j_param.setJetPt(x_axis);
703 if (
payload->getRecord(j_param) ==
nullptr) {
708 if (
record.getParametersValues().size() == 3) {
709 sf_pt_norm->SetBinContent(
idx + 1,
record.getParametersValues()[0]);
710 sf_pt_down->SetBinContent(
idx + 1,
record.getParametersValues()[1]);
711 sf_pt_up->SetBinContent(
idx + 1,
record.getParametersValues()[2]);
715 gStyle->SetOptStat(0);
716 gStyle->SetLabelFont(42,
"XYZ");
717 gStyle->SetLabelSize(0.05,
"XYZ");
718 gStyle->SetFrameLineWidth(3);
721 TCanvas
canvas(
"Jet ScaleFactor Summary",
title.c_str(), 800, 1200);
725 sf_eta_up->SetTitle(
"ScaleFactor vs. #eta");
726 sf_eta_up->SetXTitle(
"#eta");
727 sf_eta_up->SetYTitle(
"Scale Factor");
728 sf_eta_up->SetLineStyle(7);
729 sf_eta_up->SetLineWidth(3);
730 sf_eta_up->SetFillColorAlpha(kGray, 0.5);
731 sf_eta_up->SetMaximum(sf_eta_up->GetMaximum() * 1.25);
732 sf_eta_up->SetMinimum(0.);
733 sf_eta_up->Draw(
"][");
735 sf_eta_down->SetLineStyle(7);
736 sf_eta_down->SetLineWidth(3);
737 sf_eta_down->SetFillColorAlpha(kWhite, 1);
738 sf_eta_down->Draw(
"][ same");
740 sf_eta_norm->SetLineStyle(1);
741 sf_eta_norm->SetLineWidth(5);
742 sf_eta_norm->SetFillColor(0);
743 sf_eta_norm->Draw(
"][ same");
744 sf_eta_norm->Draw(
"axis same");
746 leg_eta->AddEntry(sf_eta_norm, (tag_ver +
'_' + tag_jet).c_str(),
"l");
747 leg_eta->AddEntry((TObject*)
nullptr, Form(
"JetPt=%.2f", par_Pt),
"");
750 if (is_2bin ==
true) {
752 sf_pt_up->SetTitle(
"ScaleFactor vs. p_{T}");
753 sf_pt_up->SetXTitle(
"p_{T} [GeV]");
754 sf_pt_up->SetYTitle(
"Scale Factor");
755 sf_pt_up->SetLineStyle(7);
756 sf_pt_up->SetLineWidth(3);
757 sf_pt_up->SetFillColorAlpha(kGray, 0.5);
758 sf_pt_up->SetMaximum(sf_pt_up->GetMaximum() * 1.25);
759 sf_pt_up->SetMinimum(0.);
760 sf_pt_up->Draw(
"][");
762 sf_pt_down->SetLineStyle(7);
763 sf_pt_down->SetLineWidth(3);
764 sf_pt_down->SetFillColorAlpha(kWhite, 1);
765 sf_pt_down->Draw(
"][ same");
767 sf_pt_norm->SetLineStyle(1);
768 sf_pt_norm->SetLineWidth(5);
769 sf_pt_norm->SetFillColor(0);
770 sf_pt_norm->Draw(
"][ same");
771 sf_pt_norm->Draw(
"axis same");
773 leg_pt->AddEntry(sf_pt_norm, (tag_ver +
'_' + tag_jet).c_str(),
"l");
774 leg_pt->AddEntry((TObject*)
nullptr, Form(
"JetEta=%.2f", par_Eta),
"");
std::string m_imageFileName
const std::map< std::string, std::string > & inputParamValues() const
std::string title() const
std::shared_ptr< JetResolutionObject > fetchPayload(const cond::Hash &payloadHash)