6#include <magic_enum/magic_enum.hpp>
7#include <nlohmann/json.hpp>
8#include <nlohmann/json_fwd.hpp>
16 json_obj = nlohmann::ordered_json{
19 {
"energy", options.
energy },
20 {
"theta", options.
theta },
21 {
"phi", options.
phi },
29 auto type_str = std::string{};
30 json_obj.at(
"type").get_to(type_str);
32 json_obj.at(
"energy").get_to(options.
energy);
33 json_obj.at(
"theta").get_to(options.
theta);
34 json_obj.at(
"phi").get_to(options.
phi);
35 json_obj.at(
"position").get_to(options.
position);
36 auto type_str_val = magic_enum::enum_cast<GeneratorType>(type_str, magic_enum::case_insensitive);
37 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.
std::string particle_type
Particle type.
ValueErrorD energy
energy value with error [MeV]
GeneratorType generator_type
Type of generator.