From 0090b5efdcc9e02a39cc77da7fa4d664c6da2d2f Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Sat, 6 Jul 2024 07:30:42 +0200 Subject: [PATCH 1/3] Minor fix and update X axis range --- .../doCompare_truth_real_widebins_mom.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C b/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C index a3871f28..cd4b4198 100644 --- a/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C +++ b/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C @@ -70,6 +70,9 @@ void doCompare_truth_real_widebins_mom(TString particle = "pi-",double etamin=-1 hist_truth->GetXaxis()->SetRangeUser(-1.0*range,1.0*range); func_truth->SetRange(mu_truth-2.0*sigma_truth,mu_truth+2.0*sigma_truth); // fit with in 2 sigma range hist_truth->Fit(func_truth,"NR+"); + mu_truth = func_truth->GetParameter(1); + sigma_truth = func_truth->GetParameter(2); + func_truth->SetRange(mu_truth-2.0*sigma_truth,mu_truth+2.0*sigma_truth); hist_truth->Fit(func_truth,"R+"); float truth_par2 = func_truth->GetParameter(2)*100; float truth_par2_err = func_truth->GetParError(2)*100; @@ -147,7 +150,7 @@ void doCompare_truth_real_widebins_mom(TString particle = "pi-",double etamin=-1 mgMom->Add(gr1); mgMom->Add(gr2); c_mom->cd(); - mgMom->GetXaxis()->SetRangeUser(0.40,10.2); + mgMom->GetXaxis()->SetRangeUser(0.40,15.2); mgMom->GetYaxis()->SetRangeUser(0.,10.0); mgMom->Draw("AP"); lmom->AddEntry(gr1,"Truth Seeding"); From e421843c491efc1bfbe52d0b25e960bbceeac7f9 Mon Sep 17 00:00:00 2001 From: Shyam Date: Sat, 6 Jul 2024 08:14:39 +0200 Subject: [PATCH 2/3] minor fix in the code --- .../doCompare_truth_real_widebins_mom.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C b/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C index cd4b4198..e8eb75ee 100644 --- a/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C +++ b/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C @@ -67,7 +67,7 @@ void doCompare_truth_real_widebins_mom(TString particle = "pi-",double etamin=-1 double mu_truth = hist_truth->GetMean(); double sigma_truth = hist_truth->GetStdDev(); - hist_truth->GetXaxis()->SetRangeUser(-1.0*range,1.0*range); + hist_truth->GetXaxis()->SetRangeUser(-1.0*range,1.0*range); func_truth->SetRange(mu_truth-2.0*sigma_truth,mu_truth+2.0*sigma_truth); // fit with in 2 sigma range hist_truth->Fit(func_truth,"NR+"); mu_truth = func_truth->GetParameter(1); @@ -87,8 +87,8 @@ void doCompare_truth_real_widebins_mom(TString particle = "pi-",double etamin=-1 double mu_real = hist_real->GetMean(); double sigma_real = hist_real->GetStdDev(); - hist_real->GetXaxis()->SetRangeUser(-1.0*range,1.0*range); - func_real->SetRange(mu_real-2.0*sigma_real,mu_real+2.0*sigma_real); // fit with in 2 sigma range + hist_real->GetXaxis()->SetRangeUser(-1.0*range,1.0*range); + func_real->SetRange(mu_real-2.0*sigma_real,mu_real+2.0*sigma_real); // fit with in 2 sigma range hist_real->Fit(func_real,"NR+"); mu_real = func_real->GetParameter(1); sigma_real = func_real->GetParameter(2); From 5847efbd4ac7bb9e7c6828e81ad5b8af9ac8c585 Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Sat, 6 Jul 2024 08:29:42 +0200 Subject: [PATCH 3/3] fixed indentation --- .../doCompare_truth_real_widebins_mom.C | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C b/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C index e8eb75ee..4d417428 100644 --- a/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C +++ b/benchmarks/tracking_performances/doCompare_truth_real_widebins_mom.C @@ -67,7 +67,7 @@ void doCompare_truth_real_widebins_mom(TString particle = "pi-",double etamin=-1 double mu_truth = hist_truth->GetMean(); double sigma_truth = hist_truth->GetStdDev(); - hist_truth->GetXaxis()->SetRangeUser(-1.0*range,1.0*range); + hist_truth->GetXaxis()->SetRangeUser(-1.0*range,1.0*range); func_truth->SetRange(mu_truth-2.0*sigma_truth,mu_truth+2.0*sigma_truth); // fit with in 2 sigma range hist_truth->Fit(func_truth,"NR+"); mu_truth = func_truth->GetParameter(1); @@ -87,8 +87,8 @@ void doCompare_truth_real_widebins_mom(TString particle = "pi-",double etamin=-1 double mu_real = hist_real->GetMean(); double sigma_real = hist_real->GetStdDev(); - hist_real->GetXaxis()->SetRangeUser(-1.0*range,1.0*range); - func_real->SetRange(mu_real-2.0*sigma_real,mu_real+2.0*sigma_real); // fit with in 2 sigma range + hist_real->GetXaxis()->SetRangeUser(-1.0*range,1.0*range); + func_real->SetRange(mu_real-2.0*sigma_real,mu_real+2.0*sigma_real); // fit with in 2 sigma range hist_real->Fit(func_real,"NR+"); mu_real = func_real->GetParameter(1); sigma_real = func_real->GetParameter(2); @@ -118,12 +118,12 @@ void doCompare_truth_real_widebins_mom(TString particle = "pi-",double etamin=-1 err_p_truth[i] = 0.; } - const int size_real = momV_real.size(); + const int size_real = momV_real.size(); double p_real[size_real], err_p_real[size_real], sigma_p_real[size_real], err_sigma_p_real[size_real]; for (int i=0; iGetXaxis()->CenterTitle(); gr1->GetYaxis()->CenterTitle(); - TGraphErrors *gr2 = new TGraphErrors(size_real,p_real,sigma_p_real,err_p_real,err_sigma_p_real); - gr2->SetName("gr_realseed"); + TGraphErrors *gr2 = new TGraphErrors(size_real,p_real,sigma_p_real,err_p_real,err_sigma_p_real); + gr2->SetName("gr_realseed"); gr2->SetMarkerStyle(34); gr2->SetMarkerColor(kRed); gr2->SetMarkerSize(2.0);