Skip to content
Snippets Groups Projects
Commit 1b3407ef authored by Maria Zurek's avatar Maria Zurek
Browse files

Add fsam from scfi and img to json file

parent ba1d0fd5
Branches
No related tags found
1 merge request!71Resolve "Add sampling fractions from BEMC to the calibration file."
...@@ -53,6 +53,8 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo ...@@ -53,6 +53,8 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo
// variables that will be saved in the JSON file // variables that will be saved in the JSON file
double Ethr_mean; double Ethr_mean;
double fSam_mean; double fSam_mean;
double fSam_img_mean;
double fSam_scfi_mean;
ROOT::EnableImplicitMT(); ROOT::EnableImplicitMT();
std::string input_fname = fmt::format("sim_output/sim_emcal_barrel_{}.root", particle_name); std::string input_fname = fmt::format("sim_output/sim_emcal_barrel_{}.root", particle_name);
...@@ -194,6 +196,7 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo ...@@ -194,6 +196,7 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo
h->Fit("gaus", "", "", down_fit, up_fit); h->Fit("gaus", "", "", down_fit, up_fit);
h->GetXaxis()->SetRangeUser(down_fit,up_fit); h->GetXaxis()->SetRangeUser(down_fit,up_fit);
TF1 *gaus = h->GetFunction("gaus"); TF1 *gaus = h->GetFunction("gaus");
fSam_img_mean = gaus->GetParameter(1);
gaus->SetLineWidth(2); gaus->SetLineWidth(2);
gaus->SetLineColor(kRed); gaus->SetLineColor(kRed);
save_canvas(c5,"fsamImg",particle_name); save_canvas(c5,"fsamImg",particle_name);
...@@ -209,6 +212,7 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo ...@@ -209,6 +212,7 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo
h->Fit("gaus", "", "", down_fit, up_fit); h->Fit("gaus", "", "", down_fit, up_fit);
h->GetXaxis()->SetRangeUser(down_fit,up_fit); h->GetXaxis()->SetRangeUser(down_fit,up_fit);
TF1 *gaus = h->GetFunction("gaus"); TF1 *gaus = h->GetFunction("gaus");
fSam_scfi_mean = gaus->GetParameter(1);
gaus->SetLineWidth(2); gaus->SetLineWidth(2);
gaus->SetLineColor(kRed); gaus->SetLineColor(kRed);
save_canvas(c6,"fsamScFi",particle_name); save_canvas(c6,"fsamScFi",particle_name);
...@@ -217,7 +221,9 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo ...@@ -217,7 +221,9 @@ void emcal_barrel_particles_analysis(std::string particle_name = "electron", boo
j[particle_name] = { j[particle_name] = {
{"particle_name", particle_name}, {"particle_name", particle_name},
{"thrown_energy", Ethr_mean}, {"thrown_energy", Ethr_mean},
{"sampling_fraction", fSam_mean} {"sampling_fraction", fSam_mean},
{"sampling_fraction_img", fSam_img_mean},
{"sampling_fraction_scfi", fSam_scfi_mean}
}; };
if (save_calib) { if (save_calib) {
std::string calib_output_path = "results/emcal_barrel_calibration.json"; std::string calib_output_path = "results/emcal_barrel_calibration.json";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment