Skip to content
Snippets Groups Projects

feat: create more stable and interpretable DIS benchmark output

Merged Wouter Deconinck requested to merge dis-fits-and-plots into master
@@ -82,6 +82,12 @@ int dis_electrons(const std::string& config_name)
@@ -82,6 +82,12 @@ int dis_electrons(const std::string& config_name)
.Define("Q2_da", "InclusiveKinematicsDA.Q2")
.Define("Q2_da", "InclusiveKinematicsDA.Q2")
.Define("Q2_sigma", "InclusiveKinematicsSigma.Q2")
.Define("Q2_sigma", "InclusiveKinematicsSigma.Q2")
.Define("Q2_esigma", "InclusiveKinematicseSigma.Q2")
.Define("Q2_esigma", "InclusiveKinematicseSigma.Q2")
 
.Define("Q2_sim", "log(Q2_sim)")
 
.Define("Q2_el", "log(Q2_el)")
 
.Define("Q2_jb", "log(Q2_jb)")
 
.Define("Q2_da", "log(Q2_da)")
 
.Define("Q2_sigma", "log(Q2_sigma)")
 
.Define("Q2_esigma", "log(Q2_esigma)")
.Define("Q2_el_res", combinatorial_diff_ratio, {"Q2_sim", "Q2_el"})
.Define("Q2_el_res", combinatorial_diff_ratio, {"Q2_sim", "Q2_el"})
.Define("Q2_jb_res", combinatorial_diff_ratio, {"Q2_sim", "Q2_jb"})
.Define("Q2_jb_res", combinatorial_diff_ratio, {"Q2_sim", "Q2_jb"})
.Define("Q2_da_res", combinatorial_diff_ratio, {"Q2_sim", "Q2_da"})
.Define("Q2_da_res", combinatorial_diff_ratio, {"Q2_sim", "Q2_da"})
@@ -107,6 +113,12 @@ int dis_electrons(const std::string& config_name)
@@ -107,6 +113,12 @@ int dis_electrons(const std::string& config_name)
auto h_Q2_da = d0.Histo1D({"h_Q2_da", "; GeV^2; counts", 100, -5, 25}, "Q2_da");
auto h_Q2_da = d0.Histo1D({"h_Q2_da", "; GeV^2; counts", 100, -5, 25}, "Q2_da");
auto h_Q2_sigma = d0.Histo1D({"h_Q2_sigma", "; GeV^2; counts", 100, -5, 25}, "Q2_sigma");
auto h_Q2_sigma = d0.Histo1D({"h_Q2_sigma", "; GeV^2; counts", 100, -5, 25}, "Q2_sigma");
auto h_Q2_esigma = d0.Histo1D({"h_Q2_esigma", "; GeV^2; counts", 100, -5, 25}, "Q2_esigma");
auto h_Q2_esigma = d0.Histo1D({"h_Q2_esigma", "; GeV^2; counts", 100, -5, 25}, "Q2_esigma");
 
auto h_logQ2_sim = d0.Histo1D({"h_logQ2_sim", "; GeV^2; counts", 100, -1, 4}, "logQ2_sim");
 
auto h_logQ2_el = d0.Histo1D({"h_logQ2_el", "; GeV^2; counts", 100, -1, 4}, "logQ2_el");
 
auto h_logQ2_jb = d0.Histo1D({"h_logQ2_jb", "; GeV^2; counts", 100, -1, 4}, "logQ2_jb");
 
auto h_logQ2_da = d0.Histo1D({"h_logQ2_da", "; GeV^2; counts", 100, -1, 4}, "logQ2_da");
 
auto h_logQ2_sigma = d0.Histo1D({"h_logQ2_sigma", "; GeV^2; counts", 100, -1, 4}, "logQ2_sigma");
 
