Files
karl/include/generators/binning_generator.h
2024-12-04 17:15:04 +01:00

76 lines
3.1 KiB
C++
Executable File

#ifndef BINNING_GENERATOR_H
#define BINNING_GENERATOR_H
#include <memory>
#include "blitz/array.h"
#include "simulation/energy_binning.h"
#include "simulation/parameter.h"
#include "simulation/position_binning.h"
namespace generator {
// return a CylinderBinning object as described in the json-object object
// object has to contain a json-object "CylinderBinning"
// "CylinderBinning" has to consist of:
// - json-object "Radial" consisting of a json-double (later cast to an integer) "NumberOfBins"
// and a json-object "MaxRadius", which has to follow the form described in "json_read_length"
// ("simulation/jansson_additionals.h")
// - json-object "Longitudinal" consisting of a json-double (later cast to an integer) "NumberOfBins"
// and a json-object "MaxLength", which has to follow the form described in "json_read_length"
// ("simulation/jansson_additionals.h")
// - json-object "Azimuthal" consisting of a json-double (later cast to an integer) "NumberOfBins"
// example:
// "object" : {
// "CylinderBinning": {
// "Radial": {"NumberOfBins": 1, "MaxRadius" : {...}},
// "Azimuthal": {"NumberOfBins": 1},
// "Longitudinal": {"NumberOfBins": 1, "MaxLength" : {...}}
// }
// }
CylinderBinning buildPositionBinning(json_t* object);
// return a CylinderBinning object described by the json-object in parameter at the
// path "path_to_binning"
// if a json-array called "CreateSameAs" exists: has to consist of the path to the PositionBinning
// json-object that should be used (e.g. ["Object1", "Object2", ..., "PositionBinning"],
// "Object1" has to be located in the root object)
// otherwise same specifications as "buildPositionBinning"
CylinderBinning buildPositionBinningIncludingRedirection(
Parameter& parameter,
json_path& path_to_binning);
// return a EnergyBinning object as defined in the json-object object
// object has to contain:
// - a json-string "Type", defining the type of the EnergyBinning (right now only "Logarithmic" is valid)
// - a json-double "NumberOfBins", defining the number of bins for the binning (will be cast to an int)
// - a json-object "MinEnergy" and a json-object "MaxEnergy", defining the lower and upper
// value for the binning. Both objects have to follow the structure described in
// "json_read_energy" ("simulation/jansson_additionals.h")
//
// example:
// "object": {
// "Type": "Logarithmic",
// "NumberOfBins": 3,
// "MinEnergy": {
// "value": 1,
// "unit": eV
// },
// "MaxEnergy": {
// "value": 1000,
// "unit": eV
// }
// }
EnergyBinning buildEnergyBinning(json_t* object);
// return a EnergyBinning object described by the json-object in parameter at the
// path "path_to_binning"
// if a json-array called "CreateSameAs" exists: has to consist of the path to the EnergyBinning
// json-object that should be used (e.g. ["Object1", "Object2", ..., "EnergyBinning"],
// "Object1" has to be located in the root object)
// otherwise same specifications as "buildEnergy"
EnergyBinning buildEnergyBinningIncludingRedirection(
Parameter& parameter,
json_path& path_to_binning);
}; // namespace generator
#endif /* BINNING_GENERATOR_H */