Skip to content
Snippets Groups Projects
Commit 1fa5d43e authored by Marshall Scott's avatar Marshall Scott
Browse files

Changed DrawCopy, works locally

parent c1f7f437
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !51. Comments created here will be created in the context of that merge request.
...@@ -29,7 +29,7 @@ using namespace ROOT::VecOps; ...@@ -29,7 +29,7 @@ using namespace ROOT::VecOps;
void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_barrel_pi0.root") 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 // Setting for graphs
gROOT->SetStyle("Plain"); gROOT->SetStyle("Plain");
gStyle->SetOptFit(1); gStyle->SetOptFit(1);
...@@ -197,10 +197,11 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b ...@@ -197,10 +197,11 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
}; };
// Histograms and Fitting // Histograms and Fitting
auto hdE = (d1.Histo1D({"hdE", "dE; dE[GeV]; Events", 100, -3.0, 3.0}, "dE"))->DrawCopy(); 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"))->DrawCopy(); auto hdE_rel = d1.Histo1D({"hdE_rel", "dE Relative; dE Relative; Events", 100, -3.0, 3.0}, "dE_rel");
hdE->Fit("gaus", "", "", -3.0, 3.0); auto hdEcopy = hdE->DrawCopy();
double* res = hdE->GetFunction("gaus")->GetParameters(); hdEcopy->Fit("gaus", "", "", -3.0, 3.0);
double* res = hdEcopy->GetFunction("gaus")->GetParameters();
double sigmaOverE = res[2] / meanE; double sigmaOverE = res[2] / meanE;
// Pass/Fail // Pass/Fail
...@@ -213,8 +214,8 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b ...@@ -213,8 +214,8 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
hdE->GetYaxis()->SetTitleOffset(1.4); hdE->GetYaxis()->SetTitleOffset(1.4);
hdE->SetLineWidth(2); hdE->SetLineWidth(2);
hdE->SetLineColor(kBlue); hdE->SetLineColor(kBlue);
hdE->GetFunction("gaus")->SetLineWidth(2); //hdE->GetFunction("gaus")->SetLineWidth(2);
hdE->GetFunction("gaus")->SetLineColor(kRed); //hdE->GetFunction("gaus")->SetLineColor(kRed);
hdE->DrawClone(); hdE->DrawClone();
cdE->SaveAs("results/emcal_barrel_pi0_dE.png"); cdE->SaveAs("results/emcal_barrel_pi0_dE.png");
cdE->SaveAs("results/emcal_barrel_pi0_dE.pdf"); cdE->SaveAs("results/emcal_barrel_pi0_dE.pdf");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment