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

Read sampling frac from JSON file in pion analysis

parent a72d44e6
No related branches found
No related tags found
1 merge request!52Resolve "Add reading sampling fraction from electrons benchmarks"
This commit is part of merge request !52. Comments created here will be created in the context of that merge request.
...@@ -40,14 +40,6 @@ bench:emcal_barrel_pions: ...@@ -40,14 +40,6 @@ bench:emcal_barrel_pions:
script: script:
- root -b -q benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx+ - root -b -q benchmarks/barrel_ecal/scripts/emcal_barrel_pions_analysis.cxx+
bench:emcal_barrel_pi0:
extends: .det_benchmark
stage: benchmarks
needs:
- ["sim:emcal_barrel_pi0"]
script:
- root -b -q benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx+
bench:emcal_barrel_electrons: bench:emcal_barrel_electrons:
extends: .det_benchmark extends: .det_benchmark
stage: benchmarks stage: benchmarks
...@@ -60,6 +52,14 @@ bench:emcal_barrel_electrons: ...@@ -60,6 +52,14 @@ bench:emcal_barrel_electrons:
- echo "JSON file(s) from analysis:" ; cat *.json - echo "JSON file(s) from analysis:" ; cat *.json
- if [[ "$RUN_EXTENDED_BENCHMARK" == "true" ]] ; then root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx+("electron")' ; fi - if [[ "$RUN_EXTENDED_BENCHMARK" == "true" ]] ; then root -b -q 'benchmarks/barrel_ecal/scripts/emcal_barrel_energy_scan_analysis.cxx+("electron")' ; fi
bench:emcal_barrel_pi0:
extends: .det_benchmark
stage: benchmarks
needs:
- ["sim:emcal_barrel_pi0", "bench:emcal_barrel_electrons"]
script:
- root -b -q benchmarks/barrel_ecal/scripts/emcal_barrel_pi0_analysis.cxx+
bench:emcal_barrel_photons: bench:emcal_barrel_photons:
extends: .det_benchmark extends: .det_benchmark
stage: benchmarks stage: benchmarks
......
...@@ -20,9 +20,11 @@ ...@@ -20,9 +20,11 @@
#include "TF1.h" #include "TF1.h"
#include "TH1D.h" #include "TH1D.h"
#include "TFitResult.h" #include "TFitResult.h"
#include <nlohmann/json.hpp>
using ROOT::RDataFrame; using ROOT::RDataFrame;
using namespace ROOT::VecOps; using namespace ROOT::VecOps;
using json = nlohmann::json;
void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_barrel_pi0.root") void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_barrel_pi0.root")
{ {
...@@ -56,12 +58,15 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b ...@@ -56,12 +58,15 @@ void emcal_barrel_pi0_analysis(const char* input_fname = "sim_output/sim_emcal_b
{"quantity", "resolution (in %)"}, {"quantity", "resolution (in %)"},
{"target", std::to_string(resolutionTarget)}}}; {"target", std::to_string(resolutionTarget)}}};
json j;
std::ifstream prev_steps_ifstream("emcal_barrel_particles_analyses.json");
prev_steps_ifstream >> j;
ROOT::EnableImplicitMT(); ROOT::EnableImplicitMT();
ROOT::RDataFrame d0("events", input_fname); ROOT::RDataFrame d0("events", input_fname);
// Sampling Fraction // Sampling Fraction
double samp_frac = 0.0136; double samp_frac = j["electron"]["sampling_fraction"];
// Thrown Energy [GeV] // Thrown Energy [GeV]
auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) { auto Ethr = [](std::vector<dd4pod::Geant4ParticleData> const& input) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment