9#include <nlohmann/json.hpp>
21 inline bool Pass(
double v)
const
49 std::ifstream
f(file);
51 std::cerr <<
"[BmnHodoCuts] Cannot open config: " << file << std::endl;
58 }
catch (
const std::exception& e) {
59 std::cerr <<
"[BmnHodoCuts] JSON parse error in " << file <<
": " << e.what() << std::endl;
63 const json& sec = isExp ? j[
"experiment"] : j[
"simulation"];
66 auto readRange = [](
Range& r,
const json& js,
const char* key) {
67 const std::string kmin = std::string(key) +
"_min";
68 const std::string kmax = std::string(key) +
"_max";
69 if (js.contains(kmin)) {
70 r.
min = js[kmin].get<
double>();
73 if (js.contains(kmax)) {
74 r.
max = js[kmax].get<
double>();
81 readRange(c.
TimeMax, sec,
"fTimeMax");
84 std::cout <<
"[BmnHodoCuts] Loaded cuts for " << (isExp ?
"experiment" :
"simulation") <<
" from " << file
const Float_t d
Z-ccordinate of the first GEM-station.
Data class for BmnHodo digital signal processing.
a class to store JSON values
basic_json<> json
default specialization
bool Pass(double v) const
Range CrosstalkOverIntegral
bool PassExp(const BmnHodoDigi *d) const
static BmnHodoCuts Load(const std::string &file, bool isExp)
bool PassSim(const BmnHodoDigit *d) const