auto h_logQ2_esigma = d0.Histo1D({"h_logQ2_esigma", "; GeV^2; counts", 100, -1, 4}, "logQ2_esigma");
auto h_Q2_el_res = d0.Histo1D({"h_Q2_el_res", "; ; counts", 100, -1, 1}, "Q2_el_res");
auto h_Q2_el_res = d0.Histo1D({"h_Q2_el_res", "; ; counts", 100, -1, 1}, "Q2_el_res");
auto h_Q2_jb_res = d0.Histo1D({"h_Q2_jb_res", "; ; counts", 100, -1, 1}, "Q2_jb_res");
auto h_Q2_jb_res = d0.Histo1D({"h_Q2_jb_res", "; ; counts", 100, -1, 1}, "Q2_jb_res");
auto h_Q2_da_res = d0.Histo1D({"h_Q2_da_res", "; ; counts", 100, -1, 1}, "Q2_da_res");
auto h_Q2_da_res = d0.Histo1D({"h_Q2_da_res", "; ; counts", 100, -1, 1}, "Q2_da_res");
@@ -230,18 +242,83 @@ int dis_electrons(const std::string& config_name)
@@ -230,18 +242,83 @@ int dis_electrons(const std::string& config_name)
// TODO: to start I'm explicitly plotting the histograms, but want to
// TODO: to start I'm explicitly plotting the histograms, but want to
// factorize out the plotting code moving forward.
// factorize out the plotting code moving forward.
// Q2 comparison
// Q2 comparison (panels)
 
{
 
TCanvas c("c", "c", 1800, 1200);
 
c.Divide(3,2);
 
c.cd();
 
gPad->SetLogx(false);
 
gPad->SetLogy(true);
 
auto& h1 = *h_logQ2_sim;
 
auto& h2 = *h_logQ2_el;
 
auto& h3 = *h_logQ2_jb;
 
auto& h4 = *h_logQ2_da;
 
auto& h5 = *h_logQ2_sigma;
 
auto& h6 = *h_logQ2_esigma;
 
// histogram style
 
h1.SetLineColor(common_bench::plot::kMpBlue);
 
h1.SetLineWidth(2);
 
h2.SetLineColor(common_bench::plot::kMpOrange);
 
h2.SetLineWidth(2);
 
h3.SetLineColor(common_bench::plot::kMpRed);
 
h3.SetLineWidth(2);
 
h4.SetLineColor(common_bench::plot::kMpGreen);
 
h4.SetLineWidth(2);
 
h5.SetLineColor(common_bench::plot::kMpMoss);
 
h5.SetLineWidth(2);
 
h6.SetLineColor(common_bench::plot::kMpCyan);
 
h6.SetLineWidth(2);
 
// axes
 
h1.GetXaxis()->CenterTitle();
 
h1.GetYaxis()->CenterTitle();
 
// draw everything
 
c.cd(1);
 
h1.DrawClone("hist");
 
c.cd(2);
 
h2.DrawClone("hist");
 
c.cd(3);
 
h3.DrawClone("hist");
 
c.cd(4);
 
h4.DrawClone("hist");
 
c.cd(5);
 
h5.DrawClone("hist");
 
c.cd(6);
 
h6.DrawClone("hist");
 
// legend
 
common_bench::plot::draw_label(ebeam, pbeam, detector);
 
TText* tptr1;
 
TPaveText t1(.6, .8417, .9, .925, "NB NDC");
 
t1.SetFillColorAlpha(kWhite, 0);
 
t1.SetTextFont(43);
 
t1.SetTextSize(25);
 
tptr1 = t1.AddText("simulated");
 
tptr1->SetTextColor(common_bench::plot::kMpBlue);
 
tptr1 = t1.AddText("e method");
 
tptr1->SetTextColor(common_bench::plot::kMpOrange);
 
tptr1 = t1.AddText("JB method");
 
tptr1->SetTextColor(common_bench::plot::kMpRed);
 
tptr1 = t1.AddText("DA method");
 
tptr1->SetTextColor(common_bench::plot::kMpGreen);
 
tptr1 = t1.AddText("#Sigma method");
 
tptr1->SetTextColor(common_bench::plot::kMpMoss);
 
tptr1 = t1.AddText("e#Sigma method");
 
tptr1->SetTextColor(common_bench::plot::kMpCyan);
 
t1.Draw();
 
c.Print(fmt::format("{}_logQ2_panels.png", output_prefix).c_str());
 
}
 
 
// Q2 comparison (overlays)
{
{
TCanvas c("c", "c", 1200, 1200);
TCanvas c("c", "c", 1200, 1200);
c.cd();
c.cd();
gPad->SetLogx(false);
gPad->SetLogx(false);
gPad->SetLogy(true);
gPad->SetLogy(true);
auto& h1 = *h_Q2_sim;
auto& h1 = *h_logQ2_sim;
auto& h2 = *h_Q2_el;
auto& h2 = *h_logQ2_el;
auto& h3 = *h_Q2_jb;
auto& h3 = *h_logQ2_jb;
auto& h4 = *h_Q2_da;
auto& h4 = *h_logQ2_da;
auto& h5 = *h_Q2_sigma;
auto& h5 = *h_logQ2_sigma;
auto& h6 = *h_Q2_esigma;
auto& h6 = *h_logQ2_esigma;
// histogram style
// histogram style
h1.SetLineColor(common_bench::plot::kMpBlue);
h1.SetLineColor(common_bench::plot::kMpBlue);
h1.SetLineWidth(2);
h1.SetLineWidth(2);
@@ -285,10 +362,69 @@ int dis_electrons(const std::string& config_name)
@@ -285,10 +362,69 @@ int dis_electrons(const std::string& config_name)
tptr1 = t1.AddText("e#Sigma method");
tptr1 = t1.AddText("e#Sigma method");
tptr1->SetTextColor(common_bench::plot::kMpCyan);
tptr1->SetTextColor(common_bench::plot::kMpCyan);
t1.Draw();
t1.Draw();
c.Print(fmt::format("{}_Q2.png", output_prefix).c_str());
c.Print(fmt::format("{}_logQ2_overlays.png", output_prefix).c_str());
}
}
// Q2 resolution
// Q2 resolution (panels)
 
