796 double par_Pt = 100.;
800 auto ip = paramValues.find(
"Jet_Pt");
801 if (ip != paramValues.end()) {
802 par_Pt = std::stod(ip->second);
804 ip = paramValues.find(
"Jet_Eta");
805 if (ip != paramValues.end()) {
806 par_Eta = std::stod(ip->second);
814 TLegend* leg_eta =
new TLegend(0.26, 0.73, 0.935, 0.90);
815 TLegend* leg_pt =
new TLegend(0.26, 0.73, 0.935, 0.90);
817 leg_eta->SetBorderSize(0);
818 leg_eta->SetLineStyle(0);
819 leg_eta->SetFillStyle(0);
821 leg_eta->SetTextFont(42);
822 leg_pt->SetBorderSize(0);
823 leg_pt->SetLineStyle(0);
824 leg_pt->SetFillStyle(0);
826 auto tag1 = PlotBase::getTag<0>();
827 auto iov1 = tag1.iovs.front();
828 std::shared_ptr<JetResolutionObject> payload1 =
fetchPayload(std::get<1>(iov1));
830 auto tag2 = PlotBase::getTag<1>();
831 auto iov2 = tag2.iovs.front();
832 std::shared_ptr<JetResolutionObject> payload2 =
fetchPayload(std::get<1>(iov2));
834 std::stringstream ss_tagname1(tag1.name);
835 std::stringstream ss_tagname2(tag2.name);
841 getline(ss_tagname1, stmp,
'_');
842 getline(ss_tagname1, stmp);
845 getline(ss_tagname2, stmp,
'_');
846 getline(ss_tagname2, stmp);
849 bool is_2bin =
false;
851 if (payload1.get() && payload2.get()) {
852 if (!payload1->getRecords().empty() &&
853 payload1->getDefinition().getFormulaString().compare(
"") != 0)
860 JetParameters j_param;
861 j_param.setJetPt(par_Pt);
862 j_param.setJetEta(x_axis);
866 if (rcd_p1 ==
nullptr || rcd_p2 ==
nullptr) {
873 if (record1.getBinsRange().size() > 1 && record2.getBinsRange().size() > 1)
876 if (record1.getParametersValues().size() == 3) {
877 sf_eta_one->SetBinContent(
idx + 1, record1.getParametersValues()[0]);
879 if (record2.getParametersValues().size() == 3) {
880 sf_eta_two->SetBinContent(
idx + 1, record2.getParametersValues()[0]);
887 JetParameters j_param;
888 j_param.setJetEta(par_Eta);
889 j_param.setJetPt(x_axis);
893 if (rcd_p1 ==
nullptr || rcd_p2 ==
nullptr) {
900 if (record1.getParametersValues().size() == 3) {
901 sf_pt_one->SetBinContent(
idx + 1, record1.getParametersValues()[0]);
903 if (record2.getParametersValues().size() == 3) {
904 sf_pt_two->SetBinContent(
idx + 1, record2.getParametersValues()[0]);
908 gStyle->SetOptStat(0);
909 gStyle->SetLabelFont(42,
"XYZ");
910 gStyle->SetLabelSize(0.05,
"XYZ");
911 gStyle->SetFrameLineWidth(3);
914 TCanvas
canvas(
"Jet ScaleFactor",
title.c_str(), 800, 1200);
918 sf_eta_one->SetTitle(
"Jet ScaleFactor Comparison vs. #eta");
919 sf_eta_one->SetXTitle(
"#eta");
920 sf_eta_one->SetYTitle(
"Scale Factor");
921 sf_eta_one->SetLineWidth(3);
922 sf_eta_one->SetMaximum(sf_eta_one->GetMaximum() * 1.25);
923 sf_eta_one->SetMinimum(0.);
924 sf_eta_one->Draw(
"][");
926 sf_eta_two->SetLineColor(2);
927 sf_eta_two->SetLineWidth(3);
928 sf_eta_two->SetLineStyle(2);
929 sf_eta_two->Draw(
"][ same");
931 leg_eta->AddEntry(sf_eta_one, tag_ver1.c_str(),
"l");
932 leg_eta->AddEntry(sf_eta_two, tag_ver2.c_str(),
"l");
933 leg_eta->AddEntry((TObject*)
nullptr, Form(
"JetPt=%.2f", par_Pt),
"");
936 if (is_2bin ==
true) {
938 sf_pt_one->SetTitle(
"Jet ScaleFactor Comparison vs. p_{T}");
939 sf_pt_one->SetXTitle(
"p_{T} [GeV]");
940 sf_pt_one->SetYTitle(
"Scale Factor");
941 sf_pt_one->SetLineWidth(3);
942 sf_pt_one->SetMaximum(sf_pt_one->GetMaximum() * 1.25);
943 sf_pt_one->SetMinimum(0.);
944 sf_pt_one->Draw(
"][");
946 sf_pt_two->SetLineColor(2);
947 sf_pt_two->SetLineWidth(3);
948 sf_pt_two->SetLineStyle(2);
949 sf_pt_two->Draw(
"][ same");
951 leg_pt->AddEntry(sf_pt_one, tag_ver1.c_str(),
"l");
952 leg_pt->AddEntry(sf_pt_two, tag_ver2.c_str(),
"l");
953 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)