13#include <fairlogger/Logger.h>
14#include <rapidjson/document.h>
15#include <rapidjson/error/en.h>
16#include <rapidjson/istreamwrapper.h>
25 std::ifstream fileStream(
path, std::ios::in);
26 if (!fileStream.is_open()) {
30 rapidjson::IStreamWrapper isw(fileStream);
31 rapidjson::Document doc;
33 if (doc.HasParseError()) {
34 LOGP(
error,
"Error parsing provided json file '{}':",
path);
35 LOGP(
error,
" - Error -> {}", rapidjson::GetParseError_En(doc.GetParseError()));
36 LOGP(
error,
" - Offset -> {}", doc.GetErrorOffset());
43 for (
auto verItr = doc.MemberBegin(); verItr != doc.MemberEnd(); ++verItr) {
44 const auto&
version = verItr->name.GetString();
46 const auto& elements = doc[
version];
47 for (
const auto& ele : elements.GetArray()) {
48 list.emplace_back(ele.GetString());
52 }
catch (
const std::exception&
e) {
53 LOGP(
error,
"Failed to build detector map from file '{}' with '{}'",
path,
e.what());
63 LOGP(
error,
"List of all available versions including their detectors:");
64 for (
int i{0};
const auto& [
version, elements] : map) {
66 for (
int j{0};
const auto&
element : elements) {
71 LOGP(
error,
"List of available modules for version {}:", list);
72 for (
int j{0};
const auto&
element : map.at(list)) {
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 e
char error[CURL_ERROR_SIZE]
GLsizei const GLchar *const * path
std::vector< std::string > DetectorList_t
void printDetMap(const DetectorMap_t &map, const std::string &list="")
std::unordered_map< std::string, DetectorList_t > DetectorMap_t
bool parseDetectorMapfromJSON(const std::string &path, DetectorMap_t &map)