diff --git a/benchmarks/dis/analysis/dis_electrons.cxx b/benchmarks/dis/analysis/dis_electrons.cxx index 91679ff1efd3ccced95ef45766445bffc26e95da..d1ddb07d614047158f01861a800c0463b450e1f0 100644 --- a/benchmarks/dis/analysis/dis_electrons.cxx +++ b/benchmarks/dis/analysis/dis_electrons.cxx @@ -114,6 +114,16 @@ int dis_electrons(const std::string& config_name) TFitResultPtr f_x_el_res = h_x_el_res->Fit("gaus", "S"); if (f_x_el_res == 0) f_x_el_res->Print("V"); + TFitResultPtr f_Q2_jb_res = h_Q2_jb_res->Fit("gaus", "S"); + if (f_Q2_jb_res == 0) f_Q2_jb_res->Print("V"); + TFitResultPtr f_x_jb_res = h_x_jb_res->Fit("gaus", "S"); + if (f_x_jb_res == 0) f_x_jb_res->Print("V"); + + TFitResultPtr f_Q2_da_res = h_Q2_da_res->Fit("gaus", "S"); + if (f_Q2_da_res == 0) f_Q2_da_res->Print("V"); + TFitResultPtr f_x_da_res = h_x_da_res->Fit("gaus", "S"); + if (f_x_da_res == 0) f_x_da_res->Print("V"); + // Plot our histograms. // TODO: to start I'm explicitly plotting the histograms, but want to // factorize out the plotting code moving forward. @@ -145,7 +155,7 @@ int dis_electrons(const std::string& config_name) h2.DrawClone("hist same"); h3.DrawClone("hist same"); h4.DrawClone("hist same"); - // FIXME hardcoded beam configuration + // legend common_bench::plot::draw_label(ebeam, pbeam, detector); TText* tptr1; TPaveText t1(.6, .8417, .9, .925, "NB NDC"); @@ -154,14 +164,14 @@ int dis_electrons(const std::string& config_name) t1.SetTextSize(25); tptr1 = t1.AddText("simulated"); tptr1->SetTextColor(common_bench::plot::kMpBlue); - tptr1 = t1.AddText("electron"); + tptr1 = t1.AddText("EL method"); tptr1->SetTextColor(common_bench::plot::kMpOrange); - tptr1 = t1.AddText("JB"); + tptr1 = t1.AddText("JB method"); tptr1->SetTextColor(common_bench::plot::kMpRed); - tptr1 = t1.AddText("DA"); + tptr1 = t1.AddText("DA method"); tptr1->SetTextColor(common_bench::plot::kMpGreen); t1.Draw(); - c.Print(fmt::format("{}Q2.png", output_prefix).c_str()); + c.Print(fmt::format("{}_Q2.png", output_prefix).c_str()); } // Q2 resolution @@ -174,11 +184,11 @@ int dis_electrons(const std::string& config_name) auto& h2 = *h_Q2_jb_res; auto& h3 = *h_Q2_da_res; // histogram style - h1.SetLineColor(common_bench::plot::kMpBlue); + h1.SetLineColor(common_bench::plot::kMpOrange); h1.SetLineWidth(2); - h2.SetLineColor(common_bench::plot::kMpOrange); + h2.SetLineColor(common_bench::plot::kMpRed); h2.SetLineWidth(2); - h3.SetLineColor(common_bench::plot::kMpRed); + h3.SetLineColor(common_bench::plot::kMpGreen); h3.SetLineWidth(2); // axes h1.GetXaxis()->CenterTitle(); @@ -187,9 +197,21 @@ int dis_electrons(const std::string& config_name) h1.DrawClone("hist"); h2.DrawClone("hist same"); h3.DrawClone("hist same"); - // FIXME hardcoded beam configuration + // legend common_bench::plot::draw_label(ebeam, pbeam, detector); - c.Print(fmt::format("{}Q2resolution.png", output_prefix).c_str()); + 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); + t1.Draw(); + c.Print(fmt::format("{}_Q2_resolution.png", output_prefix).c_str()); } // x comparison @@ -219,7 +241,7 @@ int dis_electrons(const std::string& config_name) h2.DrawClone("hist same"); h3.DrawClone("hist same"); h4.DrawClone("hist same"); - // FIXME hardcoded beam configuration + // legend common_bench::plot::draw_label(ebeam, pbeam, detector); TText* tptr1; TPaveText t1(.6, .8417, .9, .925, "NB NDC"); @@ -228,10 +250,14 @@ int dis_electrons(const std::string& config_name) t1.SetTextSize(25); tptr1 = t1.AddText("simulated"); tptr1->SetTextColor(common_bench::plot::kMpBlue); - tptr1 = t1.AddText("reconstructed"); + 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); t1.Draw(); - c.Print(fmt::format("{}x.png", output_prefix).c_str()); + c.Print(fmt::format("{}_x.png", output_prefix).c_str()); } // x resolution @@ -244,11 +270,11 @@ int dis_electrons(const std::string& config_name) auto& h2 = *h_x_jb_res; auto& h3 = *h_x_da_res; // histogram style - h1.SetLineColor(common_bench::plot::kMpBlue); + h1.SetLineColor(common_bench::plot::kMpOrange); h1.SetLineWidth(2); - h2.SetLineColor(common_bench::plot::kMpOrange); + h2.SetLineColor(common_bench::plot::kMpRed); h2.SetLineWidth(2); - h3.SetLineColor(common_bench::plot::kMpRed); + h3.SetLineColor(common_bench::plot::kMpGreen); h3.SetLineWidth(2); // axes h1.GetXaxis()->CenterTitle(); @@ -257,9 +283,21 @@ int dis_electrons(const std::string& config_name) h1.DrawClone("hist"); h2.DrawClone("hist same"); h3.DrawClone("hist same"); - // FIXME hardcoded beam configuration + // legend common_bench::plot::draw_label(ebeam, pbeam, detector); - c.Print(fmt::format("{}xresolution.png", output_prefix).c_str()); + 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); + t1.Draw(); + c.Print(fmt::format("{}_x_resolution.png", output_prefix).c_str()); } common_bench::write_test({dis_Q2_resolution}, fmt::format("{}dis_electrons.json", output_prefix));