12#include "rapidjson/document.h"
13#include "rapidjson/writer.h"
14#include "rapidjson/stringbuffer.h"
15#include <fairlogger/Logger.h>
17using namespace rapidjson;
23 auto& alloc = doc.GetAllocator();
25 doc.AddMember(
"binding",
Value(input.
binding.c_str(), alloc), alloc);
29 if (input.
origin.has_value()) {
30 doc.AddMember(
"origin",
Value(input.
origin.value().c_str(), alloc), alloc);
33 doc.AddMember(
"description",
Value(input.
description.value().c_str(), alloc), alloc);
35 if (input.
subSpec.has_value()) {
36 doc.AddMember(
"subSpec",
Value(input.
subSpec.value()), alloc);
46 auto& alloc = doc.GetAllocator();
48 doc.AddMember(
"binding",
Value(
output.binding.c_str(), alloc), alloc);
49 doc.AddMember(
"channel",
Value(
output.channel.c_str(), alloc), alloc);
53 doc.AddMember(
"origin",
Value(
output.origin.c_str(), alloc), alloc);
54 doc.AddMember(
"description",
Value(
output.description.c_str(), alloc), alloc);
55 if (
output.subSpec.has_value()) {
56 doc.AddMember(
"subSpec",
Value(
output.subSpec.value()), alloc);
66 auto& alloc = doc.GetAllocator();
68 doc.AddMember(
"binding",
Value(forward.
binding.c_str(), alloc), alloc);
69 doc.AddMember(
"channel",
Value(forward.
channel.c_str(), alloc), alloc);
73 if (forward.
origin.has_value()) {
74 doc.AddMember(
"origin",
Value(forward.
origin.value().c_str(), alloc), alloc);
77 doc.AddMember(
"description",
Value(forward.
description.value().c_str(), alloc), alloc);
79 if (forward.
subSpec.has_value()) {
80 doc.AddMember(
"subSpec",
Value(forward.
subSpec.value()), alloc);
90 auto& alloc = doc.GetAllocator();
98 inputsArray.SetArray();
99 for (
auto& input : specs.
inputs) {
101 inputValue.CopyFrom(
toJson(input), alloc);
102 inputsArray.PushBack(inputValue, alloc);
104 doc.AddMember(
"inputs", inputsArray, alloc);
107 outputsArray.SetArray();
111 outputsArray.PushBack(outputValue, alloc);
113 doc.AddMember(
"outputs", outputsArray, alloc);
116 forwardsArray.SetArray();
117 for (
auto& forward : specs.
forwards) {
119 forwardValue.CopyFrom(
toJson(forward), alloc);
120 forwardsArray.PushBack(forwardValue, alloc);
122 doc.AddMember(
"forwards", forwardsArray, alloc);
131 auto& alloc = doc.GetAllocator();
133 doc.AddMember(
"name",
Value(
name.c_str(), alloc), alloc);
134 doc.AddMember(
"runId",
Value(
runId.c_str(), alloc), alloc);
138 doc.AddMember(
"specs", specsValue, alloc);
141 Writer<StringBuffer> writer(
buffer);
o2::monitoring::tags::Value Value
Document toJson(const DIMessages::RegisterDevice::Specs::Input &input)
Document specToJson(const DIMessages::RegisterDevice::Specs &specs)
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
GLuint const GLchar * name
boost::optional< std::string > origin
boost::optional< std::string > description
boost::optional< uint32_t > subSpec
std::vector< Output > outputs
std::vector< Input > inputs
size_t maxInputTimeslices
std::vector< Forward > forwards