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

Calculate nb of thrown events

parent 744b3d83
No related branches found
No related tags found
1 merge request!153Draft: Resolve "Add energy scan for Barrel Ecal"
...@@ -37,7 +37,7 @@ imaging_ecal_energy_scan_e: ...@@ -37,7 +37,7 @@ imaging_ecal_energy_scan_e:
- bash benchmarks/imaging_ecal/run_emcal_barrel.sh -t emcal_barrel_${PARTICLE}_${ENERGY} -n 200 -p "${PARTICLE}" -e "${ENERGY}" && echo "${ENERGY}" >> "$E_file" - bash benchmarks/imaging_ecal/run_emcal_barrel.sh -t emcal_barrel_${PARTICLE}_${ENERGY} -n 200 -p "${PARTICLE}" -e "${ENERGY}" && echo "${ENERGY}" >> "$E_file"
parallel: parallel:
matrix: matrix:
- ENERGY: ["2", "5", "10"] - ENERGY: ["2"]
PARTICLE: [electron, pion-] PARTICLE: [electron, pion-]
imaging_ecal_energy_scan_ph: imaging_ecal_energy_scan_ph:
......
...@@ -191,18 +191,18 @@ std::tuple <double, double> extract_sampling_fraction_parameters(std::string E_l ...@@ -191,18 +191,18 @@ std::tuple <double, double> extract_sampling_fraction_parameters(std::string E_l
auto nbins = helectron->GetXaxis()->GetNbins(); auto nbins = helectron->GetXaxis()->GetNbins();
auto integral_helectron = helectron->Integral(); auto integral_helectron = helectron->Integral();
auto ngen_helectron = delectrons.Count(); auto ngen_helectron = delectrons.Count();
std::cout << infoHists[col].name << ": Thrown electron events: " << ngen_helectron << " Histo integral: " << integral_helectron << std::endl; std::cout << infoHists[col].name << ": Thrown electron events: " << (*ngen_helectron) << " Histo integral: " << integral_helectron << std::endl;
auto efficiency_cut_bin = 0; auto efficiency_cut_bin = 0;
for(int bin=1; bin<=nbins;bin++){ for(int bin=1; bin<=nbins;bin++){
auto inegral_helectron_bin = helectron->Integral(1,bin); auto inegral_helectron_bin = helectron->Integral(1,bin);
auto efficiency = 1. - inegral_helectron_bin/ngen_helectron; auto efficiency = 1. - inegral_helectron_bin/(*ngen_helectron);
if(efficiency > requested_efficiency) continue; if(efficiency > requested_efficiency) continue;
else{ else{
efficiency_cut_bin = bin-1; efficiency_cut_bin = bin-1;
break; break;
} }
} }
std::cout << "efficiency cut bin: " << efficiency_cut_bin << " efficiency: " << 1. - (helectron->Integral(1,efficiency_cut_bin))/ngen_helectron << std::endl; std::cout << "efficiency cut bin: " << efficiency_cut_bin << " efficiency: " << 1. - (helectron->Integral(1,efficiency_cut_bin))/(*ngen_helectron) << std::endl;
auto ngen_hpion = dpions.Count(); auto ngen_hpion = dpions.Count();
auto pion_suppresion = hpion->Integral(efficiency_cut_bin, nbins)/ngen_hpion; auto pion_suppresion = hpion->Integral(efficiency_cut_bin, nbins)/ngen_hpion;
std::cout << "pion supression: " << pion_suppresion << std::end; std::cout << "pion supression: " << pion_suppresion << std::end;
......
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