Skip to content
Snippets Groups Projects

fix: emcal_barrel_pi0 fallback to stats if fit fails

Merged Wouter Deconinck requested to merge wdconinc-master-patch-52847 into master
1 file
+ 7
3
Compare changes
  • Side-by-side
  • Inline
@@ -190,9 +190,13 @@ void emcal_barrel_pi0_analysis(
@@ -190,9 +190,13 @@ void emcal_barrel_pi0_analysis(
h3->SetLineWidth(2);
h3->SetLineWidth(2);
h3->SetLineColor(kBlue);
h3->SetLineColor(kBlue);
auto fit = h3->Fit("gaus","","", fitRange[1][0], fitRange[1][1]);
auto fit = h3->Fit("gaus","","", fitRange[1][0], fitRange[1][1]);
double* res = h3->GetFunction("gaus")->GetParameters();
if (fit == 0) {
sigmaOverE = res[2] / meanE;
double* res = h3->GetFunction("gaus")->GetParameters();
sigmaOverE = res[2] / meanE;
 
} else {
 
std::printf("Fit failed\n");
 
sigmaOverE = h3->GetStdDev() / h3->GetMean();
 
}
c1->SaveAs((fmt::format("results/emcal_barrel_pi0_{}.png", col[1])).c_str());
c1->SaveAs((fmt::format("results/emcal_barrel_pi0_{}.png", col[1])).c_str());
c1->SaveAs((fmt::format("results/emcal_barrel_pi0_{}.pdf", col[1])).c_str());
c1->SaveAs((fmt::format("results/emcal_barrel_pi0_{}.pdf", col[1])).c_str());
std::printf("Resolution %d\n", 1);
std::printf("Resolution %d\n", 1);
Loading