Skip to content
Snippets Groups Projects

Resolve "pi0 resolution for ECal barrel"

Merged Marshall Scott requested to merge 19-pi0-resolution-for-ecal-barrel into master
Compare and Show latest version
1 file
+ 6
4
Compare changes
  • Side-by-side
  • Inline
@@ -20,6 +20,7 @@
#include "TF1.h"
#include "TH1D.h"
#include <TFitResult.h>
#include "TSystem.h"
using ROOT::RDataFrame;
using namespace ROOT::VecOps;
@@ -51,6 +52,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
{"quantity", "resolution (in %)"},
{"target", std::to_string(resolutionTarget)}}};
*/
gSystem->Exec("cp sim_output/sim_emcal_barrel_uniform_pions.root results/sim_emcal_barrel_uniform_pions.root");
ROOT::EnableImplicitMT();
ROOT::RDataFrame d0("events", input_fname);
@@ -106,7 +108,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
return result;
};
// Relative Energy Resolution = (Esampling - Ethrown)/Ethrown
// Relative Energy Resolution = (Esampling - Ethrown)/Esampling
auto eResol_rel = [](const std::vector<double>& sampled, const std::vector<double>& thrown) {
std::vector<double> result;
auto it_sam = sampled.cbegin();
@@ -180,7 +182,7 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
//Energy Resolution Work
auto hdE = d1.Histo1D({"hdE", "dE; dE[GeV]; Events", 20, -7.5, 7.5}, "dE");//changed from 100
auto hdE_rel = d1.Histo1D({"hdE_rel", "dE Relative; dE Relative; Events", 20, -7.5, 7.5}, "dE_rel");//changed from 100
hdE_rel->Fit("gaus", "", "", -7.5, 7.5);
//hdE_rel->Fit("gaus", "", "", -7.5, 7.5);
//double* res = hdE_rel->GetFunction("gaus")->GetParameters();
//Pass/Fail
@@ -207,8 +209,8 @@ void emcal_barrel_pions_analysis(const char* input_fname = "sim_output/sim_emcal
hdE_rel->GetYaxis()->SetTitleOffset(1.4);
hdE_rel->SetLineWidth(2);
hdE_rel->SetLineColor(kBlue);
hdE_rel->GetFunction("gaus")->SetLineWidth(2);
hdE_rel->GetFunction("gaus")->SetLineColor(kRed);
//hdE_rel->GetFunction("gaus")->SetLineWidth(2);
//hdE_rel->GetFunction("gaus")->SetLineColor(kRed);
hdE_rel->DrawClone();
cdE_rel->SaveAs("results/emcal_barrel_pi0_dE_rel.png");
cdE_rel->SaveAs("results/emcal_barrel_pi0_dE_rel.pdf");
Loading