{
 
TCanvas c("c", "c", 1800, 1200);
 
c.Divide(3,2);
 
c.cd();
 
gPad->SetLogx(false);
 
gPad->SetLogy(true);
 
auto& h1 = *h_Q2_el_res;
 
auto& h2 = *h_Q2_jb_res;
 
auto& h3 = *h_Q2_da_res;
 
auto& h4 = *h_Q2_sigma_res;
 
auto& h5 = *h_Q2_esigma_res;
 
// histogram style
 
h1.SetLineColor(common_bench::plot::kMpOrange);
 
h1.SetLineWidth(2);
 
h2.SetLineColor(common_bench::plot::kMpRed);
 
h2.SetLineWidth(2);
 
h3.SetLineColor(common_bench::plot::kMpGreen);
 
h3.SetLineWidth(2);
 
h4.SetLineColor(common_bench::plot::kMpMoss);
 
h4.SetLineWidth(2);
 
h5.SetLineColor(common_bench::plot::kMpCyan);
 
h5.SetLineWidth(2);
 
// axes
 
h1.GetXaxis()->CenterTitle();
 
h1.GetYaxis()->CenterTitle();
 
// draw everything
 
c.cd(1);
 
h1.DrawClone("hist");
 
c.cd(2);
 
h2.DrawClone("hist");
 
c.cd(3);
 
h3.DrawClone("hist");
 
c.cd(4);
 
h4.DrawClone("hist");
 
c.cd(5);
 
h5.DrawClone("hist");
 
// legend
 
common_bench::plot::draw_label(ebeam, pbeam, detector);
 
TText* tptr1;
 
TPaveText t1(.6, .8417, .9, .925, "NB NDC");
 
t1.SetFillColorAlpha(kWhite, 0);
 
t1.SetTextFont(43);
 
t1.SetTextSize(25);
 
tptr1 = t1.AddText("EL method");
 
tptr1->SetTextColor(common_bench::plot::kMpOrange);
 
tptr1 = t1.AddText("JB method");
 
tptr1->SetTextColor(common_bench::plot::kMpRed);
 
tptr1 = t1.AddText("DA method");
 
tptr1->SetTextColor(common_bench::plot::kMpGreen);
 
tptr1 = t1.AddText("#Sigma method");
 
tptr1->SetTextColor(common_bench::plot::kMpMoss);
 
tptr1 = t1.AddText("e#Sigma method");
 
tptr1->SetTextColor(common_bench::plot::kMpCyan);
 
t1.Draw();
 
c.Print(fmt::format("{}_Q2_res_panels.png", output_prefix).c_str());
 
}
 
 
 
