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

Add fit information

parent 2490eec6
No related branches found
No related tags found
No related merge requests found
...@@ -89,11 +89,11 @@ void energy_scan_analysis(const char* input_fname = "sim_output/rec_emcal_barrel ...@@ -89,11 +89,11 @@ void energy_scan_analysis(const char* input_fname = "sim_output/rec_emcal_barrel
auto hErecImg = d1.Histo1D({"hErecImg", "Reconstructed energy deposit; Energy Deposit [GeV]; Events", 500, 0.0, 0.5},"ErecImg"); auto hErecImg = d1.Histo1D({"hErecImg", "Reconstructed energy deposit; Energy Deposit [GeV]; Events", 500, 0.0, 0.5},"ErecImg");
auto hEClusterImg = d1.Histo1D({"hEClusterImg", "Cluster Energy; Cluster Energy [GeV]; Events", 500, 0.0, 25.0},"EClusterImg"); auto hEClusterImg = d1.Histo1D({"hEClusterImg", "Cluster Energy; Cluster Energy [GeV]; Events", 500, 0.0, 25.0},"EClusterImg");
auto hNClusterImg = d1.Histo1D({"hNClusterImg", "Number of Clusters; # of Clusters; Events", 100, 0.0, 100.0}, "NClusterImg"); auto hNClusterImg = d1.Histo1D({"hNClusterImg", "Number of Clusters; # of Clusters; Events", 100, 0.0, 100.0}, "NClusterImg");
auto hfsamImg = d1.Histo1D({"hfsamImg", "Sampling Fraction; Sampling Fraction; Events", 800, 0.0, 0.2},"fsamImg"); auto hfsamImg = d1.Histo1D({"hfsamImg", "Sampling Fraction; Sampling Fraction; Events", 800, 0.5, 1.5},"fsamImg");
auto hErecScFi = d1.Histo1D({"hErecScFi", "Reconstructed energy deposit; Energy Deposit [GeV]; Events", 500, 0.0, 0.5},"ErecScFi"); auto hErecScFi = d1.Histo1D({"hErecScFi", "Reconstructed energy deposit; Energy Deposit [GeV]; Events", 500, 0.0, 10.0},"ErecScFi");
auto hEClusterScFi = d1.Histo1D({"hEClusterScFi", "Cluster Energy; Cluster Energy [GeV]; Events", 500, 0.0, 25.0},"EClusterScFi"); auto hEClusterScFi = d1.Histo1D({"hEClusterScFi", "Cluster Energy; Cluster Energy [GeV]; Events", 500, 0.0, 25.0},"EClusterScFi");
auto hNClusterScFi = d1.Histo1D({"hNClusterScFi", "Number of Clusters; # of Clusters; Events", 100, 0.0, 100.0}, "NClusterScFi"); auto hNClusterScFi = d1.Histo1D({"hNClusterScFi", "Number of Clusters; # of Clusters; Events", 100, 0.0, 100.0}, "NClusterScFi");
auto hfsamScFi = d1.Histo1D({"hfsamScFi", "Sampling Fraction; Sampling Fraction; Events", 800, 0.0, 0.2},"fsamScFi"); auto hfsamScFi = d1.Histo1D({"hfsamScFi", "Sampling Fraction; Sampling Fraction; Events", 800, 0.8, 1.2},"fsamScFi");
// Event Counts // Event Counts
...@@ -150,29 +150,48 @@ void energy_scan_analysis(const char* input_fname = "sim_output/rec_emcal_barrel ...@@ -150,29 +150,48 @@ void energy_scan_analysis(const char* input_fname = "sim_output/rec_emcal_barrel
hEClusterImg->DrawClone(); hEClusterImg->DrawClone();
c6->SaveAs("results/emcal_barrel_electrons_EclusterImg.png"); c6->SaveAs("results/emcal_barrel_electrons_EclusterImg.png");
{
TCanvas* c7 = new TCanvas("c7", "c7", 700, 500); TCanvas* c7 = new TCanvas("c7", "c7", 700, 500);
c7->SetLogy(1); c7->SetLogy(1);
hfsamScFi->DrawClone();
hfsamScFi->GetYaxis()->SetTitleOffset(1.4); hfsamScFi->GetYaxis()->SetTitleOffset(1.4);
hfsamScFi->SetLineWidth(2); hfsamScFi->SetLineWidth(2);
hfsamScFi->SetLineColor(kBlue); hfsamScFi->SetLineColor(kBlue);
hfsamScFi->Fit("gaus", "", "", 0.01, 0.1); hfsamScFi->Fit("gaus", "", "", 0.01, 0.1);
// From emcal_barrel_pions_analysis.cxx double up_fit = hfsamScFi->GetMean() + 5*hfsamScFi->GetStdDev();
// Commented out for now as giving issues with new container (S. Joosten) double down_fit = hfsamScFi->GetMean() - 5*hfsamScFi->GetStdDev();
// hfsam->GetFunction("gaus")->SetLineWidth(2); if(down_fit <=0 ) down_fit = hfsamScFi->GetXaxis()->GetBinUpEdge(1);
// hfsam->GetFunction("gaus")->SetLineColor(kRed); hfsamScFi->Fit("gaus", "", "", down_fit, up_fit);
hfsamScFi->DrawClone(); hfsamScFi->GetXaxis()->SetRangeUser(down_fit,up_fit);
TF1 *gaus = hfsamScFi->GetFunction("gaus");
gaus->SetLineWidth(2);
gaus->SetLineColor(kRed);
double mean = gaus->GetParameter(1);
double sigma = gaus->GetParameter(2);
double mean_err = gaus->GetParError(1);
double sigma_err = gaus->GetParError(2);
c7->SaveAs("results/emcal_barrel_electrons_fsamScFi.png"); c7->SaveAs("results/emcal_barrel_electrons_fsamScFi.png");
}
{
TCanvas* c8 = new TCanvas("c8", "c8", 700, 500); TCanvas* c8 = new TCanvas("c8", "c8", 700, 500);
c8->SetLogy(1); c8->SetLogy(1);
hfsamImg->DrawClone();
hfsamImg->GetYaxis()->SetTitleOffset(1.4); hfsamImg->GetYaxis()->SetTitleOffset(1.4);
hfsamImg->SetLineWidth(2); hfsamImg->SetLineWidth(2);
hfsamImg->SetLineColor(kBlue); hfsamImg->SetLineColor(kBlue);
hfsamImg->Fit("gaus", "", "", 0.01, 0.1); double up_fit = hfsamImg->GetMean() + 5*hfsamImg->GetStdDev();
// From emcal_barrel_pions_analysis.cxx double down_fit = hfsamImg->GetMean() - 5*hfsamImg->GetStdDev();
// Commented out for now as giving issues with new container (S. Joosten) if(down_fit <=0 ) down_fit = hfsamImg->GetXaxis()->GetBinUpEdge(1);
// hfsam->GetFunction("gaus")->SetLineWidth(2); hfsamImg->Fit("gaus", "", "", down_fit, up_fit);
// hfsam->GetFunction("gaus")->SetLineColor(kRed); hfsamImg->GetXaxis()->SetRangeUser(down_fit,up_fit);
hfsamImg->DrawClone(); TF1 *gaus = hfsamImg->GetFunction("gaus");
gaus->SetLineWidth(2);
gaus->SetLineColor(kRed);
double mean = gaus->GetParameter(1);
double sigma = gaus->GetParameter(2);
double mean_err = gaus->GetParError(1);
double sigma_err = gaus->GetParError(2);
c8->SaveAs("results/emcal_barrel_electrons_fsamImg.png"); c8->SaveAs("results/emcal_barrel_electrons_fsamImg.png");
} }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment