6#include <magic_enum/magic_enum.hpp>
7#include <nlohmann/json.hpp>
8#include <nlohmann/json_fwd.hpp>
16 json_obj = nlohmann::ordered_json{
20 {
"energy", options.
energy },
21 {
"theta", options.
theta },
22 {
"phi", options.
phi },
30 auto type_str = std::string{};
31 json_obj.at(
"type").get_to(type_str);
33 json_obj.at(
"multiplicity").get_to(options.
multiplicity);
34 json_obj.at(
"energy").get_to(options.
energy);
35 json_obj.at(
"theta").get_to(options.
theta);
36 json_obj.at(
"phi").get_to(options.
phi);
37 json_obj.at(
"position").get_to(options.
position);
38 auto type_str_val = magic_enum::enum_cast<GeneratorType>(type_str, magic_enum::case_insensitive);
39 if (type_str_val.has_value())
Simulation of NeuLAND Bar/Paddle.
void from_json(const nlohmann::ordered_json &json_obj, GeneratorFactory::Options &options)
void to_json(nlohmann::ordered_json &json_obj, const GeneratorFactory::Options &options)
MinMaxValueD theta
Theta min and max value for outgoing direction.
MinMaxValueD phi
Phi min and max value for outgoing direction.
ROOT::Math::XYZVectorD position
Location of particle generation.
int multiplicity
Multiplicity of particles.
std::string particle_type
Particle type.
ValueErrorD energy
energy value with error [MeV]
GeneratorType generator_type
Type of generator.