From c33b1cf00bb2925743434220ac6dd9f2157d326b Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Wed, 27 Nov 2024 05:07:30 +0100 Subject: [PATCH] Adding resolutions of DCAT and DCAz to the benchmark (#106) Co-authored-by: Shyam Co-authored-by: Dmitry Kalinkin --- benchmarks/tracking_performances/Snakefile | 24 +++++++++++++++++-- .../doCompare_truth_real_widebins_dcaT.C | 24 +++++-------------- .../doCompare_truth_real_widebins_dcaz.C | 23 +++++------------- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/benchmarks/tracking_performances/Snakefile b/benchmarks/tracking_performances/Snakefile index a197d8a7..1dfcc028 100644 --- a/benchmarks/tracking_performances/Snakefile +++ b/benchmarks/tracking_performances/Snakefile @@ -94,15 +94,31 @@ rule tracking_performance_summary_at_eta: ], MOMENTUM=[0.5, 1.0, 2.0, 5.0, 10.0, 20.0], ), - script="benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C", + script_mom="benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C", + script_dcaT="benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaT.C", + script_dcaz="benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaz.C", output: expand( "{{CAMPAIGN}}/Debug_Plots/{SEEDING}/pi-/mom/{SEEDING}_mom_resol_mom{MOMENTUM:.1f}_{{ETA_MIN}}_eta_{{ETA_MAX}}.png", SEEDING=["real", "truth"], MOMENTUM=[0.5, 1.0, 2.0, 5.0, 10.0, 20.0], ), + expand( + "{{CAMPAIGN}}/Debug_Plots/{SEEDING}/pi-/dca/{SEEDING}_dcaxy_resol_mom{MOMENTUM:.1f}_{{ETA_MIN}}_eta_{{ETA_MAX}}.png", + SEEDING=["real", "truth"], + MOMENTUM=[0.2, 0.3, 0.5,1.0, 1.5, 2.0, 5.0, 8.0, 10., 15.0], + ), + expand( + "{{CAMPAIGN}}/Debug_Plots/{SEEDING}/pi-/dca/{SEEDING}_dcaz_resol_mom{MOMENTUM:.1f}_{{ETA_MIN}}_eta_{{ETA_MAX}}.png", + SEEDING=["real", "truth"], + MOMENTUM=[0.2, 0.3, 0.5,1.0, 1.5, 2.0, 5.0, 8.0, 10., 15.0], + ), "{CAMPAIGN}/Final_Results/pi-/mom/mom_resol_{ETA_MIN}_eta_{ETA_MAX}.png", "{CAMPAIGN}/Final_Results/pi-/mom/mom_resol_{ETA_MIN}_eta_{ETA_MAX}.root", + "{CAMPAIGN}/Final_Results/pi-/dca/dcaxy_resol_{ETA_MIN}_eta_{ETA_MAX}.png", + "{CAMPAIGN}/Final_Results/pi-/dca/dcaxy_resol_{ETA_MIN}_eta_{ETA_MAX}.root", + "{CAMPAIGN}/Final_Results/pi-/dca/dcaz_resol_{ETA_MIN}_eta_{ETA_MAX}.png", + "{CAMPAIGN}/Final_Results/pi-/dca/dcaz_resol_{ETA_MIN}_eta_{ETA_MAX}.root", shell: """ if [[ "{wildcards.CAMPAIGN}" == "local" ]]; then @@ -119,8 +135,12 @@ if [[ "{wildcards.CAMPAIGN}" == "local" ]]; then else EXTRA_LEGEND="ePIC Simulation {wildcards.CAMPAIGN}" fi +hadd -f {wildcards.CAMPAIGN}/truthseed/pi-/dca/final_hist_dca_truthseed.root {wildcards.CAMPAIGN}/truthseed/pi-/dca/Performances_dca* +hadd -f {wildcards.CAMPAIGN}/realseed/pi-/dca/final_hist_dca_realseed.root {wildcards.CAMPAIGN}/realseed/pi-/dca/Performances_dca* cd {wildcards.CAMPAIGN} -root -l -b -q ../{input.script}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")' +root -l -b -q ../{input.script_mom}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, 1., true, "'"$EXTRA_LEGEND"'")' +root -l -b -q ../{input.script_dcaT}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, true, "'"$EXTRA_LEGEND"'")' +root -l -b -q ../{input.script_dcaz}'("pi-", {wildcards.ETA_MIN}, {wildcards.ETA_MAX}, true, "'"$EXTRA_LEGEND"'")' """ diff --git a/benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaT.C b/benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaT.C index 926a02ae..5f83dc40 100755 --- a/benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaT.C +++ b/benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaT.C @@ -9,7 +9,7 @@ #include "TMath.h" void draw_req_DCA(double etamin, double etamax, double xmin=0., double xmax=0.); -void doCompare_truth_real_widebins_dcaT(TString particle = "pi-",double etamin=-1.0, double etamax=1.0, Bool_t drawreq=1, TString epic ="24.06.0", TString eicrecon = "v1.14.0") // name = p, pt for getting p or pt dependence fitted results +void doCompare_truth_real_widebins_dcaT(TString particle = "pi-",double etamin=-1.0, double etamax=1.0, Bool_t drawreq=1, TString extra_legend = "") // name = p, pt for getting p or pt dependence fitted results { //=== style of the plot========= @@ -33,10 +33,7 @@ void doCompare_truth_real_widebins_dcaT(TString particle = "pi-",double etamin=- TString symbolname = ""; if (particle == "pi-") symbolname = "#pi^{-}"; else symbolname = particle; - // Write the parameters in text file (for comparison) - ofstream outfile; - outfile.open ("DCAT_resol.txt",ios_base::app); - + TF1 *f1=new TF1("f1","FitPointingAngle",0.,30.0,2); f1->SetParLimits(0,0.,50000); @@ -57,7 +54,8 @@ void doCompare_truth_real_widebins_dcaT(TString particle = "pi-",double etamin=- lDCAT = new TLegend(0.65,0.80,0.90,0.93); lDCAT->SetTextSize(0.03); lDCAT->SetBorderSize(0); - lDCAT->SetHeader(Form("%s ePIC(%s/%s): %1.1f < #eta < %1.1f",symbolname.Data(),epic.Data(),eicrecon.Data(),etamin,etamax),"C"); + lDCAT->SetHeader(extra_legend.Data(), "C"); + lDCAT->AddEntry((TObject*)0, Form("%s, %1.1f < #eta < %1.1f", symbolname.Data(), etamin, etamax), "C"); fDCA_truth = TFile::Open(Form("./truthseed/%s/dca/final_hist_dca_truthseed.root",particle.Data())); fDCA_real = TFile::Open(Form("./realseed/%s/dca/final_hist_dca_realseed.root",particle.Data())); @@ -88,7 +86,7 @@ void doCompare_truth_real_widebins_dcaT(TString particle = "pi-",double etamin=- histd0xy_truth_1d->SetTitle(Form("d0_{xy} (truth): %1.1f <#eta< %1.1f && %1.2f SetName(Form("eta_%1.1f_%1.1f_d0xy_truth_pt_%1.1f",etamin,etamax,pt[iptbin])); - if (histd0xy_truth_1d->GetEntries()<100) continue; + // if (histd0xy_truth_1d->GetEntries()<100) continue; double mu_truth = histd0xy_truth_1d->GetMean(); double sigma_truth = histd0xy_truth_1d->GetStdDev(); func_truth->SetRange(mu_truth-2.0*sigma_truth,mu_truth+2.0*sigma_truth); // fit with in 2 sigma range @@ -107,7 +105,7 @@ void doCompare_truth_real_widebins_dcaT(TString particle = "pi-",double etamin=- histd0xy_real_1d->SetTitle(Form("d0_{xy} (real): %1.1f <#eta< %1.1f && %1.2f SetName(Form("eta_%1.1f_%1.1f_d0xy_real_pt_%1.1f",etamin,etamax,pt[iptbin])); - if (histd0xy_real_1d->GetEntries()<100) continue; + // if (histd0xy_real_1d->GetEntries()<100) continue; double mu_real = histd0xy_real_1d->GetMean(); double sigma_real = histd0xy_real_1d->GetStdDev(); func_real->SetRange(mu_real-2.0*sigma_real,mu_real+2.0*sigma_real); // fit with in 2 sigma range @@ -183,16 +181,6 @@ void doCompare_truth_real_widebins_dcaT(TString particle = "pi-",double etamin=- draw_req_DCA(etamin,etamax,0.,mgDCAT->GetXaxis()->GetXmax()); c_dcaxy->SaveAs(Form("Final_Results/%s/dca/dcaxy_resol_%1.1f_eta_%1.1f.png",particle.Data(),etamin,etamax)); - // Write the numbers in output file for comparisons - outfile<<"ePIC"<GetN(); ++i){ - double x,ytrue, yreal; - gr2->GetPoint(i,x,yreal); - outfile<cd(); mgDCAT->SetName(Form("dcaxy_resol_%1.1f_eta_%1.1f",etamin,etamax)); mgDCAT->Write(); diff --git a/benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaz.C b/benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaz.C index e8fff38c..df02e3bd 100755 --- a/benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaz.C +++ b/benchmarks/tracking_performances/doCompare_truth_real_widebins_dcaz.C @@ -10,7 +10,7 @@ #define mpi 0.139 // 1.864 GeV/c^2 void draw_req_DCA(double etamin, double etamax, double xmin=0., double xmax=0.); -void doCompare_truth_real_widebins_dcaz(TString particle = "pi-",double etamin=-1.0, double etamax=1.0, Bool_t drawreq=1, TString epic ="", TString eicrecon = "") // name = p, pt for getting p or pt dependence fitted results +void doCompare_truth_real_widebins_dcaz(TString particle = "pi-",double etamin=-1.0, double etamax=1.0, Bool_t drawreq=1, TString extra_legend = "") // name = p, pt for getting p or pt dependence fitted results { //=== style of the plot========= @@ -33,9 +33,6 @@ void doCompare_truth_real_widebins_dcaz(TString particle = "pi-",double etamin=- TString symbolname = ""; if (particle == "pi-") symbolname = "#pi^{-}"; else symbolname = particle; - // Write the parameters in text file (for comparison) - ofstream outfile; - outfile.open ("DCAZ_resol.txt",ios_base::app); TF1 *f1=new TF1("f1","FitPointingAngle",0.,30.0,2); f1->SetParLimits(0,0.,50000); @@ -55,7 +52,8 @@ void doCompare_truth_real_widebins_dcaz(TString particle = "pi-",double etamin=- lDCAZ = new TLegend(0.70,0.80,0.90,0.93); lDCAZ->SetTextSize(0.03); lDCAZ->SetBorderSize(0); - lDCAZ->SetHeader(Form("%s ePIC(%s/%s): %1.1f < #eta < %1.1f",symbolname.Data(),epic.Data(),eicrecon.Data(),etamin,etamax),"C"); + lDCAZ->SetHeader(extra_legend.Data(), "C"); + lDCAZ->AddEntry((TObject*)0, Form("%s, %1.1f < #eta < %1.1f", symbolname.Data(), etamin, etamax), "C"); fDCA_truth = TFile::Open(Form("./truthseed/%s/dca/final_hist_dca_truthseed.root",particle.Data())); fDCA_real = TFile::Open(Form("./realseed/%s/dca/final_hist_dca_realseed.root",particle.Data())); @@ -85,7 +83,7 @@ void doCompare_truth_real_widebins_dcaz(TString particle = "pi-",double etamin=- TH1D *histd0z_truth_1d = (TH1D*)hist_d0z_truth->ProjectionX(Form("histd0z_truth_eta%1.1f_%1.1f_pt%1.1f_%1.1f",etamin,etamax,ptmin,ptmax),etamin_bin,etamax_bin,ptmin_bin,ptmax_bin,"o"); histd0z_truth_1d->SetTitle(Form("d0_{z} (truth): %1.1f <#eta< %1.1f && %1.2f SetName(Form("eta_%1.1f_%1.1f_d0z_truth_pt_%1.1f",etamin,etamax,pt[iptbin])); - if (histd0z_truth_1d->GetEntries()<100) continue; + // if (histd0z_truth_1d->GetEntries()<100) continue; double mu_truth = histd0z_truth_1d->GetMean(); double sigma_truth = histd0z_truth_1d->GetStdDev(); func_truth->SetRange(mu_truth-2.0*sigma_truth,mu_truth+2.0*sigma_truth); // fit with in 2 sigma range @@ -104,7 +102,7 @@ void doCompare_truth_real_widebins_dcaz(TString particle = "pi-",double etamin=- histd0z_real_1d->SetTitle(Form("d0_{z} (real): %1.1f <#eta< %1.1f && %1.2f SetName(Form("eta_%1.1f_%1.1f_d0z_real_pt_%1.1f",etamin,etamax,pt[iptbin])); - if (histd0z_real_1d->GetEntries()<100) continue; + // if (histd0z_real_1d->GetEntries()<100) continue; double mu_real = histd0z_real_1d->GetMean(); double sigma_real = histd0z_real_1d->GetStdDev(); func_real->SetRange(mu_real-2.0*sigma_real,mu_real+2.0*sigma_real); // fit with in 2 sigma range @@ -180,16 +178,7 @@ void doCompare_truth_real_widebins_dcaz(TString particle = "pi-",double etamin=- // draw_req_DCA(etamin,etamax,0.,mgDCAZ->GetXaxis()->GetXmax()); c_dcaz->SaveAs(Form("Final_Results/%s/dca/dcaz_resol_%1.1f_eta_%1.1f.png",particle.Data(),etamin,etamax)); - // Write the numbers in output file for comparisons - outfile<<"ePIC"<GetN(); ++i){ - double x,ytrue, yreal; - gr2->GetPoint(i,x,yreal); - outfile<cd(); + fout->cd(); mgDCAZ->SetName(Form("dcaz_resol_%1.1f_eta_%1.1f",etamin,etamax)); mgDCAZ->Write(); fout->Close();