// Q2 resolution (overlays)
{
{
TCanvas c("c", "c", 1200, 1200);
TCanvas c("c", "c", 1200, 1200);
c.cd();
c.cd();
@@ -337,10 +473,75 @@ int dis_electrons(const std::string& config_name)
@@ -337,10 +473,75 @@ int dis_electrons(const std::string& config_name)
tptr1 = t1.AddText("e#Sigma method");
tptr1 = t1.AddText("e#Sigma method");
tptr1->SetTextColor(common_bench::plot::kMpCyan);
tptr1->SetTextColor(common_bench::plot::kMpCyan);
t1.Draw();
t1.Draw();
c.Print(fmt::format("{}_Q2_resolution.png", output_prefix).c_str());
c.Print(fmt::format("{}_Q2_res_overlays.png", output_prefix).c_str());
}
}
// x comparison
// x comparison (panels)
 
{
 
TCanvas c("c", "c", 1800, 1200);
 
c.Divide(3,2);
 
c.cd();
 
gPad->SetLogx(true);
 
gPad->SetLogy(true);
 
auto& h1 = *h_x_sim;
 
auto& h2 = *h_x_el;
 
auto& h3 = *h_x_jb;
 
auto& h4 = *h_x_da;
 
auto& h5 = *h_x_sigma;
 
auto& h6 = *h_x_esigma;
 
// histogram style
 
h1.SetLineColor(common_bench::plot::kMpBlue);
 
h1.SetLineWidth(2);
 
h2.SetLineColor(common_bench::plot::kMpOrange);
 
h2.SetLineWidth(2);
 
h3.SetLineColor(common_bench::plot::kMpRed);
 
h3.SetLineWidth(2);
 
h4.SetLineColor(common_bench::plot::kMpGreen);
 
h4.SetLineWidth(2);
 
h5.SetLineColor(common_bench::plot::kMpMoss);
 
h5.SetLineWidth(2);
 
h6.SetLineColor(common_bench::plot::kMpCyan);
 
h6.SetLineWidth(2);
 
// axes
 
h1.GetXaxis()->CenterTitle();
 
h1.GetYaxis()->CenterTitle();
 
// draw everything
 
c.cd(1);
 
h1.DrawClone("hist");
 
c.cd(2);
 
h2.DrawClone("hist");
 
c.cd(3);
 
h3.DrawClone("hist");
 
c.cd(4);
 
h4.DrawClone("hist");
 
c.cd(5);
 
h5.DrawClone("hist");
 
c.cd(6);
 
h6.DrawClone("hist");
 
// legend
 
common_bench::plot::draw_label(ebeam, pbeam, detector);
 
TText* tptr1;
 
TPaveText t1(.6, .8417, .9, .925, "NB NDC");
 
t1.SetFillColorAlpha(kWhite, 0);
 
t1.SetTextFont(43);
 
t1.SetTextSize(25);
 
tptr1 = t1.AddText("simulated");
 
tptr1->SetTextColor(common_bench::plot::kMpBlue);
 
tptr1 = t1.AddText("EL method");
 
tptr1->SetTextColor(common_bench::plot::kMpOrange);
 
tptr1 = t1.AddText("JB method");
 
tptr1->SetTextColor(common_bench::plot::kMpRed);
 
tptr1 = t1.AddText("DA method");
 
tptr1->SetTextColor(common_bench::plot::kMpGreen);
 
tptr1 = t1.AddText("#Sigma method");
 
tptr1->SetTextColor(common_bench::plot::kMpMoss);
 
tptr1 = t1.AddText("e#Sigma method");
 
tptr1->SetTextColor(common_bench::plot::kMpCyan);
 
t1.Draw();
 
c.Print(fmt::format("{}_x_panels.png", output_prefix).c_str());
 
}
 
 
// x comparison (overlays)
{
{
TCanvas c("c", "c", 1200, 1200);
TCanvas c("c", "c", 1200, 1200);
c.cd();
c.cd();
@@ -395,10 +596,68 @@ int dis_electrons(const std::string& config_name)
@@ -395,10 +596,68 @@ int dis_electrons(const std::string& config_name)
tptr1 = t1.AddText("e#Sigma method");
tptr1 = t1.AddText("e#Sigma method");
tptr1->SetTextColor(common_bench::plot::kMpCyan);
tptr1->SetTextColor(common_bench::plot::kMpCyan);
t1.Draw();
t1.Draw();
c.Print(fmt::format("{}_x.png", output_prefix).c_str());
c.Print(fmt::format("{}_x_overlays.png", output_prefix).c_str());
 
}
 
 
// x resolution (panels)
 
{
 
TCanvas c("c", "c", 1800, 1200);
 
c.Divide(3,2);
 
c.cd();
 
gPad->SetLogx(false);
 
gPad->SetLogy(true);
 
auto& h1 = *h_x_el_res;
 
auto& h2 = *h_x_jb_res;
 
auto& h3 = *h_x_da_res;
 
auto& h4 = *h_x_sigma_res;
 
auto& h5 = *h_x_esigma_res;
 
// histogram style
 
h1.SetLineColor(common_bench::plot::kMpOrange);
 
h1.SetLineWidth(2);
 
h2.SetLineColor(common_bench::plot::kMpRed);
 
h2.SetLineWidth(2);
 
h3.SetLineColor(common_bench::plot::kMpGreen);
 
h3.SetLineWidth(2);
 
h4.SetLineColor(common_bench::plot::kMpMoss);
 
h4.SetLineWidth(2);
 
h5.SetLineColor(common_bench::plot::kMpCyan);
 
h5.SetLineWidth(2);
 
// axes
 
h1.GetXaxis()->CenterTitle();
 
h1.GetYaxis()->CenterTitle();
 
// draw everything
 
c.cd(1);
 
h1.DrawClone("hist");
 
c.cd(2);
 
h2.DrawClone("hist");
 
c.cd(3);
 
h3.DrawClone("hist");
 
c.cd(4);
 
h4.DrawClone("hist");
 
c.cd(5);
 
h5.DrawClone("hist");
 
// legend
 
common_bench::plot::draw_label(ebeam, pbeam, detector);
 
TText* tptr1;
 
TPaveText t1(.6, .8417, .9, .925, "NB NDC");
 
t1.SetFillColorAlpha(kWhite, 0);
 
t1.SetTextFont(43);
 
t1.SetTextSize(25);
 
tptr1 = t1.AddText("EL method");
 
tptr1->SetTextColor(common_bench::plot::kMpOrange);
 
tptr1 = t1.AddText("JB method");
 
tptr1->SetTextColor(common_bench::plot::kMpRed);
 
tptr1 = t1.AddText("DA method");
 
tptr1->SetTextColor(common_bench::plot::kMpGreen);
 
tptr1 = t1.AddText("#Sigma method");
 
tptr1->SetTextColor(common_bench::plot::kMpMoss);
 
tptr1 = t1.AddText("e#Sigma method");
 
tptr1->SetTextColor(common_bench::plot::kMpCyan);
 
t1.Draw();
 
c.Print(fmt::format("{}_x_res_panels.png", output_prefix).c_str());
}
}
// x resolution
// x resolution (overlays)
{
{
TCanvas c("c", "c", 1200, 1200);
TCanvas c("c", "c", 1200, 1200);
c.cd();
c.cd();
@@ -447,7 +706,7 @@ int dis_electrons(const std::string& config_name)
@@ -447,7 +706,7 @@ int dis_electrons(const std::string& config_name)
tptr1 = t1.AddText("e#Sigma method");
tptr1 = t1.AddText("e#Sigma method");
tptr1->SetTextColor(common_bench::plot::kMpCyan);
tptr1->SetTextColor(common_bench::plot::kMpCyan);
t1.Draw();
t1.Draw();
c.Print(fmt::format("{}_x_resolution.png", output_prefix).c_str());
c.Print(fmt::format("{}_x_res_overlays.png", output_prefix).c_str());
}
}
common_bench::write_test({dis_Q2_resolution}, fmt::format("{}dis_electrons.json", output_prefix));
common_bench::write_test({dis_Q2_resolution}, fmt::format("{}dis_electrons.json", output_prefix));
Loading