From 1fa5d43e557c0d374c052e71b08f3223cc0e51a1 Mon Sep 17 00:00:00 2001 From: Marshall Scott <mbscott@anl.gov> Date: Fri, 25 Jun 2021 17:56:07 -0400 Subject: [PATCH] Changed DrawCopy, works locally --- .../scripts/emcal_barrel_pi0_analysis.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx b/benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx index ded4e93f..8a308187 100644 --- a/benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx +++ b/benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx @@ -29,7 +29,7 @@ using namespace ROOT::VecOps; void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_barrel_pi0.root") { - //input_fname = "../sim_output/sim_emcal_barrel_pi0.root"; + input_fname = "../sim_output/sim_emcal_barrel_pi0.root"; // Setting for graphs gROOT->SetStyle("Plain"); gStyle->SetOptFit(1); @@ -197,10 +197,11 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b }; // Histograms and Fitting - auto hdE = (d1.Histo1D({"hdE", "dE; dE[GeV]; Events", 100, -3.0, 3.0}, "dE"))->DrawCopy(); - auto hdE_rel = (d1.Histo1D({"hdE_rel", "dE Relative; dE Relative; Events", 100, -3.0, 3.0}, "dE_rel"))->DrawCopy(); - hdE->Fit("gaus", "", "", -3.0, 3.0); - double* res = hdE->GetFunction("gaus")->GetParameters(); + auto hdE = d1.Histo1D({"hdE", "dE; dE[GeV]; Events", 100, -3.0, 3.0}, "dE"); + auto hdE_rel = d1.Histo1D({"hdE_rel", "dE Relative; dE Relative; Events", 100, -3.0, 3.0}, "dE_rel"); + auto hdEcopy = hdE->DrawCopy(); + hdEcopy->Fit("gaus", "", "", -3.0, 3.0); + double* res = hdEcopy->GetFunction("gaus")->GetParameters(); double sigmaOverE = res[2] / meanE; // Pass/Fail @@ -213,8 +214,8 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b hdE->GetYaxis()->SetTitleOffset(1.4); hdE->SetLineWidth(2); hdE->SetLineColor(kBlue); - hdE->GetFunction("gaus")->SetLineWidth(2); - hdE->GetFunction("gaus")->SetLineColor(kRed); + //hdE->GetFunction("gaus")->SetLineWidth(2); + //hdE->GetFunction("gaus")->SetLineColor(kRed); hdE->DrawClone(); cdE->SaveAs("results/emcal_barrel_pi0_dE.png"); cdE->SaveAs("results/emcal_barrel_pi0_dE.pdf"); -- GitLab