706 double par_Pt = 100.;
710 auto ip = paramValues.find(
"Jet_Pt");
711 if (ip != paramValues.end()) {
712 par_Pt = std::stod(ip->second);
714 ip = paramValues.find(
"Jet_Eta");
715 if (ip != paramValues.end()) {
716 par_Eta = std::stod(ip->second);
726 TLegend* leg_eta =
new TLegend(0.26, 0.73, 0.935, 0.90);
727 TLegend* leg_pt =
new TLegend(0.26, 0.73, 0.935, 0.90);
729 leg_eta->SetBorderSize(0);
730 leg_eta->SetLineStyle(0);
731 leg_eta->SetFillStyle(0);
733 leg_eta->SetTextFont(42);
734 leg_pt->SetBorderSize(0);
735 leg_pt->SetLineStyle(0);
736 leg_pt->SetFillStyle(0);
738 auto tag = PlotBase::getTag<0>();
739 auto iov =
tag.iovs.front();
741 unsigned int run = std::get<0>(iov);
743 std::stringstream ss_tagname(
tag.name);
750 getline(ss_tagname, stmp,
'_');
751 getline(ss_tagname, stmp,
'_');
753 getline(ss_tagname, stmp,
'_');
754 tag_ver +=
'_' + stmp;
755 getline(ss_tagname, stmp,
'_');
756 tag_ver +=
'_' + stmp;
757 getline(ss_tagname, stmp,
'_');
758 tag_ver +=
'_' + stmp;
759 getline(ss_tagname, stmp,
'_');
761 getline(ss_tagname, stmp,
'_');
764 bool is_2bin =
false;
767 if (!
payload->getRecords().empty() &&
768 payload->getDefinition().getFormulaString().compare(
"") != 0)
773 if (
record.getBinsRange().size() > 1)
776 if (!
record.getBinsRange().empty() &&
payload->getDefinition().getBinName(0) ==
"JetEta" &&
777 record.getParametersValues().size() == 3) {
779 for (
size_t it = 0; it <=
NBIN_ETA; it++) {
781 if (((is_2bin ==
false) || (is_2bin ==
true &&
record.getBinsRange()[1].is_inside(par_Pt))) &&
782 record.getBinsRange()[0].is_inside(x_axis)) {
783 sf_eta_norm->SetBinContent(it + 1,
record.getParametersValues()[0]);
784 sf_eta_down->SetBinContent(it + 1,
record.getParametersValues()[1]);
785 sf_eta_up->SetBinContent(it + 1,
record.getParametersValues()[2]);
790 if (
record.getBinsRange().size() > 1 &&
payload->getDefinition().getBinName(0) ==
"JetEta" &&
791 record.getBinsRange()[0].is_inside(par_Eta) &&
792 payload->getDefinition().getBinName(1) ==
"JetPt" &&
793 record.getParametersValues().size() == 3) {
797 for (
size_t it = 0; it <=
NBIN_PT; it++) {
799 if (
record.getBinsRange()[1].is_inside(x_axis)) {
800 sf_pt_norm->SetBinContent(it + 1,
record.getParametersValues()[0]);
801 sf_pt_down->SetBinContent(it + 1,
record.getParametersValues()[1]);
802 sf_pt_up->SetBinContent(it + 1,
record.getParametersValues()[2]);
808 gStyle->SetOptStat(0);
809 gStyle->SetLabelFont(42,
"XYZ");
810 gStyle->SetLabelSize(0.05,
"XYZ");
811 gStyle->SetFrameLineWidth(3);
814 TCanvas
canvas(
"Jet ScaleFactor Summary",
title.c_str(), 800, 1200);
818 sf_eta_up->SetTitle(
"ScaleFactor vs. #eta");
819 sf_eta_up->SetXTitle(
"#eta");
820 sf_eta_up->SetYTitle(
"Scale Factor");
821 sf_eta_up->SetLineStyle(7);
822 sf_eta_up->SetLineWidth(3);
823 sf_eta_up->SetFillColorAlpha(kGray, 0.5);
824 sf_eta_up->SetMaximum(sf_eta_up->GetMaximum() * 1.25);
825 sf_eta_up->SetMinimum(0.);
826 sf_eta_up->Draw(
"][");
828 sf_eta_down->SetLineStyle(7);
829 sf_eta_down->SetLineWidth(3);
830 sf_eta_down->SetFillColorAlpha(kWhite, 1);
831 sf_eta_down->Draw(
"][ same");
833 sf_eta_norm->SetLineStyle(1);
834 sf_eta_norm->SetLineWidth(5);
835 sf_eta_norm->SetFillColor(0);
836 sf_eta_norm->Draw(
"][ same");
837 sf_eta_norm->Draw(
"axis same");
839 leg_eta->AddEntry(sf_eta_norm, (tag_ver +
'_' + tag_jet).c_str(),
"l");
840 leg_eta->AddEntry((TObject*)
nullptr, Form(
"JetPt=%.2f", par_Pt),
"");
843 if (is_2bin ==
true) {
845 sf_pt_up->SetTitle(
"ScaleFactor vs. p_{T}");
846 sf_pt_up->SetXTitle(
"p_{T} [GeV]");
847 sf_pt_up->SetYTitle(
"Scale Factor");
848 sf_pt_up->SetLineStyle(7);
849 sf_pt_up->SetLineWidth(3);
850 sf_pt_up->SetFillColorAlpha(kGray, 0.5);
851 sf_pt_up->SetMaximum(sf_pt_up->GetMaximum() * 1.25);
852 sf_pt_up->SetMinimum(0.);
853 sf_pt_up->Draw(
"][");
855 sf_pt_down->SetLineStyle(7);
856 sf_pt_down->SetLineWidth(3);
857 sf_pt_down->SetFillColorAlpha(kWhite, 1);
858 sf_pt_down->Draw(
"][ same");
860 sf_pt_norm->SetLineStyle(1);
861 sf_pt_norm->SetLineWidth(5);
862 sf_pt_norm->SetFillColor(0);
863 sf_pt_norm->Draw(
"][ same");
864 sf_pt_norm->Draw(
"axis same");
866 leg_pt->AddEntry(sf_pt_norm, (tag_ver +
'_' + tag_jet).c_str(),
"l");
867 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)