diff --git a/benchmarks/imaging_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx b/benchmarks/imaging_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx index 6552952d983b24f18493b42026583e20e0fea769..d8c5fa4424888b81914a79a290f38a651ade8920 100644 --- a/benchmarks/imaging_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx +++ b/benchmarks/imaging_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx @@ -107,7 +107,7 @@ std::tuple <double, double, double, double, double, double, double, double> extr // Define variables auto d1 = d0.Define("Ethr", Ethr, {"mcparticles2"}) - .Define("ErecImg", Erec, {"RecoEcalBarrelHits"}) + .Define("ErecImg", Erec, {"RecoEcalBarrelImagingHits"}) .Define("ErecScFi", Erec, {"EcalBarrelScFiHitsReco"}) .Define("EdigiImg", Edigi, {"DigiEcalBarrelHits"}) .Define("EdigiScFi", Edigi, {"EcalBarrelScFiHitsDigi"}) @@ -123,18 +123,18 @@ std::tuple <double, double, double, double, double, double, double, double> extr // Define Histograms auto hEthr = d1.Histo1D({"hEthr", "Thrown Energy; Thrown Energy [GeV]; Events", 100, 0.0, 25.0},"Ethr"); 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"); - auto hEClusterImg = d1.Histo1D({"hEClusterImg", "Cluster Energy; Cluster Energy [GeV]; Events", 200, 0.0, 25.0},"EClusterImg"); - auto hNClusterImg = d1.Histo1D({"hNClusterImg", "Number of Clusters; # of Clusters; Events", 100, 0.0, 100.0}, "NClusterImg"); - auto hfsamImg = d1.Histo1D({"hfsamImg", "Cluster Energy/E true; Cluster Energy/E true; Events", 100, 0.0, 1.5},"fsamClusterImg"); - auto hfsamRecImg = d1.Histo1D({"hfsamRecImg", "Reco Hits Energy/E true; Reco Hits Energy/E true; Events", 50, 0.0, 0.1},"fsamRecImg"); - - auto hErecScFi = d1.Histo1D({"hErecScFi", "Reconstructed energy deposit; Energy Deposit [GeV]; Events", 500, 0.0, 15.0},"ErecScFi"); - auto hEdigiScFi = d1.Histo1D({"hEdigiScFi", "Digi energy deposit; Amplitude [QCD]; Events", 1000, 0, 200000},"EdigiScFi"); - 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 hfsamScFi = d1.Histo1D({"hfsamScFi", "Cluster Energy/E true; Cluster Energy/E true; Events", 100, 0.8, 1.2},"fsamClusterScFi"); - auto hfsamRecScFi = d1.Histo1D({"hfsamRecScFi", "Reco Hits Energy/E true; Reco Hits Energy/E true; Events", 50, 0.0, 0.25},"fsamRecScFi"); + 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(); @@ -162,20 +162,21 @@ std::tuple <double, double, double, double, double, double, double, double> extr hEdigiScFi->GetYaxis()->SetTitleOffset(1.4); hEdigiScFi->SetLineWidth(2); hEdigiScFi->SetLineColor(kBlue); + set_histo_range(hEdigiScFi); hEdigiScFi->DrawClone(); - //set_histo_range(hEdigiScFi->GetPtr()); + c2->cd(3); hErecImg->GetYaxis()->SetTitleOffset(1.4); hErecImg->SetLineWidth(2); hErecImg->SetLineColor(kBlue); hErecImg->DrawClone(); - //set_histo_range(hErecImg->GetPtr()); + 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->GetPtr()); save_canvas(c2, "E_digi_rec", E_label, particle_label); { TCanvas* c3 = new TCanvas("c3", "c3", 1400, 500); @@ -184,14 +185,16 @@ 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->GetPtr()); + c3->cd(2); hfsamRecScFi->GetYaxis()->SetTitleOffset(1.4); hfsamRecScFi->SetLineWidth(2); hfsamRecScFi->SetLineColor(kBlue); + set_histo_range(hfsamRecScFi); hfsamRecScFi->DrawClone(); - //set_histo_range(hfsamRecScFi->GetPtr()); + save_canvas(c3, "fsam_digi_rec", E_label, particle_label); } { @@ -199,8 +202,9 @@ 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->GetPtr()); + save_canvas(c5, "EClusterSCFi", E_label, particle_label); } { @@ -209,13 +213,13 @@ 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->GetPtr()); + save_canvas(c6, "EClusterImg", E_label, particle_label); } - +{ TCanvas* c8 = new TCanvas("c8", "c8", 700, 500); - hfsamImg->DrawClone(); hfsamImg->GetYaxis()->SetTitleOffset(1.4); hfsamImg->SetLineWidth(2); hfsamImg->SetLineColor(kBlue); @@ -223,7 +227,7 @@ std::tuple <double, double, double, double, double, double, double, double> extr double down_fit = hfsamImg->GetMean() - 5*hfsamImg->GetStdDev(); if(down_fit <=0 ) down_fit = hfsamImg->GetXaxis()->GetBinUpEdge(1); hfsamImg->Fit("gaus", "", "", down_fit, up_fit); - //set_histo_range(hfsamImg->GetPtr()); + set_histo_range(hfsamImg); TF1 *gausImg = hfsamImg->GetFunction("gaus"); gausImg->SetLineWidth(2); gausImg->SetLineColor(kRed); @@ -231,10 +235,11 @@ std::tuple <double, double, double, double, double, double, double, double> extr double sigmaImg = gausImg->GetParameter(2); double meanImg_err = gausImg->GetParError(1); double sigmaImg_err = gausImg->GetParError(2); + hfsamImg->DrawClone(); save_canvas(c8, "fsamClusterImg", E_label, particle_label); - +} +{ TCanvas* c7 = new TCanvas("c7", "c7", 700, 500); - hfsamScFi->DrawClone(); hfsamScFi->GetYaxis()->SetTitleOffset(1.4); hfsamScFi->SetLineWidth(2); hfsamScFi->SetLineColor(kBlue); @@ -243,7 +248,7 @@ std::tuple <double, double, double, double, double, double, double, double> extr down_fit = hfsamScFi->GetMean() - 5*hfsamScFi->GetStdDev(); if(down_fit <=0 ) down_fit = hfsamScFi->GetXaxis()->GetBinUpEdge(1); hfsamScFi->Fit("gaus", "", "", down_fit, up_fit); - //set_histo_range(hfsamScFi->GetPtr()); + set_histo_range(hfsamScFi); TF1 *gaus = hfsamScFi->GetFunction("gaus"); gaus->SetLineWidth(2); gaus->SetLineColor(kRed); @@ -251,9 +256,10 @@ std::tuple <double, double, double, double, double, double, double, double> extr double sigmaScFi = gaus->GetParameter(2); double meanScFi_err = gaus->GetParError(1); double sigmaScFi_err = gaus->GetParError(2); + hfsamScFi->DrawClone(); save_canvas(c7, "fsamClusterScFi", E_label, particle_label); return std::make_tuple(meanScFi, sigmaScFi, meanScFi_err, sigmaScFi_err, meanImg, sigmaImg, meanImg_err, sigmaImg_err); - +} } std::vector<std::string> read_scanned_energies(std::string input_energies_fname)