15 #include <nlohmann/json.hpp>
25 return StatusCode::SUCCESS;
32 std::vector< IDTPM::SinglePlotDefinition >
36 using cstr_t =
const std::string&;
38 std::vector< SinglePlotDefinition > plotDefVec;
41 for( cstr_t plotDefStr : m_plotsDefs ) {
50 plotDef.at(
"name" ).get_ref< cstr_t >() :
"";
54 plotDef.at(
"type" ).get_ref< cstr_t >() :
"";
58 plotDef.at(
"folder" ).get_ref< cstr_t >() :
"";
62 plotDef.at(
"title" ).get_ref< cstr_t >() :
"";
65 unsigned int nBinsX =
plotDef.contains(
"xAxis_nBins" ) ?
66 (
unsigned int )std::stoi(
67 plotDef.at(
"xAxis_nBins" ).get_ref< cstr_t >() ) : 0;
70 unsigned int nBinsY =
plotDef.contains(
"yAxis_nBins" ) ?
71 (
unsigned int )std::stoi(
72 plotDef.at(
"yAxis_nBins" ).get_ref< cstr_t >() ) : 0;
75 unsigned int nBinsZ =
plotDef.contains(
"zAxis_nBins" ) ?
76 (
unsigned int )std::stoi(
77 plotDef.at(
"zAxis_nBins" ).get_ref< cstr_t >() ) : 0;
80 float xLow =
plotDef.contains(
"xAxis_low" ) ?
81 std::stof(
plotDef.at(
"xAxis_low" ).get_ref< cstr_t >() ) : 0.;
82 float xHigh =
plotDef.contains(
"xAxis_high" ) ?
83 std::stof(
plotDef.at(
"xAxis_high" ).get_ref< cstr_t >() ) : 0.;
86 float yLow =
plotDef.contains(
"yAxis_low" ) ?
87 std::stof(
plotDef.at(
"yAxis_low" ).get_ref< cstr_t >() ) : 0.;
88 float yHigh =
plotDef.contains(
"yAxis_high" ) ?
89 std::stof(
plotDef.at(
"yAxis_high" ).get_ref< cstr_t >() ) : 0.;
92 float zLow =
plotDef.contains(
"zAxis_low" ) ?
93 std::stof(
plotDef.at(
"zAxis_low" ).get_ref< cstr_t >() ) : 0.;
94 float zHigh =
plotDef.contains(
"zAxis_high" ) ?
95 std::stof(
plotDef.at(
"zAxis_high" ).get_ref< cstr_t >() ) : 0.;
98 cstr_t xTitle =
plotDef.contains(
"xAxis_title" ) ?
99 plotDef.at(
"xAxis_title" ).get_ref< cstr_t >() :
"";
102 cstr_t yTitle =
plotDef.contains(
"yAxis_title" ) ?
103 plotDef.at(
"yAxis_title" ).get_ref< cstr_t >() :
"";
106 cstr_t zTitle =
plotDef.contains(
"zAxis_title" ) ?
107 plotDef.at(
"zAxis_title" ).get_ref< cstr_t >() :
"";
110 plotDefVec.emplace_back(
112 xTitle, nBinsX, xLow, xHigh,
113 yTitle, nBinsY, yLow, yHigh,
114 zTitle, nBinsZ, zLow, zHigh,
118 if( not plotDefVec.back().isValid() ) {
120 plotDefVec.back().plotDigest() );
121 plotDefVec.pop_back();