Skip to content
Snippets Groups Projects

Resolve "Add reading sampling fraction from electrons benchmarks"

2 files
+ 14
9
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -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) {
Loading