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

Get pointer

parent d71076e6
No related branches found
No related tags found
1 merge request!153Draft: Resolve "Add energy scan for Barrel Ecal"
......@@ -121,20 +121,20 @@ std::tuple <double, double, double, double, double, double, double, double> extr
.Define("fsamClusterScFi", fsam, {"EClusterScFi", "Ethr"});
// Define Histograms
auto hEthr = (TH1D*)d1.Histo1D({"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, 25.0},"Ethr");
auto hEdigiImg = (TH1D*)d1.Histo1D({"hEdigiImg", "Digi energy deposit; Amplitude [QCD]; Events", 1000, 0, 200000},"EdigiImg");
auto hErecImg = (TH1D*)d1.Histo1D({"hErecImg", "Reconstructed energy deposit; Energy Deposit [GeV]; Events", 500, 0.0, 0.5},"ErecImg");
auto hEClusterImg = (TH1D*)d1.Histo1D({"hEClusterImg", "Cluster Energy; Cluster Energy [GeV]; Events", 200, 0.0, 25.0},"EClusterImg");
auto hNClusterImg = (TH1D*)d1.Histo1D({"hNClusterImg", "Number of Clusters; # of Clusters; Events", 100, 0.0, 100.0}, "NClusterImg");
auto hfsamImg = (TH1D*)d1.Histo1D({"hfsamImg", "Cluster Energy/E true; Cluster Energy/E true; Events", 100, 0.0, 1.5},"fsamClusterImg");
auto hfsamRecImg = (TH1D*)d1.Histo1D({"hfsamRecImg", "Reco Hits Energy/E true; Reco Hits Energy/E true; Events", 50, 0.0, 0.1},"fsamRecImg");
auto hErecScFi = (TH1D*)d1.Histo1D({"hErecScFi", "Reconstructed energy deposit; Energy Deposit [GeV]; Events", 500, 0.0, 15.0},"ErecScFi");
auto hEdigiScFi = (TH1D*)d1.Histo1D({"hEdigiScFi", "Digi energy deposit; Amplitude [QCD]; Events", 1000, 0, 200000},"EdigiScFi");
auto hEClusterScFi = (TH1D*)d1.Histo1D({"hEClusterScFi", "Cluster Energy; Cluster Energy [GeV]; Events", 500, 0.0, 25.0},"EClusterScFi");
auto hNClusterScFi = (TH1D*)d1.Histo1D({"hNClusterScFi", "Number of Clusters; # of Clusters; Events", 100, 0.0, 100.0}, "NClusterScFi");
auto hfsamScFi = (TH1D*)d1.Histo1D({"hfsamScFi", "Cluster Energy/E true; Cluster Energy/E true; Events", 100, 0.8, 1.2},"fsamClusterScFi");
auto hfsamRecScFi = (TH1D*)d1.Histo1D({"hfsamRecScFi", "Reco Hits Energy/E true; Reco Hits Energy/E true; Events", 50, 0.0, 0.25},"fsamRecScFi");
auto hEthr = d1.Histo1D({"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, 25.0},"Ethr").GetPtr();
auto hEdigiImg = d1.Histo1D({"hEdigiImg", "Digi energy deposit; Amplitude [QCD]; Events", 1000, 0, 200000},"EdigiImg").GetPtr();
auto hErecImg = d1.Histo1D({"hErecImg", "Reconstructed energy deposit; Energy Deposit [GeV]; Events", 500, 0.0, 0.5},"ErecImg").GetPtr();
auto hEClusterImg = d1.Histo1D({"hEClusterImg", "Cluster Energy; Cluster Energy [GeV]; Events", 200, 0.0, 25.0},"EClusterImg").GetPtr();
auto hNClusterImg = d1.Histo1D({"hNClusterImg", "Number of Clusters; # of Clusters; Events", 100, 0.0, 100.0}, "NClusterImg").GetPtr();
auto hfsamImg = d1.Histo1D({"hfsamImg", "Cluster Energy/E true; Cluster Energy/E true; Events", 100, 0.0, 1.5},"fsamClusterImg").GetPtr();
auto hfsamRecImg = d1.Histo1D({"hfsamRecImg", "Reco Hits Energy/E true; Reco Hits Energy/E true; Events", 50, 0.0, 0.1},"fsamRecImg").GetPtr();
auto hErecScFi = d1.Histo1D({"hErecScFi", "Reconstructed energy deposit; Energy Deposit [GeV]; Events", 500, 0.0, 15.0},"ErecScFi").GetPtr();
auto hEdigiScFi = d1.Histo1D({"hEdigiScFi", "Digi energy deposit; Amplitude [QCD]; Events", 1000, 0, 200000},"EdigiScFi").GetPtr();
auto hEClusterScFi = d1.Histo1D({"hEClusterScFi", "Cluster Energy; Cluster Energy [GeV]; Events", 500, 0.0, 25.0},"EClusterScFi").GetPtr();
auto hNClusterScFi = d1.Histo1D({"hNClusterScFi", "Number of Clusters; # of Clusters; Events", 100, 0.0, 100.0}, "NClusterScFi").GetPtr();
auto hfsamScFi = d1.Histo1D({"hfsamScFi", "Cluster Energy/E true; Cluster Energy/E true; Events", 100, 0.8, 1.2},"fsamClusterScFi").GetPtr();
auto hfsamRecScFi = d1.Histo1D({"hfsamRecScFi", "Reco Hits Energy/E true; Reco Hits Energy/E true; Events", 50, 0.0, 0.25},"fsamRecScFi").GetPtr();
// Event Counts
auto nevents_thrown = d1.Count();
......@@ -155,26 +155,26 @@ std::tuple <double, double, double, double, double, double, double, double> extr
hEdigiImg->GetYaxis()->SetTitleOffset(1.4);
hEdigiImg->SetLineWidth(2);
hEdigiImg->SetLineColor(kBlue);
set_histo_range(hEdigiImg);
hEdigiImg->DrawClone();
set_histo_range(hEdigiImg);
c2->cd(2);
hEdigiScFi->GetYaxis()->SetTitleOffset(1.4);
hEdigiScFi->SetLineWidth(2);
hEdigiScFi->SetLineColor(kBlue);
set_histo_range(hEdigiScFi);
hEdigiScFi->DrawClone();
set_histo_range(hEdigiScFi);
c2->cd(3);
hErecImg->GetYaxis()->SetTitleOffset(1.4);
hErecImg->SetLineWidth(2);
hErecImg->SetLineColor(kBlue);
set_histo_range(hErecImg);
hErecImg->DrawClone();
set_histo_range(hErecImg);
c2->cd(4);
hErecScFi->GetYaxis()->SetTitleOffset(1.4);
hErecScFi->SetLineWidth(2);
hErecScFi->SetLineColor(kBlue);
set_histo_range(hErecScFi);
hErecScFi->DrawClone();
set_histo_range(hErecScFi);
save_canvas(c2, "E_digi_rec", E_label, particle_label);
{
TCanvas* c3 = new TCanvas("c3", "c3", 1400, 500);
......@@ -183,14 +183,14 @@ std::tuple <double, double, double, double, double, double, double, double> extr
hfsamRecImg->GetYaxis()->SetTitleOffset(1.4);
hfsamRecImg->SetLineWidth(2);
hfsamRecImg->SetLineColor(kBlue);
set_histo_range(hfsamRecImg);
hfsamRecImg->DrawClone();
set_histo_range(hfsamRecImg);
c3->cd(2);
hfsamRecScFi->GetYaxis()->SetTitleOffset(1.4);
hfsamRecScFi->SetLineWidth(2);
hfsamRecScFi->SetLineColor(kBlue);
set_histo_range(hfsamRecScFi);
hfsamRecScFi->DrawClone();
set_histo_range(hfsamRecScFi);
save_canvas(c3, "fsam_digi_rec", E_label, particle_label);
}
{
......@@ -198,8 +198,8 @@ std::tuple <double, double, double, double, double, double, double, double> extr
hEClusterScFi->GetYaxis()->SetTitleOffset(1.4);
hEClusterScFi->SetLineWidth(2);
hEClusterScFi->SetLineColor(kBlue);
set_histo_range(hEClusterScFi);
hEClusterScFi->DrawClone();
set_histo_range(hEClusterScFi);
save_canvas(c5, "EClusterSCFi", E_label, particle_label);
}
{
......@@ -208,8 +208,8 @@ std::tuple <double, double, double, double, double, double, double, double> extr
hEClusterImg->GetYaxis()->SetTitleOffset(1.4);
hEClusterImg->SetLineWidth(2);
hEClusterImg->SetLineColor(kBlue);
set_histo_range(hEClusterImg);
hEClusterImg->DrawClone();
set_histo_range(hEClusterImg);
save_canvas(c6, "EClusterImg", E_label, particle_label);
}
......@@ -224,12 +224,12 @@ std::tuple <double, double, double, double, double, double, double, double> extr
hfsamImg->Fit("gaus", "", "", down_fit, up_fit);
set_histo_range(hfsamImg);
TF1 *gaus = hfsamImg->GetFunction("gaus");
gaus->SetLineWidth(2);
gaus->SetLineColor(kRed);
double meanImg = gaus->GetParameter(1);
double sigmaImg = gaus->GetParameter(2);
double meanImg_err = gaus->GetParError(1);
double sigmaImg_err = gaus->GetParError(2);
gausImg->SetLineWidth(2);
gausImg->SetLineColor(kRed);
double meanImg = gausImg->GetParameter(1);
double sigmaImg = gausImg->GetParameter(2);
double meanImg_err = gausImg->GetParError(1);
double sigmaImg_err = gausImg->GetParError(2);
save_canvas(c8, "fsamClusterImg", E_label, particle_label);
TCanvas* c7 = new TCanvas("c7", "c7", 700, 500);
......@@ -280,7 +280,7 @@ void fill_graph_error(TGraphErrors gr_fsam, TGraphErrors gr_fsam_res, double fsa
gr_fsam.SetPoint(gr_fsam.GetN(),E,100*fsam);
gr_fsam.SetPointError(gr_fsam.GetN()-1,0., 100*fsam_err);
gr_fsam_res.SetPoint(gr_fsam_res.GetN(),E,100.0*(fsam_res/fsam));
auto fsam_res_rel_err = 100.0*(sqrt(pow((fsam_res_err/fsamScFi),2)+pow((fsam_err*fsam_res)/(fsam*fsam),2)));
auto fsam_res_rel_err = 100.0*(sqrt(pow((fsam_res_err/fsam),2)+pow((fsam_err*fsam_res)/(fsam*fsam),2)));
gr_fsam_res.SetPointError(gr_fsam_res.GetN()-1,0.,fsam_res_rel_err);
}
......@@ -319,7 +319,7 @@ void emcal_barrel_energy_scan_analysis(std::string particle_label = "electron")
gr_fsamScFi.SetMarkerStyle(20);
gr_fsamScFi.Fit("pol0", "", "", 2., 20.);
gr_fsamScFi.Draw("APE");
c10->cd(2)
c10->cd(2);
TF1* func_res = new TF1("func_res", "[0]/sqrt(x) + [1]", 0.25, 20.);
func_res->SetLineWidth(2);
func_res->SetLineColor(kRed);
......@@ -335,7 +335,7 @@ void emcal_barrel_energy_scan_analysis(std::string particle_label = "electron")
gr_fsamImg.SetMarkerStyle(20);
gr_fsamImg.Fit("pol0", "", "", 2., 20.);
gr_fsamImg.Draw("APE");
c11->cd(2)
c11->cd(2);
TF1* funcImg_res = new TF1("funcImg_res", "[0]/sqrt(x) + [1]", 0.25, 20.);
funcImg_res->SetLineWidth(2);
funcImg_res->SetLineColor(kRed);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment